Check exported bindings are defined (#9589)

* Check exported bindings are defined

* Add tests

* Update flow whitelist

* Add tests for builtins
This commit is contained in:
Daniel Tschinder
2019-02-26 13:28:10 -08:00
committed by GitHub
parent e883ff295d
commit 43eed1ac92
81 changed files with 1594 additions and 315 deletions

View File

@@ -1 +1,2 @@
export {foo, bar};
var foo, bar;

View File

@@ -1,12 +1,15 @@
System.register([], function (_export, _context) {
"use strict";
var foo, bar;
_export({
foo: void 0,
bar: void 0
});
return {
setters: [],
execute: function () {
_export("foo", foo);
_export("bar", bar);
}
execute: function () {}
};
});

View File

@@ -1 +1,2 @@
export {foo as bar};
var foo;

View File

@@ -1,10 +1,12 @@
System.register([], function (_export, _context) {
"use strict";
var foo;
_export("foo", void 0);
return {
setters: [],
execute: function () {
_export("bar", foo);
}
execute: function () {}
};
});

View File

@@ -1 +1,2 @@
export {foo as default};
var foo;

View File

@@ -1,10 +1,12 @@
System.register([], function (_export, _context) {
"use strict";
var foo;
_export("foo", void 0);
return {
setters: [],
execute: function () {
_export("default", foo);
}
execute: function () {}
};
});

View File

@@ -1 +1,2 @@
export {foo as default, bar};
var foo, bar;

View File

@@ -1,12 +1,15 @@
System.register([], function (_export, _context) {
"use strict";
var foo, bar;
_export({
foo: void 0,
bar: void 0
});
return {
setters: [],
execute: function () {
_export("default", foo);
_export("bar", bar);
}
execute: function () {}
};
});

View File

@@ -1,10 +1,12 @@
System.register([], function (_export, _context) {
"use strict";
var foo;
_export("foo", void 0);
return {
setters: [],
execute: function () {
_export("foo", foo);
}
execute: function () {}
};
});

View File

@@ -6,7 +6,7 @@ import * as foo2 from "foo";
import {bar} from "foo";
import {foo as bar2} from "foo";
export {test};
export {foo};
export var test2 = 5;
export default test;
export default foo;

View File

@@ -10,11 +10,11 @@ System.register(["foo", "foo-bar", "./directory/foo-bar"], function (_export, _c
bar2 = _foo.foo;
}, function (_fooBar) {}, function (_directoryFooBar) {}],
execute: function () {
_export("test", test);
_export("foo", foo);
_export("test2", test2 = 5);
_export("default", test);
_export("default", foo);
}
};
});