-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[helpers ts conversion] temporal dead zone (#16520)
Co-authored-by: Nicolò Ribaudo <[email protected]>
- Loading branch information
1 parent
960dacf
commit 9b3667a
Showing
4 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/babel-helpers/src/helpers/tdz.js → packages/babel-helpers/src/helpers/tdz.ts
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,5 +1,5 @@ | ||
/* @minVersion 7.5.5 */ | ||
|
||
export default function _tdzError(name) { | ||
export default function _tdzError(name: string): never { | ||
throw new ReferenceError(name + " is not defined - temporal dead zone"); | ||
} |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
/* @minVersion 7.0.0-beta.0 */ | ||
|
||
import undef from "./temporalUndefined.ts"; | ||
import err from "./tdz.ts"; | ||
|
||
export default function _temporalRef<T>(val: T, name: string) { | ||
return val === undef ? err(name) : val; | ||
} |
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