-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
Has PRoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Issue originally made by @spicyj
Bug information
- Babel version: 90327ae
- Node version: 4
- npm version: 2
Options
function transform(src) { console.log(require('./packages/babel-core').transform(src, {plugins: [[require('./packages/babel-plugin-transform-es2015-block-scoping'), {tdz: true}]]}).code); }
Input code
> transform('function f() {x;} Math.random() > 0.5 && f(); let x = 5; f();')
function f() {
(function () {
throw new ReferenceError("x is not defined - temporal dead zone");
})();
}Math.random() > 0.5 && f();var x = 5;f();
Description
f should throw only if it's called before the let executes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Has PRoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue