blob: 42ab4dfa57e0784c700378b3bc85e3f39b2de4a4 (
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
32
|
#include "../bindings/ZigGlobalObject.h"
#include "JavaScriptCore/JSGlobalObject.h"
namespace Zig {
JSC::SyntheticSourceProvider::SyntheticSourceGenerator
generateObjectModuleSourceCode(JSC::JSGlobalObject *globalObject,
JSC::JSObject *object) {
JSC::VM &vm = globalObject->vm();
return [strongObject = JSC::Strong<JSC::JSObject>(vm, object)](
JSC::JSGlobalObject *lexicalGlobalObject,
JSC::Identifier moduleKey, Vector<JSC::Identifier, 4> &exportNames,
JSC::MarkedArgumentBuffer &exportValues) -> void {
JSC::VM &vm = lexicalGlobalObject->vm();
GlobalObject *globalObject =
reinterpret_cast<GlobalObject *>(lexicalGlobalObject);
JSC::JSObject *object = strongObject.get();
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));
}
strongObject.clear();
};
}
} // namespace Zig
|