Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/JsValue.cpp

Issue 29369365: Issue #4692 - Rewrite `SetTimeout` facility to avoid `JsValuePtr` and `JsValueList`
Patch Set: Created Dec. 19, 2016, 10:24 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/JsValue.cpp
===================================================================
--- a/src/JsValue.cpp
+++ b/src/JsValue.cpp
@@ -19,6 +19,7 @@
#include <AdblockPlus.h>
#include "JsContext.h"
+#include "JsEngineTransition.h"
#include "JsError.h"
#include "Utils.h"
@@ -213,9 +214,7 @@
const JsContext context(jsEngine);
if (!thisPtr)
{
- v8::Local<v8::Context> localContext = v8::Local<v8::Context>::New(
- jsEngine->GetIsolate(), *jsEngine->context);
- thisPtr = JsValuePtr(new JsValue(jsEngine, localContext->Global()));
+ thisPtr = JsValuePtr(new JsValue(jsEngine, ToInternal(jsEngine)->GetGlobalObject()));
}
if (!thisPtr->IsObject())
throw new std::runtime_error("`this` pointer has to be an object");
« src/JsEngine.cpp ('K') | « src/JsEngineTransition.h ('k') | src/V8Upgrade.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld