mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Adjust property descriptors in tests.
This commit is contained in:
14
test/test.js
14
test/test.js
@@ -195,7 +195,7 @@
|
|||||||
/** Poison the free variable `root` in Node.js */
|
/** Poison the free variable `root` in Node.js */
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(global.root, 'root', {
|
Object.defineProperty(global.root, 'root', {
|
||||||
'configurable': true,
|
'configurable': false,
|
||||||
'enumerable': false,
|
'enumerable': false,
|
||||||
'get': function() { throw new ReferenceError; }
|
'get': function() { throw new ReferenceError; }
|
||||||
});
|
});
|
||||||
@@ -5800,12 +5800,14 @@
|
|||||||
pass = true;
|
pass = true;
|
||||||
|
|
||||||
defineProperty(object, 'a', {
|
defineProperty(object, 'a', {
|
||||||
|
'enumerable': true,
|
||||||
|
'configurable': true,
|
||||||
'get': _.constant(value),
|
'get': _.constant(value),
|
||||||
'set': function() { pass = false; }
|
'set': function() { pass = false; }
|
||||||
});
|
});
|
||||||
|
|
||||||
func(object, { 'a': value });
|
func(object, { 'a': value });
|
||||||
assert.ok(pass, value);
|
assert.ok(pass);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(assert);
|
skipTest(assert);
|
||||||
@@ -16161,12 +16163,14 @@
|
|||||||
pass = true;
|
pass = true;
|
||||||
|
|
||||||
defineProperty(object, 'a', {
|
defineProperty(object, 'a', {
|
||||||
|
'enumerable': true,
|
||||||
|
'configurable': true,
|
||||||
'get': _.constant(value),
|
'get': _.constant(value),
|
||||||
'set': function() { pass = false; }
|
'set': function() { pass = false; }
|
||||||
});
|
});
|
||||||
|
|
||||||
func(object, 'a', value);
|
func(object, 'a', value);
|
||||||
assert.ok(pass, value);
|
assert.ok(pass);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(assert);
|
skipTest(assert);
|
||||||
@@ -19203,7 +19207,9 @@
|
|||||||
if (!isStrict && defineProperty) {
|
if (!isStrict && defineProperty) {
|
||||||
defineProperty(object, 'a', {
|
defineProperty(object, 'a', {
|
||||||
'configurable': false,
|
'configurable': false,
|
||||||
'value': 1
|
'enumerable': true,
|
||||||
|
'writable': true,
|
||||||
|
'value': 1,
|
||||||
});
|
});
|
||||||
assert.strictEqual(_.unset(object, 'a'), false);
|
assert.strictEqual(_.unset(object, 'a'), false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user