FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

util: introduce `util.types.is[…]` type checks by addaleax · Pull Request #18415 · nodejs/node · GitHub

util: introduce `util.types.is[…]` type checks by addaleax · Pull Request #18415 · nodejs/node · GitHub
Skip to content

Navigation Menu

Sign in

util: introduce util.types.is[…] type checks - #18415

Closed
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:types-types-types
Closed

util: introduce util.types.is[…] type checks#18415
addaleax wants to merge 2 commits into
nodejs:masterfrom
addaleax:types-types-types

Conversation

Copy link
Copy Markdown
Member

Provide public APIs for native typechecking that is actually useful. The motivation for this is providing alternatives to userland modules that would currently rely on process.binding('util').

This is based off the list in v8.h, with things that have better JS equivalents removed; I’m happy to bikeshed this list.

Also, for context, previous efforts:

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

util

addaleax added util Issues and PRs related to the built-in util module. semver-minor PRs that contain new features and should be released in the next minor version. labels Jan 27, 2018
nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Jan 27, 2018

evanlucas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM with a few nits. Are we sure we want to put this on util as opposed to a new module?

I would lean more towards a types module, but am fine either way. Thanks for doing this!!

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

should this be isGeneratorFunction

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

isMap()

ChALkeR commented Jan 28, 2018

Copy link
Copy Markdown
Member

@evanlucas Introducing a new module is a semver-major, as it would break npmjs.com/types module.

Comment thread lib/internal/bootstrap_node.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If a new deprecation is introduced, it should be recorded in doc/api/deprecations.md.

Comment thread src/node_types.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We no longer need this with isTypedArray being present in lib/internal/types.js.

Comment thread src/node_types.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Four-space indentation. Ditto elsewhere.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@TimothyGu All other macro lists I can find use 2 spaces for indentation?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Heh. Never mind then, I guess.

Copy link
Copy Markdown
Member Author

@evanlucas Like @ChALkeR said, I couldn’t find a suitable name, that’s all. I don’t think util is a terrible home for this, though.

@evanlucas @ChALkeR @TimothyGu Addressed your nits :)

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe Array.isArray() as per our style guide note about parentheses after methods (+ below and in the bottom reference).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@vsemozhetbyt Yup, done!

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

util.types.isDate() seems undocumented.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@vsemozhetbyt Oops, thanks for catching this!

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

&& value !== null?

vsemozhetbyt Jan 28, 2018
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

+ Is not typeof value can be either'object' or 'function'?

> const v = ()=>{}
undefined
> typeof v === 'object'
false
> typeof v
'function'

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

|| value === null ?

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Would be good to have TypeError (and/or some other built-in Errors) here too.

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Something that may be surprising to JavaScript developers unfamiliar with iterators is that the iterators returned from .keys(), .values(), .entries(), and [@@iterator]() in fact look the same from the outside. Maybe have them here as well would aid comprehension? (Ditto for Set.)

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Alphabetically (what other API docs do), Uint16 would sort earlier than Uint8. This is certainly as good of a place for exception as any, but I'd like to keep it consistent for now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The same for util.types.isInt8Array(value).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I do think this sorting order is a little less weird, tbh … 😄

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Would new WebAssembly.Module(wasmBuffer) be a better example because of its synchronicity?

If this asynchronous example is to be kept, then it seems MDN spec it should be const module = rather than const { module } =.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If this asynchronous example is to be kept, then it seems MDN spec it should be const module = rather than const { module } =.

I don’t know why, but I don’t think V8 and MDN agree here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Seems like you used compile here but instantiate in the test. Instantiate does indeed return { module, instance }.

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This function is implemented as value !== null && typeof value === 'object'.

Maybe also mention that even though functions are also objects, isObject historically returned false even for functions, because it's broken.

The doc as-is doesn't make much sense.

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

s/string/symbol/

Also, no need for e.g. as Object() is the only way to get symbol objects in JavaScript (new Symbol() always throws an error).

Comment thread test/parallel/test-util-types.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ditto as the documentation change. You could use WebAssembly.Module's constructor to avoid the async-ness. If not, we don't really need to instantiate it. WebAssembly.compile should be sufficient.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, I simply didn’t know you could just, you know, use new to construct a Module. ;)

Comment thread test/parallel/test-util-types.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Do we have an existing check for Generator objects? In any case, I am interested in seeing a reliable JS equivalent for isGeneratorObject.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@TimothyGu I’d guess you’d usually just check for presence of the methods? It’s not “reliable” in the sense that the V8 method is, but I didn’t see much benefit in including this, plus (and I could be completely wrong about that) I’d guess that this doesn’t work on transpiled generator functions anyway?

I’m happy to include it if you think it makes sense.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I’d guess you’d usually just check for presence of the methods?

Doesn't this kind of defeats the whole point of having these functions available?

I’d guess that this doesn’t work on transpiled generator functions anyway?

True, but this wouldn't be the first function that doesn't either.

Comment thread test/parallel/test-util-types.js Outdated

TimothyGu Jan 28, 2018
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I really like this test!

Comment thread test/parallel/test-util-types.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

process.on('exit') wouldn't be necessary if the WebAssembly.Module is created synchronously.

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Out of ABC-order?

Comment thread doc/api/deprecations.md Outdated

ChALkeR Jan 28, 2018
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is --pending-deprecation the correct type here? It's the first such one, afaik.
DEP0005 is also a --pending-deprecation, but does not mention that explicitly.
/cc @jasnell, I suppose.

Also, --pending-deprecation (and it being a semver-minor) is not mentioned in COLLABORATOR_GUIDE.md#deprecations, but that's probably a separate issue.

As I understand, currently --pending-deprecation is just a subclass of doc-only deprecations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I opened #18417 for that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

As I understand, currently --pending-deprecation is just a subclass of doc-only deprecations.

I’m okay with seeing it that way, yeah. And I don’t mind being explicit about this here.

ChALkeR Jan 30, 2018
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

#18433 landed, so could you change this line to

Type: Documentation-only (supports [`--pending-deprecation`][])

for consistency?

joyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM with the wasm example/test changed to sync version

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should be util.types.isDate(new Date())

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

a async ->an async?

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

ArrayBuffer.isView -> ArrayBuffer.isView() (+ everywhere including bottom reference)?

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe const proxy = new Proxy(target, {}); to make target more target?)

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The same for util.types.isInt8Array(value).

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should be after WeakMap.

Copy link
Copy Markdown
Contributor

Maybe it is due to big diff, but some old review comments are not hidden now and are associated with the wrong lines, so do not be confused:

#18415 (comment) (or https://github.com/nodejs/node/pull/18415/files#r164285093)

#18415 (comment) (or https://github.com/nodejs/node/pull/18415/files#r164287166)

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just noting that this will have a named-import-in-ESM issue just like the fs.promises addition.

Comment thread lib/internal/util/types.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We should likely note in the documentation how these checks are performed because types can lie about what they are if the user overrides Symbol.toStringTag.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This function is cached at Node.js startup and thus immune to userland overrides.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ah right right... completely zoned on the caching. Just verified locally that even preload script can't lie about this. Dismiss this comment then :-)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Actually... @addaleax ... this would be something worth adding to the tests... specifically, ensuring that a user-provided class overriding a built-in set within a preload module cannot lie and that the checks will come up as false.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

a user-provided class overriding a built-in set within a preload module cannot lie

I’m not sure what you mean by that. I have added a test that checks that overriding Symbol.toStringTag doesn’t fool this.

Comment thread test/parallel/test-util-types.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The test should also likely verify that the result is consistent across vm contexts... e.g. check that vm.runInNewContext('new Map()') passes the type check.

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

add:

util.types.isBooleanObject(Boolean(false)); // Returns false
util.types.isBooleanObject(Boolean(true)); // Returns false

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Not sure if we should assert that it is 'built-in' in these. The objects can lie, and user code can create their own objects (polyfills) that are not actually built-ins.

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

async function here could be a link to more documentation about async functions... perhaps a link over the MDN documentation?

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

hmm... this last sentence is a bit content free. why would developers prefer to do type checking in JavaScript :-) ... I think it's better to say something about specific use cases such as "These are primarily useful for debugging" or something similar

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@jasnell I can’t really agree … the “why” is, it’s a preference. I personally don’t think it’s a good idea, but it’s what Node decided to migrate to?

Saying “these are primarily useful for debugging” doesn’t really seem more helpful, because it doesn’t even say how you’d use these methods for debugging…

Comment thread test/parallel/test-util-types.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There's already https://github.com/nodejs/node/blob/master/test/parallel/test-types.js. You might want to look into combining these two files.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@TimothyGu I’ve just copied the contents into a block in this file, let me know if that doesn’t sound good to you. The tests have somewhat different structures, but I think that’s fine?

addaleax removed the lib / src Issues and PRs related to general changes in the lib or src directory. label Mar 5, 2018
addaleax added a commit that referenced this pull request Mar 5, 2018
PR-URL: #18415
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
addaleax added a commit that referenced this pull request Mar 5, 2018
Provide public APIs for native typechecking that is actually useful.
The motivation for this is providing alternatives to userland
modules that would currently rely on `process.binding('util')`.

PR-URL: #18415
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
addaleax added a commit to addaleax/node that referenced this pull request Mar 5, 2018
addaleax added a commit that referenced this pull request Mar 5, 2018
Refs: #18415
PR-URL: #19149
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

Copy link
Copy Markdown
Contributor

Should this be backported to v9.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

Copy link
Copy Markdown
Contributor

this would need to come with #19149

joyeecheung added a commit to joyeecheung/lodash that referenced this pull request Mar 23, 2018
- Use require('util').types instead of using process.binding('util')
  to get the type checking helpers
- Rename nodeUtil to nodeTypes since that is what it is for

Refs: nodejs/node#18415
jdalton pushed a commit to lodash/lodash that referenced this pull request Mar 23, 2018
- Use require('util').types instead of using process.binding('util')
  to get the type checking helpers
- Rename nodeUtil to nodeTypes since that is what it is for

Refs: nodejs/node#18415
addaleax added a commit to addaleax/node that referenced this pull request Mar 26, 2018
The old variants have been deprecated since b20af80.

Refs: nodejs#18415
trivikr pushed a commit that referenced this pull request Mar 28, 2018
The old variants have been deprecated since b20af80.

Refs: #18415

PR-URL: #19602
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
PR-URL: nodejs#18415
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
Provide public APIs for native typechecking that is actually useful.
The motivation for this is providing alternatives to userland
modules that would currently rely on `process.binding('util')`.

PR-URL: nodejs#18415
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
Refs: nodejs#18415
PR-URL: nodejs#19149
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
The old variants have been deprecated since b20af80.

Refs: nodejs#18415

PR-URL: nodejs#19602
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR mentioned this pull request May 1, 2018
4 tasks
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
PR-URL: nodejs#18415
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Provide public APIs for native typechecking that is actually useful.
The motivation for this is providing alternatives to userland
modules that would currently rely on `process.binding('util')`.

PR-URL: nodejs#18415
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Refs: nodejs#18415
PR-URL: nodejs#19149
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

Copy link
Copy Markdown
Contributor

Is this something we would want to backport to v8.x? Seems like a bunch of moving parts

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

Labels

semver-minor PRs that contain new features and should be released in the next minor version. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Footer

© 2026 GitHub, Inc.

Back | FazBrowse Home | New Git URL