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 — test: refactored context type err message to regex by Shinobi881 · Pull Request #12596 · nodejs/node Conversation
|
| /^TypeError: contextifiedSandbox argument must be an object\.$/; | ||
|
|
||
| [undefined, null, 0, 0.0, ''].forEach(function(e) { | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary whitespace here and in the same place in the second section.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 with a couple comments.
This should probably be generalized more to a single loop with an sandbox input value and expected error. That doesn't need to be done here though... unless you want to.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| /^TypeError: contextifiedSandbox argument must be an object\.$/; | ||
|
|
||
| [undefined, null, 0, 0.0, ''].forEach(function(e) { | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this blank line.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| /^TypeError: sandbox argument must have been converted to a context\.$/; | ||
|
|
||
| [{}, []].forEach(function(e) { | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same comment here about the blank line.
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 that was my original thought, but i figured I'd skip the type checking and be more direct. I still have one more PR for this file and could change it then. What do you recommend?
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.
Instead of two separate loops, you could do the following with nested arrays:
[[undefined, nonContextualSandboxErrorMsg], etc.].forEach()
Then, you pass the first element to runInContext, and use the second element as the expected error.
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 do. Thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #12596 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
|
Landed in ef6a7cf |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for the contribution! 🎉 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #12596 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #12596 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #12596 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #12596 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #12596 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs/node#12596 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.