Boa: There are no quotes around a String value

Created on 19 Oct 2019  路  4Comments  路  Source: boa-dev/boa

Provided you have something like:

const o = { str: 'String' };

o;

the output would be:

"{ str: String }"

The issue is due to the implementation of Display for ValueData::String, which simply displays the value of the String.

Note that currently in master objects are displayed simpy as {} but you can see the issue in the branch for #171.

bug good first issue execution

Most helpful comment

I'll open a PR soon.

All 4 comments

It would just be replacing the string used in https://github.com/jasonwilliams/boa/blob/f02babf0bd254b37920206b0ce0089bb9b01ba50/boa/src/builtins/value/mod.rs#L841
from write!(f, "{}", v) to write!(f, "\"{}\"", v), right?

@RageKnify i think so yup

I'll open a PR soon.

Was this page helpful?
0 / 5 - 0 ratings