Skip to content

test262 annexB/language at 50% — Annex B B.3.3 sloppy block-function hoisting #5297

Description

@proggeramlug

Summary

Running the previously-skipped annexB/language test262 subtree (node v26 differential) scores 400/801 = 50% — the weakest newly-measured area. One root cause dominates.

Root cause (dominant): Annex B B.3.3 legacy block-level function declarations

In sloppy mode, a function f(){} declared inside a block must ALSO create a var-style binding in the enclosing function/global scope (Annex B.3.3 "FunctionDeclarationInstantiation" / block-level hoisting). Perry only block-scopes it.

Failure breakdown (401 fails):

  • 252 eval-code (e.g. direct/func-switch-case-eval-func-block-scoping.js)
  • 75 function-code (block-decl-func-block-scoping.js)
  • 56 global-code (block-decl-global-block-scoping.js)
  • 7 expressions, 6 literals, 5 statements

Dominant reasons:

  • 126× ReferenceError: f is not defined — the B.3.3 enclosing-scope var binding is missing (function declared in block invisible outside it)
  • 72× "Perry ran clean; Node rejected (missed negative)" — Perry too lenient on Annex B early errors (legacy octal in strict, etc.)
  • 70× eval(...) refused at compile time — eval-using cases (pass once eval is enabled, see separate issue)
  • 44× "value is not updated following eval", 34/14/10× block-scoping SameValue mismatches

Scope to close

Implement B.3.3 sloppy block-function hoisting (the enclosing-scope var binding) — clears ~250+. Then the missed-negatives (Annex B early-error semantics). The eval-refused subset overlaps the eval-enablement issue.

Measurement

scripts/test262_subset.py --dir annexB --all-features (annexB is path-skipped by default). node v26 oracle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions