Skip to content

Let theClonusHorror handle regexps #4

@aglundahl

Description

@aglundahl

theClonusHorror can't, for various reasons, clone many of the host objects in JS. It's not really a big problem, since you wouldn't expect most of them be values anyway. But when it comes to regexps, at least I expect them to behave as values. That is, it would be nice if this worked:

var hole = new L.Hole(/foo/);
L.snapshot(hole); //=> /foo/

Currently, L.snapshot(hole) would return /(?:)/, an "empty" regex, because you can't access the keys on a host object.

I guess the implementation could check if the object is an instance of RegExp and either clone it or just return it as with for example functions (which aren't values either, but who modifies a function anyway?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions