Skip to main content

test_scaffold_ns

Function test_scaffold_ns 

Source
pub fn test_scaffold_ns(q: &str) -> String
Expand description

#1759: the identifier a generated test module imports a unit as (import * as __ns_greet from …). A test module destructures a unit’s values out of this namespace (const { greet } = __ns_greet;), so the namespace can’t take qualified_to_ns’s bare name: a context greet declaring fn greet would shadow its own import and read greet in its temporal dead zone. The reserved __ns_ prefix can’t be a user identifier. Every test-module namespace reference goes through this, in tests_emit and in lowering that runs in_test_scaffold().