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

Standard does not warn of adding properties to non-extensible objects. #1201

Closed
setpill opened this issue Sep 19, 2018 · 3 comments

Comments

@setpill
Copy link

commented Sep 19, 2018

What version of standard?
12.0.1

What operating system, Node.js, and npm version?
OS: Ubuntu 18.04
Node.js: v8.12.0
npm: 6.4.1

Example code

'use strict'

var obj = {}
Object.preventExtensions(obj)

obj.test = 'this throws a TypeError'

What did you expect to happen?
Standardjs to warn me of the TypeError that running this code throws.

What actually happened?
Standardjs gives no warning and the code throws a TypeError.

@LinusU

This comment has been minimized.

Copy link
Member

commented Sep 19, 2018

Is there an ESLint rule that would warn against that?

@setpill

This comment has been minimized.

Copy link
Author

commented Sep 20, 2018

I'm not sure if a new one would need to be written or if one already exists.

@setpill

This comment has been minimized.

Copy link
Author

commented Sep 24, 2018

After discussion in the ESLint gitter, it seems unlikely that such a rule will be added, so closing this issue.

@setpill setpill closed this Sep 24, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Dec 23, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.