summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/bindings/v8/V8DOMWindowShell.cpp')
-rw-r--r--Source/WebCore/bindings/v8/V8DOMWindowShell.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
index f53e1b7..d88d8a6 100644
--- a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -39,6 +39,7 @@
#include "FrameLoaderClient.h"
#include "Page.h"
#include "PageGroup.h"
+#include "RuntimeEnabledFeatures.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
#include "ScriptController.h"
@@ -62,6 +63,11 @@
#include <utility>
#include <v8-debug.h>
#include <v8.h>
+
+#if ENABLE(JAVASCRIPT_I18N_API)
+#include <v8/src/extensions/experimental/i18n-extension.h>
+#endif
+
#include <wtf/Assertions.h>
#include <wtf/OwnArrayPtr.h>
#include <wtf/StdLibExtras.h>
@@ -368,9 +374,15 @@ v8::Persistent<v8::Context> V8DOMWindowShell::createNewContext(v8::Handle<v8::Ob
if (!V8Proxy::registeredExtensionWithV8(DateExtension::get()))
V8Proxy::registerExtension(DateExtension::get());
+#if ENABLE(JAVASCRIPT_I18N_API)
+ // Enables experimental i18n API in V8.
+ if (RuntimeEnabledFeatures::javaScriptI18NAPIEnabled() && !V8Proxy::registeredExtensionWithV8(v8::internal::I18NExtension::get()))
+ V8Proxy::registerExtension(v8::internal::I18NExtension::get());
+#endif
+
// Dynamically tell v8 about our extensions now.
const V8Extensions& extensions = V8Proxy::extensions();
- OwnArrayPtr<const char*> extensionNames(new const char*[extensions.size()]);
+ OwnArrayPtr<const char*> extensionNames = adoptArrayPtr(new const char*[extensions.size()]);
int index = 0;
for (size_t i = 0; i < extensions.size(); ++i) {
// Ensure our date extension is always allowed.