Title: [201022] trunk
Revision
201022
Author
[email protected]
Date
2016-05-17 11:20:26 -0700 (Tue, 17 May 2016)

Log Message

console namespace breaks putting properties on console.__proto__
https://bugs.webkit.org/show_bug.cgi?id=157782
<rdar://problem/26250526>

Reviewed by Geoffrey Garen.

Source/_javascript_Core:

Some websites currently depend on console.__proto__ existing and being
a separate object from Object.prototype. This patch adds back a basic
console.__proto__ object, but all the console functions are left on
the ConsoleObject itself.

* runtime/JSGlobalObject.cpp:
(JSC::createConsoleProperty):

LayoutTests:

* js/console-expected.txt:
* js/console.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (201021 => 201022)


--- trunk/LayoutTests/ChangeLog	2016-05-17 17:58:57 UTC (rev 201021)
+++ trunk/LayoutTests/ChangeLog	2016-05-17 18:20:26 UTC (rev 201022)
@@ -1,3 +1,14 @@
+2016-05-17  Joseph Pecoraro  <[email protected]>
+
+        console namespace breaks putting properties on console.__proto__
+        https://bugs.webkit.org/show_bug.cgi?id=157782
+        <rdar://problem/26250526>
+
+        Reviewed by Geoffrey Garen.
+
+        * js/console-expected.txt:
+        * js/console.html:
+
 2016-05-17  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r201017.

Modified: trunk/LayoutTests/js/console-expected.txt (201021 => 201022)


--- trunk/LayoutTests/js/console-expected.txt	2016-05-17 17:58:57 UTC (rev 201021)
+++ trunk/LayoutTests/js/console-expected.txt	2016-05-17 18:20:26 UTC (rev 201022)
@@ -1,17 +1,17 @@
-CONSOLE MESSAGE: line 19: log message
-CONSOLE MESSAGE: line 20: log message
 CONSOLE MESSAGE: line 21: log message
 CONSOLE MESSAGE: line 22: log message
 CONSOLE MESSAGE: line 23: log message
 CONSOLE MESSAGE: line 24: log message
+CONSOLE MESSAGE: line 25: log message
 CONSOLE MESSAGE: line 26: log message
+CONSOLE MESSAGE: line 28: log message
 CONSOLE MESSAGE: line 1: 1
 CONSOLE MESSAGE: line 1: 2
 CONSOLE MESSAGE: line 1: 3
 PASS typeof console is "object"
 PASS console.toString() is "[object Console]"
-PASS Object.getPrototypeOf(console) is Object.getPrototypeOf({})
 PASS console is console
+PASS Object.getPrototypeOf(console) is not Object.getPrototypeOf({})
 PASS consoleDescriptor.configurable is true
 PASS consoleDescriptor.writable is true
 PASS consoleDescriptor.enumerable is false

Modified: trunk/LayoutTests/js/console.html (201021 => 201022)


--- trunk/LayoutTests/js/console.html	2016-05-17 17:58:57 UTC (rev 201021)
+++ trunk/LayoutTests/js/console.html	2016-05-17 18:20:26 UTC (rev 201022)
@@ -7,9 +7,11 @@
 <script>
 shouldBeEqualToString("typeof console", "object");
 shouldBeEqualToString("console.toString()", "[object Console]");
-shouldBe("Object.getPrototypeOf(console)", "Object.getPrototypeOf({})");
 shouldBe("console", "console");
 
+// <https://webkit.org/b/157782> console namespace breaks putting properties on console.__proto__
+shouldNotBe("Object.getPrototypeOf(console)", "Object.getPrototypeOf({})");
+
 var consoleDescriptor = Object.getOwnPropertyDescriptor(window, "console");
 shouldBeTrue('consoleDescriptor.configurable');
 shouldBeTrue('consoleDescriptor.writable');

Modified: trunk/Source/_javascript_Core/ChangeLog (201021 => 201022)


--- trunk/Source/_javascript_Core/ChangeLog	2016-05-17 17:58:57 UTC (rev 201021)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-05-17 18:20:26 UTC (rev 201022)
@@ -1,3 +1,19 @@
+2016-05-17  Joseph Pecoraro  <[email protected]>
+
+        console namespace breaks putting properties on console.__proto__
+        https://bugs.webkit.org/show_bug.cgi?id=157782
+        <rdar://problem/26250526>
+
+        Reviewed by Geoffrey Garen.
+
+        Some websites currently depend on console.__proto__ existing and being
+        a separate object from Object.prototype. This patch adds back a basic
+        console.__proto__ object, but all the console functions are left on
+        the ConsoleObject itself.
+
+        * runtime/JSGlobalObject.cpp:
+        (JSC::createConsoleProperty):
+
 2016-05-17  Yusuke Suzuki  <[email protected]>
 
         Unreviewed, dump more information when math-pow-stable-results.js failed

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (201021 => 201022)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2016-05-17 17:58:57 UTC (rev 201021)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2016-05-17 18:20:26 UTC (rev 201022)
@@ -197,7 +197,7 @@
 static JSValue createConsoleProperty(VM& vm, JSObject* object)
 {
     JSGlobalObject* global = jsCast<JSGlobalObject*>(object);
-    return ConsoleObject::create(vm, global, ConsoleObject::createStructure(vm, global, global->objectPrototype()));
+    return ConsoleObject::create(vm, global, ConsoleObject::createStructure(vm, global, constructEmptyObject(global->globalExec())));
 }
 
 } // namespace JSC
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to