Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec6e079
commit 41314f8
Showing
7 changed files
with
51 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...proposal-explicit-resource-management/test/fixtures/transform-sync/function-body/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
if (test) { | ||
function fn() { | ||
using x = obj; | ||
doSomethingWith(x); | ||
return doSomethingWith(x); | ||
} |
20 changes: 11 additions & 9 deletions
20
...roposal-explicit-resource-management/test/fixtures/transform-sync/function-body/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
if (test) try { | ||
var _stack = []; | ||
const x = babelHelpers.using(_stack, obj); | ||
doSomethingWith(x); | ||
} catch (_) { | ||
var _error = _; | ||
var _hasError = true; | ||
} finally { | ||
babelHelpers.dispose(_stack, _error, _hasError, typeof SuppressedError !== "undefined" && SuppressedError); | ||
function fn() { | ||
try { | ||
var _stack = []; | ||
const x = babelHelpers.using(_stack, obj); | ||
return doSomethingWith(x); | ||
} catch (_) { | ||
var _error = _; | ||
var _hasError = true; | ||
} finally { | ||
babelHelpers.dispose(_stack, _error, _hasError, typeof SuppressedError !== "undefined" && SuppressedError); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...lugin-proposal-explicit-resource-management/test/fixtures/transform-sync/if-body/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
function fn() { | ||
if (test) { | ||
using x = obj; | ||
return doSomethingWith(x); | ||
doSomethingWith(x); | ||
} |
20 changes: 9 additions & 11 deletions
20
...ugin-proposal-explicit-resource-management/test/fixtures/transform-sync/if-body/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
function fn() { | ||
try { | ||
var _stack = []; | ||
const x = babelHelpers.using(_stack, obj); | ||
return doSomethingWith(x); | ||
} catch (_) { | ||
var _error = _; | ||
var _hasError = true; | ||
} finally { | ||
babelHelpers.dispose(_stack, _error, _hasError, typeof SuppressedError !== "undefined" && SuppressedError); | ||
} | ||
if (test) try { | ||
var _stack = []; | ||
const x = babelHelpers.using(_stack, obj); | ||
doSomethingWith(x); | ||
} catch (_) { | ||
var _error = _; | ||
var _hasError = true; | ||
} finally { | ||
babelHelpers.dispose(_stack, _error, _hasError, typeof SuppressedError !== "undefined" && SuppressedError); | ||
} |
6 changes: 6 additions & 0 deletions
6
...-proposal-explicit-resource-management/test/fixtures/transform-sync/static-block/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class A { | ||
static { | ||
using x = y; | ||
doSomethingWith(x); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...proposal-explicit-resource-management/test/fixtures/transform-sync/static-block/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class A { | ||
static { | ||
try { | ||
var _stack = []; | ||
const x = babelHelpers.using(_stack, y); | ||
doSomethingWith(x); | ||
} catch (_) { | ||
var _error = _; | ||
var _hasError = true; | ||
} finally { | ||
babelHelpers.dispose(_stack, _error, _hasError, typeof SuppressedError !== "undefined" && SuppressedError); | ||
} | ||
} | ||
} |