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

Unified Diff: tests/compiler/dart2js_native/runtimetype_test.dart

Issue 2984403002: dart2js_native tests: Migrate 'native STRING' to JS-calls (Closed)
Patch Set: the rest of the files Created 3 years, 5 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
Index: tests/compiler/dart2js_native/runtimetype_test.dart
diff --git a/tests/compiler/dart2js_native/runtimetype_test.dart b/tests/compiler/dart2js_native/runtimetype_test.dart
index 8ceea2ccf9126c4f497df8b19148947c4cee75d4..558f7eedc621448104a4e4a22c07dcaacb4b165f 100644
--- a/tests/compiler/dart2js_native/runtimetype_test.dart
+++ b/tests/compiler/dart2js_native/runtimetype_test.dart
@@ -16,26 +16,29 @@ class B extends A {}
makeA() native;
makeB() native;
-void setup() native """
-// This code is all inside 'setup' and so not accessible from the global scope.
-function inherits(child, parent) {
- function tmp() {};
- tmp.prototype = parent.prototype;
- child.prototype = new tmp();
- child.prototype.constructor = child;
+void setup() {
+ JS('', r"""
+(function(){
+ // This code is inside 'setup' and so not accessible from the global scope.
+ function inherits(child, parent) {
+ function tmp() {};
+ tmp.prototype = parent.prototype;
+ child.prototype = new tmp();
+ child.prototype.constructor = child;
+ }
+
+ function TAGX(){}
+ function TAGY(){}
+ inherits(TAGY, TAGX);
+
+ makeA = function(){return new TAGX()};
+ makeB = function(){return new TAGY()};
+
+ self.nativeConstructor(TAGX);
+ self.nativeConstructor(TAGY);
+})()""");
}
-function TAGX(){}
-function TAGY(){}
-inherits(TAGY, TAGX);
-
-makeA = function(){return new TAGX};
-makeB = function(){return new TAGY};
-
-self.nativeConstructor(TAGX);
-self.nativeConstructor(TAGY);
-""";
-
testDynamicContext() {
var a = makeA();
var b = makeB();
« no previous file with comments | « tests/compiler/dart2js_native/oddly_named_fields_test.dart ('k') | tests/compiler/dart2js_native/super_call_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698