Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Constructed/Instantiated primitives should be stringified like their primitive equivalants. #60

@Krinkle

Description

@Krinkle

From timotijhof on June 13, 2012 18:15:33

Stringify something like new Number(7); or new Number('hello');

It should output '7' and '"hello"'. Instead it becomes:

new Number(7); became:
{}

new String('hello'); became:
{"0":"h","1":"e","2":"l","3":"l","4":"o"}

Now, I don't have a strong opinion on that. Actually, I think treating them as objects is perfectly fine because they are objects (note that one should probably never really construct a primitive in serious code, but whatever). The main reason I'm filing this as a bug is because the implementation of the browser vendors is different, and we should aim to mach that.

Original issue: http://code.google.com/p/jquery-json/issues/detail?id=60

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions