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

Unified Diff: tests/compiler/dart2js_native/super_call_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/super_call_test.dart
diff --git a/tests/compiler/dart2js_native/super_call_test.dart b/tests/compiler/dart2js_native/super_call_test.dart
index 44af3a2ceafda6a1e34341693d4240800cc21ab3..5238bb5bbb6a966e25e9fdf88d8c2e0a4871e765 100644
--- a/tests/compiler/dart2js_native/super_call_test.dart
+++ b/tests/compiler/dart2js_native/super_call_test.dart
@@ -36,37 +36,40 @@ makeB() native;
makeC() native;
makeD() native;
-void setup() native """
-// This code is all inside 'setup' and so not accessible from the global scope.
-function inherits(child, parent) {
- if (child.prototype.__proto__) {
- child.prototype.__proto__ = parent.prototype;
- } else {
- 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) {
+ if (child.prototype.__proto__) {
+ child.prototype.__proto__ = parent.prototype;
+ } else {
+ function tmp() {};
+ tmp.prototype = parent.prototype;
+ child.prototype = new tmp();
+ child.prototype.constructor = child;
+ }
}
-}
-function A(){}
-function B(){}
-inherits(B, A);
-function C(){}
-inherits(C, B);
-function D(){}
-inherits(D, C);
+ function A(){}
+ function B(){}
+ inherits(B, A);
+ function C(){}
+ inherits(C, B);
+ function D(){}
+ inherits(D, C);
-makeA = function(){return new A};
-makeB = function(){return new B};
-makeC = function(){return new C};
-makeD = function(){return new D};
+ makeA = function(){return new A()};
+ makeB = function(){return new B()};
+ makeC = function(){return new C()};
+ makeD = function(){return new D()};
-self.nativeConstructor(A);
-self.nativeConstructor(B);
-self.nativeConstructor(C);
-self.nativeConstructor(D);
-""";
+ self.nativeConstructor(A);
+ self.nativeConstructor(B);
+ self.nativeConstructor(C);
+ self.nativeConstructor(D);
+})()""");
+}
main() {
nativeTesting();
« no previous file with comments | « tests/compiler/dart2js_native/runtimetype_test.dart ('k') | tests/compiler/dart2js_native/super_property_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698