Skip to content

Commit 44b9f6b

Browse files
committed
chakrashim: console should not be enumerable
The console property should not be enumerable according to the W3C spec. PR-URL: nodejs#518 Reviewed-By: Seth Brenith <[email protected]> Reviewed-By: Jimmy Thomson <[email protected]>
1 parent ed02928 commit 44b9f6b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

deps/chakrashim/src/inspector/inspected-context.cc

+6-4
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ InspectedContext::InspectedContext(V8InspectorImpl* inspector,
4646
v8::Local<v8::Object> global = info.context->Global();
4747
v8::Local<v8::Object> console =
4848
V8Console::createConsole(this, info.hasMemoryOnConsole);
49-
if (!global
50-
->Set(info.context, toV8StringInternalized(isolate, "console"),
51-
console)
52-
.FromMaybe(false))
49+
if (!global->DefineOwnProperty(info.context,
50+
toV8StringInternalized(isolate, "console"),
51+
console, v8::PropertyAttribute::DontEnum)
52+
.FromMaybe(false)) {
5353
return;
54+
}
55+
5456
m_console.Reset(isolate, console);
5557
m_console.SetWeak(this, &InspectedContext::consoleWeakCallback,
5658
v8::WeakCallbackType::kParameter);

0 commit comments

Comments
 (0)