GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — v8: add a js class for Serializer/Dserializer by zimbabao · Pull Request #13541 · nodejs/node Conversation
|
|
Can you add some regression tests? There were some gotchas around I expect it throws an 'illegal invocation' exception but it would be good to verify that. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It does, we already extend it :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I mean when you extend the class that this PR introduces. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@bnoordhuis, the classes this PR introduces are already extended further down the file by |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Okay. Regression tests for the other issues would still be good though. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Calling Serializer/Deserlizer without new crashes node. Adding a js class which just inherits cpp bindings. Fixes: nodejs#13326
|
@bnoordhuis : Added regression tests. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| { | ||
| try { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you use assert.throws() for these.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@cjihrig : Made suggested changes.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Calling Serializer/Deserlizer without new crashes node. Adding a js class which just inherits cpp bindings. Added refression tests. Fixes: nodejs#13326
| v8.Serializer(); | ||
| }, | ||
| Error, | ||
| "Class constructor Serializer cannot be invoked without 'new'" |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you do something more like this:
assert.throws( () => { v8.Serializer(); }, /^Error: Class constructor Serializer cannot be invoked without 'new'$/ );
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@cjihrig : Done
Sorry, something went wrong.
There was an error while loading. Please reload this page.
88817fa to
b72ec9c
Compare
|
There are typos in the commit message(s): s/Dserializer/Deserializer/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
b72ec9c to
cfb934e
Compare
|
@mscdex : Thanks, fixed |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Can somebody fire a CI job for this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
s/refression/regression/ in commit message(s) too. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Calling Serializer/Deserializer without new crashes node. Adding a js class which just inherits cpp bindings. Added regression tests. Fixes: nodejs#13326
cfb934e to
9643c6c
Compare
|
@mscdex : Fixed on top review. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CI again: https://ci.nodejs.org/job/node-test-pull-request/8574/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| class Serializer extends serdesBindings.Serializer {} | ||
|
|
||
| class Deserializer extends serdesBindings.Deserializer {} |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer something like:
const { Serializer: _Serializer, Deserializer: _Deserializer } = process.binding('serdes'); // ... class Serializer extends _Serializer { } class Deserializer extends _Deserializer { }
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Will resend.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@jasnell : Made changes and added a note.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| () => { v8.Deserializer(); }, | ||
| /^TypeError: Class constructor Deserializer cannot be invoked without 'new'$/ | ||
| ); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should likely also add a note to the documentation clarifying the requirement
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Calling Serializer/Deserializer without new crashes node. Adding a js class which just inherits cpp bindings. Added regression tests. Fixes: nodejs#13326
47cccbe to
955a1bb
Compare
| const { Buffer } = require('buffer'); | ||
| const { Serializer, Deserializer } = process.binding('serdes'); | ||
| const { | ||
| Serializer: _Serializer, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you indent two spaces only?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done. BTW jslint didn't catch that error. May be we should add a rule?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Calling Serializer/Deserializer without new crashes node. Adding a js class which just inherits cpp bindings. Added regression tests. Fixes: nodejs#13326
|
Another CI run: https://ci.nodejs.org/job/node-test-pull-request/8588/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Tests pass on my mac osx sierra laptop. Above failures looks related to CI, can somebody start another run?. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yea, CI is a bit problematic right now, I’m not sure another run would solve much. This code isn’t platform-specific, though, so I think this is okay. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@addaleax : Thanks, anything else for landing this?. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@zimbabao Our rules say that we’ll need to wait until tomorrow to land this, but nothing from your side I think. :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM % docs
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
arm: #13603 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in 12fd63d, thanks for the PR! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Calling Serializer/Deserializer without new crashes node. Adding a js class which just inherits cpp bindings. Added regression tests. Fixes: #13326 PR-URL: #13541 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Calling Serializer/Deserializer without new crashes node. Adding a js class which just inherits cpp bindings. Added regression tests. Fixes: #13326 PR-URL: #13541 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Fixes: #13326 Refs: #13541 PR-URL: #36549 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Fixes: #13326 Refs: #13541 PR-URL: #36549 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Fixes: #13326 Refs: #13541 PR-URL: #36549 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[8.0.0] v8.Serializer crashes on bad input
There was an error while loading. Please reload this page.