Created
December 17, 2025 18:36
-
-
Save leegeunhyeok/0bea0de5782070fda92e45cbab89f8f1 to your computer and use it in GitHub Desktop.
Hermes V1 (250829098.0.4) Block Scoping Test
This file contains hidden or 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
| const values = ['a', 'b', 'c']; | |
| const captures = {}; | |
| for (let i = 0; i < values.length; i++) { | |
| const value = values[i]; | |
| captures[value] = () => { | |
| console.log(value); | |
| }; | |
| } | |
| typeof HermesInternal !== 'undefined' && console.log('Running on', HermesInternal.getRuntimeProperties()['OSS Release Version']) | |
| captures.a(); | |
| captures.b(); | |
| captures.c(); | |
| // Output (Hermes): | |
| // Running on 250829098.0.4 | |
| // c | |
| // c | |
| // c | |
| // | |
| // Output (V8): | |
| // V8 | |
| // a | |
| // b | |
| // c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment