Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1016)

Unified Diff: sky/engine/bindings/core/v8/V8Initializer.cpp

Issue 742183002: Enable ES6 classes. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/tests/js/classes.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings/core/v8/V8Initializer.cpp
diff --git a/sky/engine/bindings/core/v8/V8Initializer.cpp b/sky/engine/bindings/core/v8/V8Initializer.cpp
index dd36c02a2d32789e5b8b961bea216a83d1e12ae2..c3f2234720d05a00c677b3ebecaa7a493a1d7b00 100644
--- a/sky/engine/bindings/core/v8/V8Initializer.cpp
+++ b/sky/engine/bindings/core/v8/V8Initializer.cpp
@@ -191,16 +191,6 @@ static void timerTraceProfilerInMainThread(const char* name, int status)
}
}
-static void initializeV8Common(v8::Isolate* isolate)
-{
- v8::V8::AddGCPrologueCallback(V8GCController::gcPrologue);
- v8::V8::AddGCEpilogueCallback(V8GCController::gcEpilogue);
-
- v8::Debug::SetLiveEditEnabled(isolate, false);
-
- isolate->SetAutorunMicrotasks(false);
-}
-
void V8Initializer::initializeMainThreadIfNeeded()
{
ASSERT(isMainThread());
@@ -210,11 +200,19 @@ void V8Initializer::initializeMainThreadIfNeeded()
return;
initialized = true;
+ static const char v8Flags[] = "--harmony-classes";
eseidel 2014/11/20 18:54:21 We should turn on every last bit of harmony we can
+ v8::V8::SetFlagsFromString(v8Flags, sizeof(v8Flags) - 1);
+
gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode, v8ArrayBufferAllocator());
v8::Isolate* isolate = V8PerIsolateData::initialize();
- initializeV8Common(isolate);
+ v8::V8::AddGCPrologueCallback(V8GCController::gcPrologue);
+ v8::V8::AddGCEpilogueCallback(V8GCController::gcEpilogue);
+
+ v8::Debug::SetLiveEditEnabled(isolate, false);
+
+ isolate->SetAutorunMicrotasks(false);
v8::V8::SetFatalErrorHandler(reportFatalErrorInMainThread);
v8::V8::AddMessageListener(messageHandlerInMainThread);
« no previous file with comments | « no previous file | sky/tests/js/classes.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698