mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 13:22:07 +00:00
Revert "[for only-parse-twice] eliminate setFromStarDefault"
This reverts commit 566d21e491a4a3a37c0ee0dabc4aebe6fe768398.
This commit is contained in:
@@ -364,7 +364,11 @@ export fn zig__ModuleInfoDeserialized__toJSModuleRecord(
|
||||
for (0.., res.strings_lens) |index, len| {
|
||||
if (res.strings_buf.len < offset + len) return null; // error!
|
||||
const sub = res.strings_buf[offset..][0..len];
|
||||
identifiers.setFromUtf8(index, vm, sub);
|
||||
if (bun.strings.eqlComptime(sub, ModuleInfo.star_default)) {
|
||||
identifiers.setFromStarDefault(index, vm);
|
||||
} else {
|
||||
identifiers.setFromUtf8(index, vm, sub);
|
||||
}
|
||||
offset += len;
|
||||
}
|
||||
|
||||
@@ -435,6 +439,9 @@ const IdentifierArray = opaque {
|
||||
pub fn setFromUtf8(self: *IdentifierArray, n: usize, vm: *bun.JSC.VM, str: []const u8) void {
|
||||
JSC__IdentifierArray__setFromUtf8(self, n, vm, str.ptr, str.len);
|
||||
}
|
||||
|
||||
extern fn JSC__IdentifierArray__setFromStarDefault(identifier_array: *IdentifierArray, n: usize, vm: *bun.JSC.VM) void;
|
||||
pub const setFromStarDefault = JSC__IdentifierArray__setFromStarDefault;
|
||||
};
|
||||
const SourceCode = opaque {};
|
||||
const JSModuleRecord = opaque {
|
||||
|
||||
@@ -77,6 +77,10 @@ extern "C" void JSC__IdentifierArray__setFromUtf8(Identifier* identifierArray, s
|
||||
{
|
||||
identifierArray[n] = Identifier::fromString(vm, AtomString::fromUTF8(std::span<const char>(str, len)));
|
||||
}
|
||||
extern "C" void JSC__IdentifierArray__setFromStarDefault(Identifier* identifierArray, size_t n, VM& vm)
|
||||
{
|
||||
identifierArray[n] = vm.propertyNames->starDefaultPrivateName;
|
||||
}
|
||||
|
||||
extern "C" void JSC__VariableEnvironment__add(VariableEnvironment& environment, Identifier* identifierArray, uint32_t index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user