Files
sdk/pkg/dev_compiler/test/codegen/expect/functions.js
T
Vijay Menon c139653fcb Check for duplicate library names
This bites us on Angular - dart:collection and angular's collection
(facade) lib smash on top of each other, silently causing issues.

We'll need a better naming convention - perhaps we should use the lib
name and require uniqueness.

Fixes #208

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1145243013
2015-06-05 16:34:10 -07:00

32 lines
822 B
JavaScript

dart.library('functions', null, /* Imports */[
'dart/core'
], /* Lazy imports */[
], function(exports, core) {
'use strict';
function bootstrap() {
return dart.list([new Foo()], Foo);
}
dart.fn(bootstrap, () => dart.functionType(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.functionType(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;
});