In JSON3 , they have used to stringify the non passing parameter as JSON. Stringify () so in json object omits this due to non argument count. Herewith need to add the dummy stringify for the JSON3 object. If added that JSON works as expected.
<rdar://problem/45077333>
Can we have the code reproducing the issue?
Hi, Just save a cookies in the name of "{"times:{"time" :"0"}" with JSON3 library which already having in GITHUB and stringify the mentioned JSON string . webkit enters with 0 argument count using the JSON3. Note: If we dont use the JSON3 code in our testcode we can't reproduce the issue.
For this I have fixed as below mentioned // ECMA-262 v5 15.12.3 EncodedJSValue JSC_HOST_CALL JSONProtoFuncStringify(ExecState* exec) { if (!exec->argumentCount()) return throwVMError(exec, createError(exec, ASCIILiteral("No input to stringify"))); LocalScope scope(exec->globalData()); Local<Unknown> value(exec->globalData(), exec->argument(0)); Local<Unknown> replacer(exec->globalData(), exec->argument(1)); Local<Unknown> space(exec->globalData(), exec->argument(2)); return JSValue::encode(Stringifier(exec, replacer, space).stringify(value).get()); } Modified: ======== // ECMA-262 v5 15.12.3 EncodedJSValue JSC_HOST_CALL JSONProtoFuncStringify(ExecState* exec) { if (!exec->argumentCount()){ LocalScope scope(exec->globalData()); Local<Unknown> value(exec->globalData(), jsnull()); Local<Unknown> replacer(exec->globalData(), jsnull()); Local<Unknown> space(exec->globalData(), jsnull()); return JSValue::encode(Stringifier(exec, replacer, space).stringify(value).get() } LocalScope scope(exec->globalData()); Local<Unknown> value(exec->globalData(), exec->argument(0)); Local<Unknown> replacer(exec->globalData(), exec->argument(1)); Local<Unknown> space(exec->globalData(), exec->argument(2)); return JSValue::encode(Stringifier(exec, replacer, space).stringify(value).get()); }
Created attachment 352254 [details] Patch
Comment on attachment 352254 [details] Patch r=me
HI, Yes this is correct and added as expected
Committed r237095: <https://trac.webkit.org/changeset/237095>