Named export/import
// export.js
exportfunction foo() {
return "foo";
}
export class Bar {}
export var baz = "baz";
// import.js
import {foo, Bar, baz} from "./export.js";
foo();
new Bar();
console.log(baz); // "baz"
jsc shellでES6 Modules体験
•JavaScriptCoreが初期実装 (Constellation++)
• http://nightly.webkit.org/
• Download the latest binary for Mac OS
$ WebKit.app/Contents/Frameworks/10.11/
JavaScriptCore.framework/Versions/A/Resources/jsc
-m ./module.js