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

Unified Diff: tests/compiler/dart2js_native/native_testing.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_testing.dart
diff --git a/tests/compiler/dart2js_native/native_testing.dart b/tests/compiler/dart2js_native/native_testing.dart
index 940e993bd59a917db216244814b4bb861a05fee1..6fb363fefebfbb1ed94ac920a94988c6d0e88966 100644
--- a/tests/compiler/dart2js_native/native_testing.dart
+++ b/tests/compiler/dart2js_native/native_testing.dart
@@ -7,12 +7,14 @@
import "package:expect/expect.dart";
import 'dart:_js_helper' show Native;
+import 'dart:_foreign_helper' show JS;
export "package:expect/expect.dart";
export 'dart:_js_helper' show Creates, Native, JSName, Returns;
export 'dart:_foreign_helper' show JS;
-void _setup() native r'''
+void nativeTesting() {
+ JS('', r'''
((function() {
var toStringResultProperty = "_toStringResult";
var objectToStringMethod = Object.prototype.toString;
@@ -26,7 +28,7 @@ void _setup() native r'''
}
}
return objectToStringMethod.call(this);
- }
+ };
// To mock a @Native class with JavaScript constructor `Foo`, add
//
@@ -36,12 +38,9 @@ void _setup() native r'''
self.nativeConstructor = function(constructor, opt_name) {
var toStringResult = "[object " + (opt_name || constructor.name) + "]";
constructor[toStringResultProperty] = toStringResult;
- }
-})());
-''';
-
-void nativeTesting() {
- _setup();
+ };
+})())
+''');
}
@NoInline()

Powered by Google App Engine
This is Rietveld 408576698