Add JSContextRef param to String constructor

Reviewed By: bnham

Differential Revision: D4197300

fbshipit-source-id: 306ffc85e3ced24047b68499f7cdf5e2d31fc052
This commit is contained in:
Pieter De Baets
2016-11-18 06:28:48 -08:00
committed by Facebook Github Bot
parent b1c91606ff
commit 20514e3482
13 changed files with 75 additions and 78 deletions
+2 -2
View File
@@ -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;