Re: exports at the top of the file

2016-06-07 Thread Raul-Sebastian Mihăilă
I don't think it was related to nesting. Anyway, I wrote to him something similar to what I wrote here and later he agreed. Thanks for confirming. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: exports at the top of the file

2016-06-07 Thread Ben Newman
Is it possible that Crock meant export declarations should be restricted to the *top level* of the file? In other words, they can't be nested in conditional blocks or inside functions, but they can appear anywhere in the outermost scope of the module? If so, that's effectively what ECMAScript

Re: exports at the top of the file

2016-06-06 Thread Logan Smyth
> > ```js > export default myConst; > const myConst = {}; > ``` > would throw because when the export is evaluated Correct, if you wanted to export `myConst` as the default without that issue, you'd want to do ``` export {myConst as default}; const myConst = {}; ``` to declaratively expose the

exports at the top of the file

2016-06-06 Thread Raul-Sebastian Mihăilă
Douglas Crockford said that eventually JSLint would require exports at the top of the file. However I think there are some issues. If my understanding is correct, ```js export default myConst; const myConst = {}; ``` would throw because when the export is evaluated, in step 2 of the Evaluation