Unverified Commit 59644380 authored by Luke Sandberg's avatar Luke Sandberg Committed by GitHub

Fix CI break caused by #98932 (#99621)

No idea how that PR had a clean bill of health?

Some kind of race with export mangling getting enabled by default?
parent 65498960
...@@ -78,17 +78,20 @@ it('exported bindings that are free vars are live', () => { ...@@ -78,17 +78,20 @@ it('exported bindings that are free vars are live', () => {
}) })
it('a constant 0 directly before an accessor binding is bound as a value', () => { it('a constant 0 directly before an accessor binding is bound as a value', () => {
// Enumerating the namespace means its keys cannot be mangled, so it is emitted under the // Bindings are emitted in original name order, which puts `zero` immediately before
// original names and in name order, which puts `zero` immediately before `zeroLive`. // `zeroLive`. Enumerating the namespace keeps the original names on the public facade, but the
// `<locals>` module behind it may still emit mangled keys.
expect(Object.keys(zeroBeforeAccessor)).toEqual([ expect(Object.keys(zeroBeforeAccessor)).toEqual([
'exportsInfo',
'setZeroLive', 'setZeroLive',
'zero', 'zero',
'zeroLive', 'zeroLive',
]) ])
const ns = moduleNamespaceOf('zero_before_accessor.js') const ns = moduleNamespaceOf('zero_before_accessor.js')
expectValue(ns, 'zero', 0) const info = zeroBeforeAccessor.exportsInfo
expectGetter(ns, 'zeroLive') expectValue(ns, info.zero.mangledName, 0)
expectGetter(ns, info.zeroLive.mangledName)
expect(zeroBeforeAccessor.zeroLive).toBe('zeroLive') expect(zeroBeforeAccessor.zeroLive).toBe('zeroLive')
zeroBeforeAccessor.setZeroLive('patched') zeroBeforeAccessor.setZeroLive('patched')
......
...@@ -7,3 +7,7 @@ export let zeroLive = 'zeroLive' ...@@ -7,3 +7,7 @@ export let zeroLive = 'zeroLive'
export function setZeroLive(v) { export function setZeroLive(v) {
zeroLive = v zeroLive = v
} }
// Test-only. `index.js` inspects this module's namespace descriptors directly, and the keys there
// may be mangled; `__webpack_exports_info__` reports the emitted key for each original name.
export const exportsInfo = __webpack_exports_info__
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment