Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#17691 closed defect (fixed)

Cloning JsonRest crashes in IE8

Reported by: savola28 Owned by:
Priority: undecided Milestone: 1.11
Component: General Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description

When cloning JsonRest? object with lang.clone, constructor of the JsonRest? is called with undefined options.

Inside the constructor declare.safeMixin(this, options); is called.

This will crash in IE8 because inside safeMixin has("bug-for-in-skips-shadowed")-if-clause is ran and inside that clause target-parameter is referred without checking if it is undefined. In this case it is undefined because options was undefined.

Is the root of the problem in JsonRest? or in safeMixin?

This problem is mentioned also here: http://dojo-toolkit.33424.n3.nabble.com/Problems-with-SafeMixin-in-IE8-td3987393.html

There is also this ticket: https://bugs.dojotoolkit.org/ticket/15478

Change History (3)

comment:1 Changed 6 years ago by xMartin

I ran into the same problem by just doing new dojo.store.JsonRest(). Pretty nasty to debug. Only happens in real IE8, not emulated. I think the thread in the mailing list makes a good point. declare.safeMixin should do the check if source is undefined or an object.

Using Dojo 1.9.2

The title should be changed. It's not about cloning.

comment:2 Changed 5 years ago by Kris Zyp

Milestone: tbd1.11
Resolution: fixed
Status: newclosed

Apparently the commit to fix this was truncated right before the number: https://github.com/dojo/dojo/commit/b23d243b5284f168ef08756044c6c26bab7c0ab9

I am open to backporting this, since this is really about declare's inconsistent handling of safeMixin behavior across browsers.

comment:3 Changed 5 years ago by flet

Is it possible to get this fix in a patch release? We just got burned by attempting to update our Dojo version and forgetting to manually apply this patch.

Note: See TracTickets for help on using tickets.