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

Side by Side Diff: tests/compiler/dart2js_native/oddly_named_fields_test.dart

Issue 383413003: Add @Native(...) annotation for native class names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:_js_helper'; 5 import 'dart:_js_helper';
6 6
7 // JavaScript reserved words: 7 // JavaScript reserved words:
8 // 8 //
9 // break 9 // break
10 // case 10 // case
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // 54 //
55 // Funny thing in JavaScript: there are two syntactic categories: 55 // Funny thing in JavaScript: there are two syntactic categories:
56 // "Identifier" and "IdentifierName". The latter includes reserved 56 // "Identifier" and "IdentifierName". The latter includes reserved
57 // words. This is legal JavaScript according to ECMA-262.5: 57 // words. This is legal JavaScript according to ECMA-262.5:
58 // 58 //
59 // this.default 59 // this.default
60 // 60 //
61 // See section 11.2 "Left-Hand-Side Expressions" which states that a 61 // See section 11.2 "Left-Hand-Side Expressions" which states that a
62 // "MemberExpression" includes: "MemberExpression . IdentifierName". 62 // "MemberExpression" includes: "MemberExpression . IdentifierName".
63 63
64 class NativeClassWithOddNames native "NativeClassWithOddNames" { 64 @Native("NativeClassWithOddNames")
65 class NativeClassWithOddNames {
65 @JSName('break') bool breakValue; 66 @JSName('break') bool breakValue;
66 @JSName('case') bool caseValue; 67 @JSName('case') bool caseValue;
67 @JSName('catch') bool catchValue; 68 @JSName('catch') bool catchValue;
68 @JSName('class') bool classValue; 69 @JSName('class') bool classValue;
69 @JSName('const') bool constValue; 70 @JSName('const') bool constValue;
70 @JSName('continue') bool continueValue; 71 @JSName('continue') bool continueValue;
71 @JSName('debugger') bool debuggerValue; 72 @JSName('debugger') bool debuggerValue;
72 @JSName('default') bool defaultValue; 73 @JSName('default') bool defaultValue;
73 @JSName('delete') bool deleteValue; 74 @JSName('delete') bool deleteValue;
74 @JSName('do') bool doValue; 75 @JSName('do') bool doValue;
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 1379
1379 main() { 1380 main() {
1380 setup(); 1381 setup();
1381 var object = makeNativeClassWithOddNames(); 1382 var object = makeNativeClassWithOddNames();
1382 object.testMyFields(); 1383 object.testMyFields();
1383 testObjectStronglyTyped(object); 1384 testObjectStronglyTyped(object);
1384 testObjectWeaklyTyped([object]); 1385 testObjectWeaklyTyped([object]);
1385 testObjectWeaklyTyped(['fisk']); 1386 testObjectWeaklyTyped(['fisk']);
1386 testObjectWeaklyTyped([new ClassWithOddNames()..testMyFields()]); 1387 testObjectWeaklyTyped([new ClassWithOddNames()..testMyFields()]);
1387 } 1388 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698