test: verify performance.timerify() works w/ non-Node Contexts#23784
Closed
addaleax wants to merge 1 commit intonodejs:masterfrom
Closed
test: verify performance.timerify() works w/ non-Node Contexts#23784addaleax wants to merge 1 commit intonodejs:masterfrom
performance.timerify() works w/ non-Node Contexts#23784addaleax wants to merge 1 commit intonodejs:masterfrom
Conversation
refack
approved these changes
Oct 20, 2018
| // Check that performance.timerify() works when called from another context, | ||
| // for a function created in another context. | ||
|
|
||
| const check = runInNewContext(` |
Contributor
There was a problem hiding this comment.
Could you assign the string to a variable, I find this is a bit tricky to read (probably because of GitHub viewer limitations)
Member
Author
There was a problem hiding this comment.
I’m not sure what you mean? If you are talking about the template string, why does assigning to a new variable make a difference here?
Contributor
There was a problem hiding this comment.

It looks awkward, especially the line that starts `, {
IMHO a simple variable makes it clearer:
const code = `
const { performance, assert } = data;
const timerified = performance.timerify(function() { return []; });
assert.strictEqual(timerified().constructor, Array);
'success';
`;
const check = runInNewContext(code, { performance, assert });
assert.strictEqual(check, 'success');
cjihrig
approved these changes
Oct 22, 2018
Member
Author
jasnell
approved these changes
Oct 24, 2018
Member
Author
|
Landed in a3cad3e |
addaleax
added a commit
that referenced
this pull request
Oct 25, 2018
PR-URL: #23784 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Oct 26, 2018
PR-URL: #23784 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
pushed a commit
that referenced
this pull request
Nov 1, 2018
PR-URL: #23784 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This was referenced Nov 2, 2018
Contributor
|
This lands cleanly on 10.x but will require a backport to 8.x. Should this land in that release line? |
MylesBorins
pushed a commit
that referenced
this pull request
Nov 26, 2018
PR-URL: #23784 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Closed
rvagg
pushed a commit
that referenced
this pull request
Nov 28, 2018
PR-URL: #23784 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Nov 29, 2018
PR-URL: #23784 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes