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

Unified Diff: tests/compiler/dart2js_native/native_no_such_method_exception2_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_no_such_method_exception2_frog_test.dart
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart
index 81bc26c92f85cd9939e0bc7b86dad37f75bda12a..5df3c124015a2a8b3a6a2cdfefda6294f256d24d 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart
@@ -15,27 +15,30 @@ class B extends A {
makeA() native;
makeB() native;
-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;
+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 A() {}
+ function B() {}
+ inherits(B, A);
+ makeA = function() { return new A() };
+ makeB = function() { return new B() };
+ B.prototype.foo = function() { return 42; };
+
+ self.nativeConstructor(A);
+ self.nativeConstructor(B);
+})()""");
}
- function A() {}
- function B() {}
- inherits(B, A);
- makeA = function() { return new A; }
- makeB = function() { return new B; }
- B.prototype.foo = function() { return 42; }
-
- self.nativeConstructor(A);
- self.nativeConstructor(B);
-""";
main() {
nativeTesting();

Powered by Google App Engine
This is Rietveld 408576698