Side navigation
#5306 closed bug (fixed)
Opened September 30, 2009 07:36AM UTC
Closed November 11, 2009 06:07PM UTC
$.isObject() is incorrect, and in some cases will cause $.extend() malfunctions
Reported by: | Tony Chen | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | core | Version: | |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
code:
x = { a:{ a1:1, a2:2 }, b:2 }; y = { a:{ a3:3 }, c:3 }; console.log("x is ",JSON.stringify(x)); console.log("y is ",JSON.stringify(y)); console.log("$.isObject(x) is ",$.isObject(x)) z = $.extend(true,{}, x, y); console.log("execut: z = $.extend(true,{}, x, y);"); console.log("x is ",JSON.stringify(x)," <--should not be changed!");
output:
x is {"a":{"a1":1,"a2":2},"b":2} y is {"a":{"a3":3},"c":3} $.isObject(x) is false execut: z = $.extend(true,{}, x, y); x is {"a":{"a1":1,"a2":2,"a3":3},"b":2} <-- should not be changed!
Attachments (0)
Change History (2)
Changed September 30, 2009 11:16AM UTC by comment:1
Changed November 11, 2009 06:07PM UTC by comment:2
resolution: | → fixed |
---|---|
status: | new → closed |
This should be fixed in this recent commit:
http://github.com/jquery/jquery/commit/c2bbcd88335cf6f8df4ac9389ecbae90291377fb
From revision 6442 up to 6586