mirror of
https://github.com/chaijs/chai
synced 2024-11-15 00:07:11 +00:00
Merge pull request #818 from shvaikalesh/master
Use utils.type for `arguments` check
This commit is contained in:
commit
b99fae70f6
1 changed files with 3 additions and 4 deletions
|
@ -8,7 +8,6 @@
|
|||
module.exports = function (chai, _) {
|
||||
var Assertion = chai.Assertion
|
||||
, AssertionError = chai.AssertionError
|
||||
, toString = Object.prototype.toString
|
||||
, flag = _.flag;
|
||||
|
||||
/**
|
||||
|
@ -166,7 +165,7 @@ module.exports = function (chai, _) {
|
|||
|
||||
Assertion.addProperty('any', function () {
|
||||
flag(this, 'any', true);
|
||||
flag(this, 'all', false)
|
||||
flag(this, 'all', false);
|
||||
});
|
||||
|
||||
|
||||
|
@ -577,9 +576,9 @@ module.exports = function (chai, _) {
|
|||
|
||||
function checkArguments () {
|
||||
var obj = flag(this, 'object')
|
||||
, type = Object.prototype.toString.call(obj);
|
||||
, type = _.type(obj);
|
||||
this.assert(
|
||||
'[object Arguments]' === type
|
||||
'arguments' === type
|
||||
, 'expected #{this} to be arguments but got ' + type
|
||||
, 'expected #{this} to not be arguments'
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue