RESOLVED FIXED157782
console namespace breaks putting properties on console.__proto__
https://bugs.webkit.org/show_bug.cgi?id=157782
Summary console namespace breaks putting properties on console.__proto__
Joseph Pecoraro
Reported 2016-05-16 20:10:38 PDT
* SUMMARY console namespace breaks putting properties on console.__proto__ Regression with r200350. Console moved to a vanilla namespace object. So console.__proto__ used to be be ConsolePrototype (with log, warn, ... functions) but is now Object.prototype as those functions are on the console object itself. * STEPS TO REPRODUCE 1. Open http://www.macupdate.com/app/mac/25347/phoneview 2. Attempt to click the "More..." link => Does not work. Issues in console on page load. * NOTES - Page adds property to console.__proto__ which is now Object.prototype. http://www.macupdate.com/js/_sources/compressed/mu.utils.min.js (pretty printed) 111: }, console.__proto__.debug = function(format) { 112: if (window.DEBUG) { 113: var varargs = Array.prototype.slice.call(arguments); 114: console.__proto__.info.apply(this, varargs) 115: } 116: } - Causes issues later on iterating a vanilla object, which was unexpected. for (var p in {}) console.log(p); // "debug"
Attachments
[PATCH] Proposed Fix - DeprecatedConsolePrototype emits warnings (25.20 KB, patch)
2016-05-16 20:29 PDT, Joseph Pecoraro
no flags
[PATCH] Proposed Fix - Simple Approach (2.06 KB, patch)
2016-05-16 20:34 PDT, Joseph Pecoraro
no flags
[PATCH] Proposed Fix - DeprecatedConsolePrototype emits warnings (25.71 KB, patch)
2016-05-16 20:38 PDT, Joseph Pecoraro
no flags
[PATCH] Proposed Fix - Simple Approach (4.50 KB, patch)
2016-05-16 20:44 PDT, Joseph Pecoraro
ggaren: review+
buildbot: commit-queue-
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (1.29 MB, application/zip)
2016-05-16 21:11 PDT, Build Bot
no flags
Joseph Pecoraro
Comment 1 2016-05-16 20:11:00 PDT
Joseph Pecoraro
Comment 2 2016-05-16 20:29:38 PDT
Created attachment 279088 [details] [PATCH] Proposed Fix - DeprecatedConsolePrototype emits warnings
WebKit Commit Bot
Comment 3 2016-05-16 20:31:56 PDT
Attachment 279088 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h:45: The parameter name "message" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 1 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
Joseph Pecoraro
Comment 4 2016-05-16 20:34:24 PDT
Created attachment 279089 [details] [PATCH] Proposed Fix - Simple Approach
Joseph Pecoraro
Comment 5 2016-05-16 20:35:51 PDT
Here are two approaches (I forgot CMakeLists.txt in the first patch). 1. DeprecatedConsolePrototype - Make console.__proto__ a new vanilla object. - emits a console warning when pages put properties on console.__proto__ to move developers away from using it. 2. Simple Approach - Make console.__proto__ a new vanilla object.
Joseph Pecoraro
Comment 6 2016-05-16 20:38:53 PDT
Created attachment 279091 [details] [PATCH] Proposed Fix - DeprecatedConsolePrototype emits warnings
WebKit Commit Bot
Comment 7 2016-05-16 20:41:17 PDT
Attachment 279091 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h:45: The parameter name "message" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 1 in 18 files If any of these errors are false positives, please file a bug against check-webkit-style.
Joseph Pecoraro
Comment 8 2016-05-16 20:44:57 PDT
Created attachment 279093 [details] [PATCH] Proposed Fix - Simple Approach
Build Bot
Comment 9 2016-05-16 21:11:31 PDT
Comment on attachment 279093 [details] [PATCH] Proposed Fix - Simple Approach Attachment 279093 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/1334378 Number of test failures exceeded the failure limit.
Build Bot
Comment 10 2016-05-16 21:11:34 PDT
Created attachment 279098 [details] Archive of layout-test-results from ews107 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Geoffrey Garen
Comment 11 2016-05-17 10:48:42 PDT
Comment on attachment 279093 [details] [PATCH] Proposed Fix - Simple Approach View in context: https://bugs.webkit.org/attachment.cgi?id=279093&action=review > Source/JavaScriptCore/runtime/JSGlobalObject.cpp:201 > + // FIXME: <https://webkit.org/b/157782> console namespace breaks putting properties on console.__proto__ > + // Give console namespace a basic prototype object to avoid backwards compatibility issues from when > + // there used to be a console.__proto__ before it became a namespace object. I don't think we want a FIXME here. A FIXME should indicate a definite change we expect to make in the future. But we don't have any plan to change here. I would remove this comment.
Geoffrey Garen
Comment 12 2016-05-17 10:49:16 PDT
Comment on attachment 279093 [details] [PATCH] Proposed Fix - Simple Approach r=me EWS failure seems spurious.
Joseph Pecoraro
Comment 13 2016-05-17 11:20:02 PDT
Landed Simple Approach: <http://trac.webkit.org/changeset/201022>
Note You need to log in before you can comment on or make changes to this bug.