Add native StringDecoder (#1188)

* Add native StringDecoder

* fix upon reviews

* add Constructor and use LazyClassStructure
This commit is contained in:
Zilin Zhu
2022-09-02 03:56:41 +08:00
committed by GitHub
parent f023b89b73
commit 700c31dd13
13 changed files with 766 additions and 10 deletions

View File

@@ -0,0 +1,15 @@
#include "../bindings/ZigGlobalObject.h"
#include "../bindings/JSStringDecoder.h"
#include "JavaScriptCore/JSGlobalObject.h"
namespace Zig {
inline void generateStringDecoderSourceCode(JSC::JSGlobalObject* lexicalGlobalObject, JSC::Identifier moduleKey, Vector<JSC::Identifier, 4>& exportNames, JSC::MarkedArgumentBuffer& exportValues) {
JSC::VM& vm = lexicalGlobalObject->vm();
GlobalObject* globalObject = reinterpret_cast<GlobalObject*>(lexicalGlobalObject);
exportNames.append(JSC::Identifier::fromString(vm, "StringDecoder"_s));
exportValues.append(globalObject->JSStringDecoder());
}
}