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

Unified Diff: dart/tests/compiler/dart2js_foreign/native_field_rename_1_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_field_rename_1_test.dart
diff --git a/dart/tests/compiler/dart2js_foreign/native_field_rename_1_test.dart b/dart/tests/compiler/dart2js_foreign/native_field_rename_1_test.dart
index 112854f27085cba0cd73c09544031f501e9f7f8b..c0bd97ccdf0331bf2b8fc7f5c7dbad727420df1f 100644
--- a/dart/tests/compiler/dart2js_foreign/native_field_rename_1_test.dart
+++ b/dart/tests/compiler/dart2js_foreign/native_field_rename_1_test.dart
@@ -6,7 +6,8 @@
// fields. However, native fields keep their name. The implication: a getter
// for the field must be based on the field's name, not the field's jsname.
-class A native "*A" {
+@native("*A")
+class A {
int key; // jsname is 'key'
int getKey() => key;
}
@@ -17,18 +18,19 @@ class B {
int getKey() => key;
}
-class X native "*X" {
- int native_key_method() native 'key';
+@native("*X")
+class X {
+ @native('key') int native_key_method();
// This should cause B.key to be renamed, but not A.key.
- int key() native 'key';
+ @natve('key') int key();
}
-A makeA() native;
-X makeX() native;
+@native A makeA();
+@native X makeX();
-void setup() native """
+@native("""
// This code is all inside 'setup' and so not accesible from the global scope.
function A(){ this.key = 111; }
A.prototype.getKey = function(){return this.key;};
@@ -38,7 +40,8 @@ X.prototype.key = function(){return 666;};
makeA = function(){return new A};
makeX = function(){return new X};
-""";
+""")
+void setup();
testDynamic() {
var things = [makeA(), new B(), makeX()];

Powered by Google App Engine
This is Rietveld 408576698