Files
sdk/pkg/dev_compiler/test/codegen/expect/functions.js
T
John Messerly 0c148ecef4 Implement modular compilation
Highlights
* compile one module at a time
* use summaries to speed up compiles
* use command runner so we can add more commands later
* some long needed renames and file organization
* various other technical debt has been addressed

Lowlights
* lost node.js runner/tests (node output format still supported)
* possibly lost some closure support/workarounds (format still supported)
* needs more end-to-end tests of the new system

R=vsm@google.com

Review URL: https://codereview.chromium.org/1879373004 .
2016-04-14 11:28:12 -07:00

30 lines
1.0 KiB
JavaScript

dart_library.library('functions', null, /* Imports */[
'dart_sdk'
], function(exports, dart_sdk) {
'use strict';
const core = dart_sdk.core;
const dart = dart_sdk.dart;
const dartx = dart_sdk.dartx;
const functions = Object.create(null);
functions.bootstrap = function() {
return dart.list([new functions.Foo()], functions.Foo);
};
dart.fn(functions.bootstrap, () => dart.definiteFunctionType(core.List$(functions.Foo), []));
functions.A2B$ = dart.generic((A, B) => {
const A2B = dart.typedef('A2B', () => dart.functionType(B, [A]));
return A2B;
});
functions.A2B = functions.A2B$();
functions.id = function(f) {
return f;
};
dart.fn(functions.id, () => dart.definiteFunctionType(functions.A2B$(functions.Foo, functions.Foo), [functions.A2B$(functions.Foo, functions.Foo)]));
functions.Foo = class Foo extends core.Object {};
functions.main = function() {
core.print(functions.bootstrap()[dartx.get](0));
};
dart.fn(functions.main, dart.void, []);
// Exports:
exports.functions = functions;
});