Bug Tracker

Ticket #4192 (closed bug: wontfix)

Opened 5 years ago

Last modified 2 years ago

Extend and RegExp

Reported by: braillane Owned by: flesler
Priority: major Milestone: 1.3.2
Component: core Version: 1.3.1
Keywords: Cc: braillane
Blocking: Blocked by:

Description

I try to clone an object but there's a bug. In my Original object i have a RegExp. When i clone this object, my RegExp is transformed into a ampty object... My RegExp become unusable... this is a code showing the problem :

defaultopt = { text:"blabla",regexp : new RegExp("[c]")}; opt = {regexp : new RegExp("[d]")}; var target; jQuery.extend(true,target,defaultopt,opt);

Change History

comment:1 Changed 5 years ago by flesler

  • Cc braillane added
  • Owner set to flesler
  • Status changed from new to assigned
  • Component changed from unfilled to core
  • Milestone changed from 1.3.1 to 1.3.2

I think I know how to fix this easily, will do asap.

comment:2 Changed 5 years ago by dmethvin

Related:

 http://groups.google.com/group/jquery-en/browse_frm/thread/a218a4cf1ba88ffb/761bb66327a7371c?#761bb66327a7371c

 http://groups.google.com/group/jquery-dev/browse_frm/thread/2721611c278e5e4f?#599c29574f485d5c

It seems like you'd need to special-case all the builtin objects because they don't have standardized constructors or clone methods.

comment:3 Changed 5 years ago by dmethvin

See also #4770.

comment:4 Changed 3 years ago by dmethvin

  • Keywords needsdocs added
  • Status changed from assigned to closed
  • Resolution set to wontfix

Due to performance/complexity issues I think we just need to document this.

comment:5 Changed 3 years ago by dmethvin

  • Keywords needsdocs removed
Note: See TracTickets for help on using tickets.