-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
CustomError implementation triggers the override mistake #231
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The implementation of
CustomError
uses an assignment to set theconstructor
andname
properties, which would trigger what is commonly known as the override mistake in an environment with frozen intrinsics (like Node.js with--frozen-intrinsics
or Hardened JavaScript).In this case, both
constructor
andname
are properties ofError.prototype
which would be frozen and thus non-writable in those environments.The solution is to explicitly define the properties instead of using an assignment, for example:
The text was updated successfully, but these errors were encountered: