Files
sdk/pkg/dev_compiler/test/codegen/expect/node_modules.js
T
Olivier Chafik edaf069dba Add --modules=node support
- Force import order in all sdk files + simplify module builders
- Stub a node_test.sh with hello world + DeltaBlue (to be expanded to language tests in a followup change)
- Use global_ from dart:_runtime in html lib
- Better export for symbols that node chokes upon: throw, const, void, implements, export... (define as throw_ locally, with proper local resolution, then export as throw).
- Cleanup node module builder

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1633003002 .
2016-01-29 10:01:48 +00:00

51 lines
1.1 KiB
JavaScript

'use strict';
let dart = require("dart/_runtime");
let core = require("dart/core");
let dartx = dart.dartx;
const Callback = dart.typedef('Callback', () => dart.functionType(dart.void, [], {i: core.int}));
class A extends core.Object {}
class _A extends core.Object {}
const B$ = dart.generic(function(T) {
class B extends core.Object {}
return B;
});
let B = B$();
const _B$ = dart.generic(function(T) {
class _B extends core.Object {}
return _B;
});
let _B = _B$();
function f() {
}
dart.fn(f);
function _f() {
}
dart.fn(_f);
const constant = "abc";
exports.finalConstant = "abc";
dart.defineLazyProperties(exports, {
get lazy() {
return dart.as(dart.fn(() => {
core.print('lazy');
return "abc";
})(), core.String);
}
});
exports.mutable = "abc";
dart.defineLazyProperties(exports, {
get lazyMutable() {
return dart.as(dart.fn(() => {
core.print('lazyMutable');
return "abc";
})(), core.String);
},
set lazyMutable(_) {}
});
// Exports:
exports.Callback = Callback;
exports.A = A;
exports.B$ = B$;
exports.B = B;
exports.f = f;
exports.constant = constant;