| Index: tests/compiler/dart2js_native/fixup_get_tag_test.dart
|
| diff --git a/tests/compiler/dart2js_native/fixup_get_tag_test.dart b/tests/compiler/dart2js_native/fixup_get_tag_test.dart
|
| index 109edc11640e1248667dd9fa5e9056508bcbb0ab..e4e1ab8ec2e1f889b34847f3efd1e81944ead38a 100644
|
| --- a/tests/compiler/dart2js_native/fixup_get_tag_test.dart
|
| +++ b/tests/compiler/dart2js_native/fixup_get_tag_test.dart
|
| @@ -12,30 +12,33 @@ class Foo {
|
| token() native;
|
| }
|
|
|
| -void setup() native r"""
|
| -
|
| -dartExperimentalFixupGetTag = function (originalGetTag) {
|
| - function fixedGetTag(obj) {
|
| - // Local JS 'class' B is made to be another implementation of the native
|
| - // class with tag 'A'.
|
| - if (obj instanceof B) return 'A';
|
| - // Other classes behave as before.
|
| - return originalGetTag(obj);
|
| - }
|
| - return fixedGetTag;
|
| -};
|
| -
|
| -function A(){ }
|
| -A.prototype.token = function () { return 'isA'; }
|
| -
|
| -function B(){ }
|
| -B.prototype.token = function () { return 'isB'; }
|
| -
|
| -makeA = function() { return new A; };
|
| -makeB = function() { return new B; };
|
| -
|
| -self.nativeConstructor(A);
|
| -""";
|
| +void setup() {
|
| + JS('', r"""
|
| +(function(){
|
| +
|
| + dartExperimentalFixupGetTag = function (originalGetTag) {
|
| + function fixedGetTag(obj) {
|
| + // Local JS 'class' B is made to be another implementation of the native
|
| + // class with tag 'A'.
|
| + if (obj instanceof B) return 'A';
|
| + // Other classes behave as before.
|
| + return originalGetTag(obj);
|
| + }
|
| + return fixedGetTag;
|
| + };
|
| +
|
| + function A(){ }
|
| + A.prototype.token = function () { return 'isA'; };
|
| +
|
| + function B(){ }
|
| + B.prototype.token = function () { return 'isB'; };
|
| +
|
| + makeA = function() { return new A(); };
|
| + makeB = function() { return new B(); };
|
| +
|
| + self.nativeConstructor(A);
|
| +})()""");
|
| +}
|
|
|
| makeA() native;
|
| makeB() native;
|
|
|