Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(657)

Unified Diff: frog/tests/leg/src/ClassCodegenTest.dart

Issue 10065015: Reapply "Reduce size by emitting $.foo instead of Isolate.prototype.foo." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | frog/tests/leg/src/NoDuplicateConstructorBodyTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/tests/leg/src/ClassCodegenTest.dart
diff --git a/frog/tests/leg/src/ClassCodegenTest.dart b/frog/tests/leg/src/ClassCodegenTest.dart
index 3ffe724a8f4c485f34de249d318e42f2421eb67d..4d5fce5bbc24569631049abd5893097b6d650d78 100644
--- a/frog/tests/leg/src/ClassCodegenTest.dart
+++ b/frog/tests/leg/src/ClassCodegenTest.dart
@@ -64,21 +64,16 @@ main() {
twoClasses() {
String generated = compileAll(TEST_ONE);
- Expect.isTrue(generated.contains(
- "Isolate.prototype.A = function A() {\n};"));
- Expect.isTrue(generated.contains(
- "Isolate.prototype.B = function B() {\n};"));
+ Expect.isTrue(generated.contains("\$.A = function A() {\n};"));
Lasse Reichstein Nielsen 2012/04/13 08:38:32 You can use a raw string to avoid the escaped $ (l
floitsch 2012/04/13 08:59:59 I would prefer keeping a string and not a regexp h
+ Expect.isTrue(generated.contains("\$.B = function B() {\n};"));
}
subClass() {
checkOutput(String generated) {
- Expect.isTrue(
- generated.contains("Isolate.prototype.A = function A() {\n};"));
- Expect.isTrue(
- generated.contains("Isolate.prototype.B = function B() {\n};"));
+ Expect.isTrue(generated.contains("\$.A = function A() {\n};"));
+ Expect.isTrue(generated.contains("\$.B = function B() {\n};"));
Expect.isTrue(generated.contains(@"Isolate.$inherits = function"));
- Expect.isTrue(generated.contains(
- "Isolate.\$inherits(Isolate.prototype.B, Isolate.prototype.A);\n"));
+ Expect.isTrue(generated.contains(@"Isolate.$inherits($.B, $.A);"));
}
checkOutput(compileAll(TEST_TWO));
@@ -87,8 +82,8 @@ subClass() {
fieldTest() {
String generated = compileAll(TEST_FOUR);
- Expect.isTrue(generated.contains("""
-Isolate.prototype.B = function B(B_z, B_y, A_x) {
+ Expect.isTrue(generated.contains(@"""
+$.B = function B(B_z, B_y, A_x) {
this.z = B_z;
this.y = B_y;
this.x = A_x;
@@ -97,7 +92,7 @@ Isolate.prototype.B = function B(B_z, B_y, A_x) {
constructor1() {
String generated = compileAll(TEST_FIVE);
- Expect.isTrue(generated.contains("new \$.A(x);"));
+ Expect.isTrue(generated.contains(@"new $.A(x);"));
}
main() {
« no previous file with comments | « no previous file | frog/tests/leg/src/NoDuplicateConstructorBodyTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698