Skip to content

Commit

Permalink
Test that property added to object is correct value (Object.definePro…
Browse files Browse the repository at this point in the history
…perty and Object.defineProperties). Fixes #29.
  • Loading branch information
unscriptable committed Mar 18, 2014
1 parent a48bbc8 commit f50f86c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions object.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ define(function (require) {
if (('defineProperty' in Object)) {
try {
// test it
Object.defineProperty(object, 'sentinel1', { value: 1 })
return 'sentinel1' in object;
Object.defineProperty(object, 'sentinel1', { value: true })
return object['sentinel1'] === true;
}
catch (ex) { /* squelch */ }
}
Expand All @@ -238,8 +238,8 @@ define(function (require) {
if (('defineProperties' in Object)) {
try {
// test it
Object.defineProperties(object, { 'sentinel2': { value: 1 } })
return 'sentinel2' in object;
Object.defineProperties(object, { 'sentinel2': { value: true } })
return object['sentinel2'] === true;
}
catch (ex) { /* squelch */ }
}
Expand Down

0 comments on commit f50f86c

Please sign in to comment.