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

Fix wrong call to the underlying method when checking if an object is frozen #490

Merged
merged 1 commit into from Jul 18, 2015

Conversation

@astorije
Copy link
Member

astorije commented Jul 17, 2015

No description provided.

@keithamus
Copy link
Member

keithamus commented Jul 18, 2015

Ooops, good call. Missed that in the PR. Thanks @astorije

keithamus added a commit that referenced this pull request Jul 18, 2015
Fix wrong call to the underlying method when checking if an object is frozen
@keithamus keithamus merged commit 0d5e87a into chaijs:master Jul 18, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@astorije
Copy link
Member Author

astorije commented Jul 18, 2015

For the record, here is why this buggy version passes the tests:

> var v = { foo: "bar" }
undefined
> Object.isSealed(v)
false
> Object.isFrozen(v)
false
> Object.freeze(v)
{ foo: 'bar' }
> Object.isSealed(v)
true
> Object.isFrozen(v)
true

So if you are frozen, you are sealed.

(Note that the opposite is not true:

> var v2 = { foo: "bar" }
undefined
> Object.isSealed(v2)
false
> Object.isFrozen(v2)
false
> Object.seal(v2)
{ foo: 'bar' }
> Object.isSealed(v2)
true
> Object.isFrozen(v2)
false

)

@astorije
Copy link
Member Author

astorije commented Jul 18, 2015

@keithamus, can you quickly release version 3.1.1 to make sure anyone who gladly switched to version 3.1.x to have these methods does not fall in this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.