Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: enhance use of Error from primordials #31163

Closed

Conversation

@Sebastien-Ahkrin
Copy link
Contributor

Sebastien-Ahkrin commented Jan 2, 2020

Hello,
Now, in this PR I have added Error in the primordials eslint
so have created a line in "/lib/.eslintrc.yaml".

rules:
  no-restricted-globals:
  - name: Error
        message: "Use `const { Error } = primordials;` instead of the global."

And just import Error :).

const {
  // [...]
  Error,
} = primordials;

I hope this new PR will help you :x

@Sebastien-Ahkrin

This comment has been minimized.

Copy link
Contributor Author

Sebastien-Ahkrin commented Jan 2, 2020

Refs: #30697

@BridgeAR

This comment has been minimized.

Copy link
Member

BridgeAR commented Jan 2, 2020

Does this have any impact on instanceof checks?

@targos

This comment has been minimized.

Copy link
Member

targos commented Jan 2, 2020

Does this have any impact on instanceof checks?

No, the object is the same as the global one.

@nodejs-github-bot

This comment has been minimized.

@jasnell
jasnell approved these changes Jan 2, 2020
@Sebastien-Ahkrin

This comment has been minimized.

Copy link
Contributor Author

Sebastien-Ahkrin commented Jan 3, 2020

This PR is errored with the JS test suite in the "parallel/test-tick-processor-arguments" test ...
But i don't know why ...

i can reproduce the error now in my computer .
It's a "Unexpected end of JSON input" 😢

i will investigate 😄

https://travis-ci.com/nodejs/node/jobs/271895965

@Sebastien-Ahkrin Sebastien-Ahkrin force-pushed the Sebastien-Ahkrin:ErrorPrimordials branch from 2b5695f to 9c1d309 Jan 3, 2020
@Sebastien-Ahkrin

This comment has been minimized.

Copy link
Contributor Author

Sebastien-Ahkrin commented Jan 3, 2020

This PR is errored with the JS test suite in the "parallel/test-tick-processor-arguments" test ...
But i don't know why ...

i can reproduce the error now in my computer .
It's a "Unexpected end of JSON input" 😢

i will investigate 😄

https://travis-ci.com/nodejs/node/jobs/271895965

@targos found the error 😄 so its only because the file v8-prof-polyfill can't contain any primordials.
Si i have added this line:

/* eslint-disable no-restricted-globals */

I hope this will help you :)

@Trott
Trott approved these changes Jan 4, 2020
@nodejs-github-bot

This comment has been minimized.

@Trott
Trott approved these changes Jan 4, 2020
@trivikr
trivikr approved these changes Jan 4, 2020
@nodejs-github-bot

This comment has been minimized.

Trott added a commit that referenced this pull request Jan 4, 2020
PR-URL: #31163
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Trott added a commit to Trott/io.js that referenced this pull request Jan 4, 2020
PR-URL: nodejs#31163
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@Trott

This comment has been minimized.

Copy link
Member

Trott commented Jan 4, 2020

Landed in c9b93e2

@Trott Trott closed this Jan 4, 2020
targos added a commit that referenced this pull request Jan 6, 2020
PR-URL: #31163
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Jan 7, 2020
targos added a commit that referenced this pull request Jan 14, 2020
PR-URL: #31163
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.