Files
sdk/pkg/dev_compiler/test/codegen/expect/temps.js
T
John Messerly bc4e0f2a38 fixes #6, refactor to use AnalysisError/Listener throughout dev_compiler
Main goal here was to get rid of the enter/exit compilation unit tracking, to allow further Compiler/Server refactoring. We can get the Uri/LineInfo/contents off Source, which AnalysisError already has
SummaryReporter is now fairly generic.

TODOs for the future:
* figure out what to do about ErrorCodes, in particular dev_compiler prefix feels off.
* skip the intermediate StaticInfo types? They're really just builders now for AnalysisError.
* don't classify all existing messages as "AnalyzerError" ... just print them ...
* skip logger. For our command line program, stdout is part of its "API", IMO it shouldn't use logging for those messages. Consider Pub, which uses stdout/err for its messages, and uses logging for more detailed troubleshooting.

R=pquitslund@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1230903002.
2015-07-10 10:15:08 -07:00

53 lines
1.4 KiB
JavaScript

dart_library.library('temps', null, /* Imports */[
"dart_runtime/dart",
'dart/core'
], /* Lazy imports */[
], function(exports, dart, core) {
'use strict';
let dartx = dart.dartx;
let _x = Symbol('_x');
let __x = Symbol('__x');
let _function = Symbol('_function');
class FormalCollision extends core.Object {
FormalCollision(x, _x$, func) {
this[_x] = x;
this[__x] = _x$;
this[_function] = func;
}
}
dart.setSignature(FormalCollision, {
constructors: () => ({FormalCollision: [FormalCollision, [core.int, core.int, core.Function]]})
});
let _opt = Symbol('_opt');
class OptionalArg extends core.Object {
OptionalArg(opt) {
if (opt === void 0)
opt = 123;
this[_opt] = opt;
this.opt = null;
}
named(opts) {
let opt = opts && 'opt' in opts ? opts.opt : 456;
this.opt = opt;
this[_opt] = null;
}
}
dart.defineNamedConstructor(OptionalArg, 'named');
dart.setSignature(OptionalArg, {
constructors: () => ({
OptionalArg: [OptionalArg, [], [core.int]],
named: [OptionalArg, [], {opt: core.int}]
})
});
function main() {
core.print(new FormalCollision(1, 2, dart.fn(x => x)));
core.print(new OptionalArg()[_opt]);
core.print(new OptionalArg.named()[_opt]);
}
dart.fn(main);
// Exports:
exports.FormalCollision = FormalCollision;
exports.OptionalArg = OptionalArg;
exports.main = main;
});