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

Unified Diff: tests/compiler/dart2js_native/native_exceptions1_frog_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_exceptions1_frog_test.dart
diff --git a/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart b/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
index ccdeddec26392dd39a0e5718cb9cea87f8fab888..497a80cb2dcfce0214f76821f0f7fd1a179be0d9 100644
--- a/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
@@ -40,13 +40,18 @@ class B {
makeA() native;
-void setup1() native """
-// Ensure we are not relying on global names 'A' and 'E'.
-A = null;
-E = null;
-""";
+void setup1() {
+ JS('', r"""
+(function(){
+ // Ensure we are not relying on global names 'A' and 'E'.
+ A = null;
+ E = null;
+})()""");
+}
-void setup2() native """
+void setup2() {
+ JS('', r"""
+(function(){
// This code is all inside 'setup2' and so not accessible from the global scope.
function E(x){ this.code = x; }
@@ -55,11 +60,12 @@ A.prototype.op = function (x) {
if (x & 1) throw new E(100);
return x / 2;
};
-makeA = function(){return new A};
+makeA = function(){return new A()};
self.nativeConstructor(E);
self.nativeConstructor(A);
-""";
+})()""");
+}
int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));

Powered by Google App Engine
This is Rietveld 408576698