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

Unified Diff: tests/compiler/dart2js_native/native_field_optimization_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_field_optimization_test.dart
diff --git a/tests/compiler/dart2js_native/native_field_optimization_test.dart b/tests/compiler/dart2js_native/native_field_optimization_test.dart
index bab27d43d4748fcae2767f96a64798c76405a39d..5b7e0613e264d2234c3653638cd9901276e0e092 100644
--- a/tests/compiler/dart2js_native/native_field_optimization_test.dart
+++ b/tests/compiler/dart2js_native/native_field_optimization_test.dart
@@ -18,32 +18,35 @@ class Foo {
Foo makeFoo() native;
-void setup() native """
-function Foo() { this.i = 0; }
+void setup() {
+ JS('', r"""
+(function(){
+ function Foo() { this.i = 0; }
-Object.defineProperty(Foo.prototype, 'a', {
- get: function () { return (this._a || '') + ++this.i; },
- set: function (v) { this._a = v.toLowerCase(); }
-});
+ Object.defineProperty(Foo.prototype, 'a', {
+ get: function () { return (this._a || '') + ++this.i; },
+ set: function (v) { this._a = v.toLowerCase(); }
+ });
-Object.defineProperty(Foo.prototype, 'b', {
- get: function () { return this._b || ''; },
- set: function (v) { this._b = v.toLowerCase(); }
-});
+ Object.defineProperty(Foo.prototype, 'b', {
+ get: function () { return this._b || ''; },
+ set: function (v) { this._b = v.toLowerCase(); }
+ });
-Object.defineProperty(Foo.prototype, 'ab', {
- get: function () { return this.a + ' ' + this.b; },
- set: function (v) {
- var s = v.split(' ');
- this.a = s[0];
- this.b = s[1];
- }
-});
+ Object.defineProperty(Foo.prototype, 'ab', {
+ get: function () { return this.a + ' ' + this.b; },
+ set: function (v) {
+ var s = v.split(' ');
+ this.a = s[0];
+ this.b = s[1];
+ }
+ });
-makeFoo = function() { return new Foo() }
+ makeFoo = function() { return new Foo() };
-self.nativeConstructor(Foo);
-""";
+ self.nativeConstructor(Foo);
+})()""");
+}
test1() {
var f = makeFoo();

Powered by Google App Engine
This is Rietveld 408576698