Files
sdk/pkg/dev_compiler/test/codegen/expect/functions.js
T
Olivier Chafik 7add882a7a Move runtime js files down to lib/runtime/dart
Prepare for writing all the runtime in Dart:
- Move js runtime files to lib/runtime/dart (dart_runtime.js ->
dart/_runtime.js),
- Use rest params instead of arguments slicing in a couple of places.

BUG=https://github.com/dart-lang/dev_compiler/issues/310
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1413683006 .
2015-10-29 16:44:49 +00:00

34 lines
897 B
JavaScript

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