Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make typeof throw when accessing uninitialized variables #2902

Merged
merged 1 commit into from
May 5, 2023

Conversation

raskad
Copy link
Member

@raskad raskad commented May 5, 2023

This Pull Request changes the following:

  • Make typeof throw when accessing uninitialized variables

Currently typeof returns undefined when accessing uninitialized bindings like const, let, class.

@raskad raskad added bug Something isn't working execution Issues or PRs related to code execution labels May 5, 2023
@raskad raskad added this to the v0.17.0 milestone May 5, 2023
@HalidOdat HalidOdat requested a review from a team May 5, 2023 16:45
@github-actions
Copy link

github-actions bot commented May 5, 2023

Test262 conformance changes

Test result main count PR count difference
Total 94,601 94,601 0
Passed 73,298 73,328 +30
Ignored 17,540 17,540 0
Failed 3,763 3,733 -30
Panics 0 0 0
Conformance 77.48% 77.51% +0.03%
Fixed tests (30):
test/language/module-code/instn-local-bndng-let.js [strict mode] (previously Failed)
test/language/module-code/instn-local-bndng-let.js (previously Failed)
test/language/module-code/instn-local-bndng-cls.js [strict mode] (previously Failed)
test/language/module-code/instn-local-bndng-cls.js (previously Failed)
test/language/module-code/instn-local-bndng-const.js [strict mode] (previously Failed)
test/language/module-code/instn-local-bndng-const.js (previously Failed)
test/language/eval-code/direct/lex-env-no-init-let.js [strict mode] (previously Failed)
test/language/eval-code/direct/lex-env-no-init-let.js (previously Failed)
test/language/eval-code/direct/lex-env-no-init-cls.js [strict mode] (previously Failed)
test/language/eval-code/direct/lex-env-no-init-cls.js (previously Failed)
test/language/eval-code/direct/lex-env-no-init-const.js [strict mode] (previously Failed)
test/language/eval-code/direct/lex-env-no-init-const.js (previously Failed)
test/language/eval-code/indirect/lex-env-no-init-let.js [strict mode] (previously Failed)
test/language/eval-code/indirect/lex-env-no-init-let.js (previously Failed)
test/language/eval-code/indirect/lex-env-no-init-cls.js [strict mode] (previously Failed)
test/language/eval-code/indirect/lex-env-no-init-cls.js (previously Failed)
test/language/eval-code/indirect/lex-env-no-init-const.js [strict mode] (previously Failed)
test/language/eval-code/indirect/lex-env-no-init-const.js (previously Failed)
test/language/statements/for-of/scope-head-lex-close.js [strict mode] (previously Failed)
test/language/statements/for-of/scope-head-lex-close.js (previously Failed)
test/language/statements/for-of/scope-head-lex-open.js [strict mode] (previously Failed)
test/language/statements/for-of/scope-head-lex-open.js (previously Failed)
test/language/statements/for-of/scope-body-lex-open.js [strict mode] (previously Failed)
test/language/statements/for-of/scope-body-lex-open.js (previously Failed)
test/language/statements/for-in/scope-head-lex-close.js [strict mode] (previously Failed)
test/language/statements/for-in/scope-head-lex-close.js (previously Failed)
test/language/statements/for-in/scope-head-lex-open.js [strict mode] (previously Failed)
test/language/statements/for-in/scope-head-lex-open.js (previously Failed)
test/language/statements/for-in/scope-body-lex-open.js [strict mode] (previously Failed)
test/language/statements/for-in/scope-body-lex-open.js (previously Failed)

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change!

@jedel1043 jedel1043 enabled auto-merge May 5, 2023 17:08
Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@jedel1043 jedel1043 added this pull request to the merge queue May 5, 2023
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch :)

Merged via the queue into main with commit 990e4df May 5, 2023
@HalidOdat HalidOdat deleted the fix-typeof-uninitialized branch May 5, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants