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

Side by Side Diff: tests/compiler/dart2js_foreign/native_method_with_keyword_name_test.dart

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Make sure we can have a native with a name that is a JavaScript keyword. 5 // Make sure we can have a native with a name that is a JavaScript keyword.
6 6
7 import "package:expect/expect.dart";
8 import 'native_metadata.dart'; 7 import 'native_metadata.dart';
9 8
10 @Native("*A") 9 @Native("*A")
11 class A { 10 class A {
12 @native int delete(); 11 @native int delete();
13 } 12 }
14 13
15 @native A makeA() { return new A(); } 14 @native A makeA() { return new A(); }
16 15
17 @Native(""" 16 @Native("""
18 function A() {} 17 function A() {}
19 A.prototype.delete = function() { return 87; }; 18 A.prototype.delete = function() { return 87; };
20 19
21 makeA = function(){return new A;}; 20 makeA = function(){return new A;};
22 """) 21 """)
23 void setup(); 22 void setup();
24 23
25 24
26 main() { 25 main() {
27 setup(); 26 setup();
28 27
29 var a = makeA(); 28 var a = makeA();
30 Expect.equals(87, a.delete()); 29 Expect.equals(87, a.delete());
31 A aa = a; 30 A aa = a;
32 Expect.equals(87, aa.delete()); 31 Expect.equals(87, aa.delete());
33 } 32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698