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

Unified Diff: tests/compiler/dart2js_native/native_use_native_name_in_table_frog_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/native_use_native_name_in_table_frog_test.dart
diff --git a/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart b/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart
index d7d115055a91b15d744e4a8855b2c4d6a5c62eb6..0bd930aef63344ceda47eb064a0631f7917ebdc2 100644
--- a/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart
@@ -18,28 +18,31 @@ class B extends A {}
A makeA() native;
B makeB() native;
-void setup() native """
-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(){
+ 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 NativeA() {}
-function NativeB() {}
-inherits(NativeB, NativeA);
-NativeA.prototype.foo = function() { return 42; };
+ function NativeA() {}
+ function NativeB() {}
+ inherits(NativeB, NativeA);
+ NativeA.prototype.foo = function() { return 42; };
-makeA = function(){return new NativeA;};
-makeB = function(){return new NativeB;};
+ makeA = function(){return new NativeA()};
+ makeB = function(){return new NativeB()};
-self.nativeConstructor(NativeA);
-self.nativeConstructor(NativeB);
-""";
+ self.nativeConstructor(NativeA);
+ self.nativeConstructor(NativeB);
+})()""");
+}
main() {
nativeTesting();

Powered by Google App Engine
This is Rietveld 408576698