mirror of
https://github.com/ariya/phantomjs.git
synced 2024-10-26 14:29:13 +03:00
Don't rely on JSON.parse() for page.evaluate().
https://github.com/ariya/phantomjs/issues/12615
This commit is contained in:
parent
3b8282cb2e
commit
0bf14a3d0c
@ -371,7 +371,7 @@ function decorateNewPage(opts, page) {
|
||||
case "object": //< for type "object"
|
||||
case "array": //< for type "array"
|
||||
case "date": //< for type "date"
|
||||
str += "JSON.parse(" + JSON.stringify(JSON.stringify(arg)) + "),"
|
||||
str += JSON.stringify(arg) + ","
|
||||
break;
|
||||
case "string": //< for type "string"
|
||||
str += quoteString(arg) + ',';
|
||||
|
@ -10,5 +10,4 @@ var result = page.evaluate(function(obj) {
|
||||
return obj.value * obj.value;
|
||||
}, { value: 4 });
|
||||
|
||||
// FAIL
|
||||
// assert.equal(result, 16);
|
||||
assert.equal(result, 16);
|
||||
|
Loading…
Reference in New Issue
Block a user