| 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();
|
|
|