8000 Use uncommon key for canDefineProperty test · powercoder23/immutable-js@1c9d970 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c9d970

Browse files
committed
Use uncommon key for canDefineProperty test
Some versions of Chrome have a bug where in some conditions, setting a property as non-enumerable can result in that property being non enumerable for all objects, as reported by immutable-js#295. As a work-around, we should be using a property name that is far less likely to be used as an enumerable property in the future.
1 parent 5427d40 commit 1c9d970

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dist/immutable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@
869869
// True if Object.defineProperty works as expected. IE8 fails this test.
870870
var canDefineProperty = (function() {
871871
try {
872-
Object.defineProperty({}, 'x', {});
872+
Object.defineProperty({}, '@', {});
873873
return true;
874874
} catch (e) {
875875
return false;

dist/immutable.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Hash.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function hashJSObj(obj) {
131131
// True if Object.defineProperty works as expected. IE8 fails this test.
132132
var canDefineProperty = (function() {
133133
try {
134-
Object.defineProperty({}, 'x', {});
134+
Object.defineProperty({}, '@', {});
135135
return true;
136136
} catch (e) {
137137
return false;

0 commit comments

Comments
 (0)
0