Files
sdk/pkg/dev_compiler/test/codegen/expect/names.js
T
John Messerly 93251ee241 upgrade to latest analyzer
fixes https://github.com/dart-lang/dev_compiler/issues/471

Changes here are:
* Analyzer now infers list/map literals
* Analyzer changed how isPotentiallyMutated* APIs work, so we need to track current function
* Another fix to arrow functions. We shouldn't skip generating covariant arg checks. If there were any, we use `=> { block }` form rather than `=> expr` form.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1757343002 .
2016-03-03 11:32:54 -08:00

63 lines
1.5 KiB
JavaScript

dart_library.library('names', null, /* Imports */[
'dart/_runtime',
'dart/core'
], /* Lazy imports */[
], function(exports, dart, core) {
'use strict';
let dartx = dart.dartx;
exports.exports = 42;
const _foo$ = Symbol('_foo');
class Foo extends core.Object {
[_foo$]() {
return 123;
}
}
dart.setSignature(Foo, {
methods: () => ({[_foo$]: [dart.dynamic, []]})
});
function _foo() {
return 456;
}
dart.fn(_foo);
class Frame extends core.Object {
caller(arguments$) {
this.arguments = arguments$;
}
static callee() {
return null;
}
}
dart.defineNamedConstructor(Frame, 'caller');
dart.setSignature(Frame, {
constructors: () => ({caller: [Frame, [core.List]]}),
statics: () => ({callee: [dart.dynamic, []]}),
names: ['callee']
});
class Frame2 extends core.Object {}
dart.defineLazyProperties(Frame2, {
get caller() {
return 100;
},
set caller(_) {},
get arguments() {
return 200;
},
set arguments(_) {}
});
function main() {
core.print(exports.exports);
core.print(new Foo()[_foo$]());
core.print(_foo());
core.print(new Frame.caller(dart.list([1, 2, 3], core.int)));
let eval$ = Frame.callee;
core.print(eval$);
core.print(dart.notNull(Frame2.caller) + dart.notNull(Frame2.arguments));
}
dart.fn(main);
// Exports:
exports.Foo = Foo;
exports.Frame = Frame;
exports.Frame2 = Frame2;
exports.main = main;
});