blob: 2b528d7c64869d3ee86a582c189732e385e46d54 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include "ObjectModule.h"
namespace Zig {
JSC::SyntheticSourceProvider::SyntheticSourceGenerator
generateObjectModuleSourceCode(JSC::JSGlobalObject *globalObject,
JSC::JSObject *object) {
JSC::VM &vm = globalObject->vm();
return [object](JSC::JSGlobalObject *lexicalGlobalObject,
JSC::Identifier moduleKey,
Vector<JSC::Identifier, 4> &exportNames,
JSC::MarkedArgumentBuffer &exportValues) -> JSValue {
JSC::VM &vm = lexicalGlobalObject->vm();
GlobalObject *globalObject =
reinterpret_cast<GlobalObject *>(lexicalGlobalObject);
JSC::EnsureStillAliveScope stillAlive(object);
PropertyNameArray properties(vm, PropertyNameMode::Strings,
PrivateSymbolMode::Exclude);
object->getPropertyNames(globalObject, properties,
DontEnumPropertiesMode::Exclude);
for (auto &entry : properties) {
exportNames.append(entry);
exportValues.append(object->get(globalObject, entry));
}
return {};
};
}
} // namespace Zig
|