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

Unified Diff: src/JsEngine.cpp

Issue 29523555: Issue 5552 - use strict mode for all JS in libadblocklus (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: move setting of V8 flags at the very beginning Created Aug. 22, 2017, 10:51 a.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
« no previous file with comments | « lib/compat.js ('k') | test/FileSystemJsObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/JsEngine.cpp
diff --git a/src/JsEngine.cpp b/src/JsEngine.cpp
index eb497a675d63d27be000d5f86a01eeaf7b3eeae9..9b60842f86d447fad91d0a250616c591f3133260 100644
--- a/src/JsEngine.cpp
+++ b/src/JsEngine.cpp
@@ -48,8 +48,11 @@ namespace
class V8Initializer
{
V8Initializer()
- : platform(v8::platform::CreateDefaultPlatform())
+ : platform{nullptr}
{
+ std::string cmd = "--use_strict";
+ v8::V8::SetFlagsFromString(cmd.c_str(), cmd.length());
+ platform = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(platform);
v8::V8::Initialize();
}
« no previous file with comments | « lib/compat.js ('k') | test/FileSystemJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld