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