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

Side by Side Diff: test/codegen/expect/names.js

Issue 1630963003: Use a symbol for static length/name (conflicts with Function properties in ES5: cannot redefine Fun… (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: left todo Created 4 years, 10 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
« no previous file with comments | « test/codegen/expect/closure.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 dart_library.library('names', null, /* Imports */[ 1 dart_library.library('names', null, /* Imports */[
2 'dart/_runtime', 2 'dart/_runtime',
3 'dart/core' 3 'dart/core'
4 ], /* Lazy imports */[ 4 ], /* Lazy imports */[
5 ], function(exports, dart, core) { 5 ], function(exports, dart, core) {
6 'use strict'; 6 'use strict';
7 let dartx = dart.dartx; 7 let dartx = dart.dartx;
8 exports.exports = 42; 8 exports.exports = 42;
9 const _foo$ = Symbol('_foo'); 9 const _foo$ = Symbol('_foo');
10 class Foo extends core.Object { 10 class Foo extends core.Object {
11 [_foo$]() { 11 [_foo$]() {
12 return 123; 12 return 123;
13 } 13 }
14 } 14 }
15 dart.setSignature(Foo, { 15 dart.setSignature(Foo, {
16 methods: () => ({[_foo$]: [dart.dynamic, []]}) 16 methods: () => ({[_foo$]: [dart.dynamic, []]})
17 }); 17 });
18 function _foo() { 18 function _foo() {
19 return 456; 19 return 456;
20 } 20 }
21 dart.fn(_foo); 21 dart.fn(_foo);
22 class Frame extends core.Object { 22 class Frame extends core.Object {
23 caller(arguments$) { 23 [dartx.caller](arguments$) {
24 this.arguments = arguments$; 24 this.arguments = arguments$;
25 } 25 }
26 static callee() { 26 static [dartx.callee]() {
27 return null; 27 return null;
28 } 28 }
29 } 29 }
30 dart.defineNamedConstructor(Frame, 'caller'); 30 dart.defineNamedConstructor(Frame, dartx.caller);
31 dart.setSignature(Frame, { 31 dart.setSignature(Frame, {
32 constructors: () => ({caller: [Frame, [core.List]]}), 32 constructors: () => ({[dartx.caller]: [Frame, [core.List]]}),
33 statics: () => ({callee: [dart.dynamic, []]}), 33 statics: () => ({[dartx.callee]: [dart.dynamic, []]}),
34 names: ['callee'] 34 names: [dartx.callee]
35 }); 35 });
36 class Frame2 extends core.Object {} 36 class Frame2 extends core.Object {}
37 dart.defineLazyProperties(Frame2, { 37 dart.defineLazyProperties(Frame2, {
38 get caller() { 38 get [dartx.caller]() {
39 return 100; 39 return 100;
40 }, 40 },
41 set caller(_) {}, 41 set [dartx.caller](_) {},
42 get arguments() { 42 get [dartx.arguments]() {
43 return 200; 43 return 200;
44 }, 44 },
45 set arguments(_) {} 45 set [dartx.arguments](_) {}
46 }); 46 });
47 function main() { 47 function main() {
48 core.print(exports.exports); 48 core.print(exports.exports);
49 core.print(new Foo()[_foo$]()); 49 core.print(new Foo()[_foo$]());
50 core.print(_foo()); 50 core.print(_foo());
51 core.print(new Frame.caller([1, 2, 3])); 51 core.print(new Frame[dartx.caller]([1, 2, 3]));
52 let eval$ = Frame.callee; 52 let eval$ = Frame[dartx.callee];
53 core.print(eval$); 53 core.print(eval$);
54 core.print(dart.notNull(Frame2.caller) + dart.notNull(Frame2.arguments)); 54 core.print(dart.notNull(Frame2[dartx.caller]) + dart.notNull(Frame2[dartx.ar guments]));
55 } 55 }
56 dart.fn(main); 56 dart.fn(main);
57 dart.defineExtensionNames([
58 "caller",
59 "callee",
60 "arguments"
61 ]);
57 // Exports: 62 // Exports:
58 exports.Foo = Foo; 63 exports.Foo = Foo;
59 exports.Frame = Frame; 64 exports.Frame = Frame;
60 exports.Frame2 = Frame2; 65 exports.Frame2 = Frame2;
61 exports.main = main; 66 exports.main = main;
62 }); 67 });
OLDNEW
« no previous file with comments | « test/codegen/expect/closure.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698