Opened 9 years ago

Closed 9 years ago

#12339 closed defect (fixed)

Dojo base fails to initialize if Object prototype has been augmented

Reported by: Kenneth G. Franqueiro Owned by: Eugene Lazutkin
Priority: high Milestone: 1.6
Component: Core Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description

There is an unprotected for...in loop in _base/html.js which causes dojo to fail to load in environments where some script has naughtily added enumerable members to Object.prototype.

I heard from dante that "Object.prototype is verboten", so I'm not sure what you all will think of adding the if-hasOwnProperty check necessary to resolve it, but this seems to be the one thing that snags dojo base from loading successfully in this case, and we do seem to check hasOwnProperty in other places in base.

Attachments (2)

12339.diff (951 bytes) - added by Kenneth G. Franqueiro 9 years ago.
fix by adding hasOwnProperty check.
testObjBork.html (366 bytes) - added by Kenneth G. Franqueiro 9 years ago.
test page

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by Kenneth G. Franqueiro

Attachment: 12339.diff added

fix by adding hasOwnProperty check.

comment:1 Changed 9 years ago by Eugene Lazutkin

Milestone: tbdfuture
Owner: changed from anonymous to Eugene Lazutkin
Status: newassigned

Changed 9 years ago by Kenneth G. Franqueiro

Attachment: testObjBork.html added

test page

comment:2 Changed 9 years ago by Eugene Lazutkin

Milestone: future1.6

comment:3 Changed 9 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [23873]) Guard against augmented Object's prototype, thx kgf!, !strict, fixes #12339.

Note: See TracTickets for help on using tickets.