mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add JSContextRef param to String constructor
Reviewed By: bnham Differential Revision: D4197300 fbshipit-source-id: 306ffc85e3ced24047b68499f7cdf5e2d31fc052
This commit is contained in:
committed by
Facebook Github Bot
parent
b1c91606ff
commit
20514e3482
@@ -92,7 +92,7 @@ void JSCWebWorker::initJSVMAndLoadScript() {
|
||||
|
||||
// TODO(9604438): Protect against script does not exist
|
||||
std::unique_ptr<const JSBigString> script = WebWorkerUtil::loadScriptFromAssets(scriptName_);
|
||||
evaluateScript(context_, jsStringFromBigString(*script), String(scriptName_.c_str()));
|
||||
evaluateScript(context_, jsStringFromBigString(context_, *script), String(context_, scriptName_.c_str()));
|
||||
|
||||
installGlobalFunction(context_, "postMessage", nativePostMessage);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ JSValueRef JSCWebWorker::nativePostMessage(
|
||||
|
||||
/*static*/
|
||||
Object JSCWebWorker::createMessageObject(JSContextRef context, const std::string& msgJson) {
|
||||
Value rebornJSMsg = Value::fromJSON(context, String(msgJson.c_str()));
|
||||
Value rebornJSMsg = Value::fromJSON(context, String(context, msgJson.c_str()));
|
||||
Object messageObject = Object::create(context);
|
||||
messageObject.setProperty("data", rebornJSMsg);
|
||||
return messageObject;
|
||||
|
||||
Reference in New Issue
Block a user