lib: support returning Safe collections from C++#36989
Closed
ExE-Boss wants to merge 2 commits into
Closed
Conversation
ExE-Boss
force-pushed
the
lib/primordials/support-returning-safe-collections-from-cpp
branch
3 times, most recently
from
January 19, 2021 04:47
ccec24a to
e5c872f
Compare
aduh95
reviewed
Jan 19, 2021
aduh95
left a comment
Contributor
There was a problem hiding this comment.
I think it'd interesting to add a check that we're no longer using user-mutable methods:
const assert = require('assert');
const { options } = require('internal/options');
assert.notStrictEqual(options.get, Map.prototype.get);const assert = require('assert');
const { getOptionValue } = require('internal/options');
Map.prototype.get = function get() { return 'polluted result'; };
assert.strictEqual(getOptionValue('--expose-internals'), true);
ExE-Boss
force-pushed
the
lib/primordials/support-returning-safe-collections-from-cpp
branch
from
January 19, 2021 10:30
e5c872f to
ad9b5a5
Compare
Contributor
Author
That will fail unless |
aduh95
approved these changes
Jan 20, 2021
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
ExE-Boss
force-pushed
the
lib/primordials/support-returning-safe-collections-from-cpp
branch
from
January 20, 2021 12:02
fd622d9 to
b427d33
Compare
aduh95
reviewed
Jan 20, 2021
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95
approved these changes
Jan 20, 2021
Collaborator
Collaborator
jasnell
approved these changes
Jan 23, 2021
Member
|
Landed in 3ec7114 |
ExE-Boss
deleted the
lib/primordials/support-returning-safe-collections-from-cpp
branch
January 23, 2021 04:50
2 tasks
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.
Refs: #36652
This works similarly to what’s done to support constructing
Bufferinstances from C++, but unlikeBuffer.prototype, theSafe*collection prototypes can be captured as soon asInitializePrimordialshas finished runninglib/internal/per_context/primordials.js.