@@ -4586,11 +4586,28 @@ void FreeEnvironment(Environment* env) {
4586
4586
}
4587
4587
4588
4588
4589
+ Local<Context> NewContext (Isolate* isolate,
4590
+ Local<ObjectTemplate> object_template) {
4591
+ auto context = Context::New (isolate, nullptr , object_template);
4592
+ if (context.IsEmpty ()) return context;
4593
+ HandleScope handle_scope (isolate);
4594
+ auto intl_key = FIXED_ONE_BYTE_STRING (isolate, " Intl" );
4595
+ auto break_iter_key = FIXED_ONE_BYTE_STRING (isolate, " v8BreakIterator" );
4596
+ Local<Value> intl_v;
4597
+ Local<Object> intl;
4598
+ if (context->Global ()->Get (context, intl_key).ToLocal (&intl_v) &&
4599
+ intl_v->ToObject (context).ToLocal (&intl)) {
4600
+ intl->Delete (context, break_iter_key).FromJust ();
4601
+ }
4602
+ return context;
4603
+ }
4604
+
4605
+
4589
4606
inline int Start (Isolate* isolate, IsolateData* isolate_data,
4590
4607
int argc, const char * const * argv,
4591
4608
int exec_argc, const char * const * exec_argv) {
4592
4609
HandleScope handle_scope (isolate);
4593
- Local<Context> context = Context::New (isolate);
4610
+ Local<Context> context = NewContext (isolate);
4594
4611
Context::Scope context_scope (context);
4595
4612
Environment env (isolate_data, context);
4596
4613
CHECK_EQ (0 , uv_key_create (&thread_local_env));
0 commit comments