Closed
Bug 1615260
Opened 4 years ago
Closed 4 years ago
Response for Runtime.callFunctionOn with returnbyValue shouldn't return value when it's not serializable
Categories
(Remote Protocol :: CDP, defect, P1)
Remote Protocol
CDP
Tracking
(firefox75 fixed)
RESOLVED
FIXED
Firefox 75
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
(Blocks 1 open bug)
Details
(Whiteboard: [puppeteer-beta-mvp])
Attachments
(1 file)
See the difference between Chrome and Firefox when evaluating a non-serializable value:
Chrome:
puppeteer:protocol SEND ► {"sessionId":"FDC196D1DD11938503876AB4D0C44BA5","method":"Runtime.callFunctionOn","params":{"functionDeclaration":"a => a\n//# sourceURL=__puppeteer_evaluation_script__\n","executionContextId":1,"arguments":[{"unserializableValue":"NaN"}],"returnByValue":true,"awaitPromise":true,"userGesture":true},"id":18} +1ms
puppeteer:protocol ◀ RECV {"id":18,"result":{"result":{"type":"number","unserializableValue":"NaN","description":"NaN"}},"sessionId":"FDC196D1DD11938503876AB4D0C44BA5"} +1ms
Firefox:
puppeteer:protocol SEND ► {"sessionId":1,"method":"Runtime.callFunctionOn","params":{"functionDeclaration":"a => a\n//# sourceURL=__puppeteer_evaluation_script__\n","executionContextId":1,"arguments":[{"unserializableValue":"NaN"}],"returnByValue":true,"awaitPromise":true,"userGesture":true},"id":18} +2ms
puppeteer:protocol ◀ RECV {"sessionId":1,"id":18,"result":{"result":{"value":null}}} +6ms
The problem here is that we always return a value property, and in cases like NaN
a call to JSON.stringify()will return
null` instead. As such we have to special-case certain values, and return immediately if the obj is of that type.
Assignee | ||
Comment 1•4 years ago
|
||
Values like NaN, Infinity, -Infinity are not serializable and have
to be returned via the unserializable property and not as value.
This patch also adds the type and description properties as
Puppeteer tests require, but leaves out support for -0 (bug 1615364)
and BigInt (bug 1615360).
Assignee | ||
Updated•4 years ago
|
Whiteboard: [puppeteer-beta-mvp]
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/afc658d2dd3a [remote] Return correct properties for unserializable values in Runtime.callFunctionOn. r=remote-protocol-reviewers,maja_zf
Comment 4•4 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
status-firefox75:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 75
Updated•3 years ago
|
Component: CDP: Runtime → CDP
You need to log in
before you can comment on or make changes to this bug.
Description
•