Fix tdz checks in transform-block-scoping plugin (#9498)
* Better tdz tests - Use jest's expect.toThrow/expect.not.toThrow - Add input/output tests * Fix basic tdz (a = 2; let a) Fixes #6848 * Make _guessExecutionStatusRelativeTo more robust * Add tests * Return less "unkown" execution status * "function" execution status does not exist * Fix recursive functions * Update helper version * "finally" blocks are always executed * Typo
This commit is contained in:
3
packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/function-ref/input.js
vendored
Normal file
3
packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/function-ref/input.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
function f() { x }
|
||||
maybeCall(f);
|
||||
let x;
|
||||
9
packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/function-ref/output.js
vendored
Normal file
9
packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/function-ref/output.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
var x = babelHelpers.temporalUndefined;
|
||||
|
||||
function f() {
|
||||
babelHelpers.temporalRef(x, "x");
|
||||
}
|
||||
|
||||
maybeCall(f);
|
||||
x = void 0;
|
||||
void 0;
|
||||
Reference in New Issue
Block a user