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

Unified Diff: dart/tests/compiler/dart2js_foreign/native_class_avoids_hidden_name_test.dart

Issue 10823423: Change dart2js_foreign suite to use metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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: dart/tests/compiler/dart2js_foreign/native_class_avoids_hidden_name_test.dart
diff --git a/dart/tests/compiler/dart2js_foreign/native_class_avoids_hidden_name_test.dart b/dart/tests/compiler/dart2js_foreign/native_class_avoids_hidden_name_test.dart
index ff4be42b2930793adc9982820f701122336220f6..99f53b52921df4693bd4f271e70c2c9621daa8b2 100644
--- a/dart/tests/compiler/dart2js_foreign/native_class_avoids_hidden_name_test.dart
+++ b/dart/tests/compiler/dart2js_foreign/native_class_avoids_hidden_name_test.dart
@@ -4,12 +4,14 @@
// Test that hidden native class names are not used by generated code.
-class A native "*B" {
+@native("*B")
+class A {
get name => 'A';
static A create() => makeA();
}
-class B native "*C" {
+@native("*C")
+class B {
get name => 'B';
static B create() => makeB();
}
@@ -19,23 +21,25 @@ class C { // Ordinary class with name clashing with native class.
static C create() => new C();
}
-makeA() native;
-makeB() native;
+@native makeA();
+@native makeB();
-void setup1() native """
+@native("""
// Poison hidden native names 'B' and 'C' to prove the compiler didn't place
// anthing on the hidden native class.
B = null;
C = null;
-""";
+""")
+void setup1();
-void setup2() native """
+@native("""
// This code is all inside 'setup' and so not accesible from the global scope.
function B(){}
function C(){}
makeA = function(){return new B}; // A is "*B"
makeB = function(){return new C}; // B is "*C"
-""";
+""")
+void setup2();
int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));

Powered by Google App Engine
This is Rietveld 408576698