Uh oh!
There was an error while loading. Please reload this page.
lib: remove Object from global's prototype - #5888
Conversation
Removes some strange behavior from having Object in the global object's prototype chain. No longer introducing global variables coming from `Object.prototype`.
bmeck
commented
Mar 24, 2016
CC: @trevnorris |
| function setupGlobalVariables() { | ||
| global.process = process; | ||
| global.global = global; |
There was a problem hiding this comment.
Wait, we were assigning this again?? Should I be removing this bit in my PR?
There was a problem hiding this comment.
jasnell
commented
Mar 24, 2016
Seems reasonable. But let's definitely see what citgm says. /cc @thealphanerd |
Fishrock123
commented
Mar 24, 2016
bmeck
commented
Mar 24, 2016
well the lack of a global |
Slayer95
commented
Mar 24, 2016
Relevant: http://www.ecma-international.org/ecma-262/6.0/index.html#sec-global-object
|
bmeck
commented
Mar 24, 2016
@Slayer95 correct, but breaking existing libraries is a bad sign |
Fishrock123
commented
Mar 24, 2016
lodash: Oh my. Yeah I'm not sure this will be something we can do. Looks like Chrome also exposes |
Fishrock123
commented
Mar 24, 2016
Maybe we could expose specific ones like |
bmeck
commented
Mar 24, 2016
@Fishrock123 some people are explicitly checking all known globals by variable name, like in |
bmeck
commented
Mar 28, 2016
Going to close this after lots of CITGM attempts on my own, too many people using it in the wild. |
Pull Request check-list
Please make sure to review and check all of these items:
make -j8 test(UNIX) orvcbuild test nosign(Windows) pass withthis change (including linting)?
Affected core subsystem(s)
lib
Description of change
Removes some strange behavior from having Object in the global object's
prototype chain. No longer introducing global variables coming from
Object.prototype.These globals have strange warts from existing but we should throw this in CITGM this to see if anything is affected. The only thing I really am suspicious of is
toStringmight be used by some people via type coercion likevar_that_refs_global+''.This would be a breaking change.