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

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

Issue 13800006: Update tests and status files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 // Test to see if a Dart class name is confused with dispatch tag. Both class A 5 // Test to see if a Dart class name is confused with dispatch tag. Both class A
6 // and class Z have a JavaScript constuctor named "A". The dynamic native class 6 // and class Z have a JavaScript constuctor named "A". The dynamic native class
7 // dispatch hook on Object.prototype should avoid patching the Dart class A. 7 // dispatch hook on Object.prototype should avoid patching the Dart class A.
8 // This could be done by renaming the Dart constructor or by being able to check 8 // This could be done by renaming the Dart constructor or by being able to check
9 // that objects are Dart classes. 9 // that objects are Dart classes.
10 10
11 import 'package:expect/expect.dart';
12
11 class A { 13 class A {
12 } 14 }
13 15
14 class Z native "*A" { 16 class Z native "*A" {
15 foo() => 100; 17 foo() => 100;
16 } 18 }
17 19
18 makeZ() native; 20 makeZ() native;
19 21
20 void setup() native """ 22 void setup() native """
21 function A(){} 23 function A(){}
22 makeZ = function(){return new A}; 24 makeZ = function(){return new A};
23 """; 25 """;
24 26
25 main() { 27 main() {
26 setup(); 28 setup();
27 29
28 var a = new A(); 30 var a = new A();
29 var z = makeZ(); 31 var z = makeZ();
30 32
31 Expect.equals(100, z.foo()); 33 Expect.equals(100, z.foo());
32 34
33 Expect.throws(() => a.foo(), (ex) => ex is NoSuchMethodError); 35 Expect.throws(() => a.foo(), (ex) => ex is NoSuchMethodError);
34 } 36 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/dart2js.status ('k') | tests/standalone/io/windows_file_system_links_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698