From 300b994ad3adc5cb09aaeabb7f01fe78c422ffe7 Mon Sep 17 00:00:00 2001 From: Aleksey Shvayka Date: Wed, 6 Sep 2017 22:19:26 +0300 Subject: [PATCH] do not attempt to define properties on primitives --- test/utilities.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/utilities.js b/test/utilities.js index eab6422d8..50963f2f1 100644 --- a/test/utilities.js +++ b/test/utilities.js @@ -829,8 +829,9 @@ describe('utilities', function () { new chai.Assertion(this._obj).to.be.equal('x'); } , function () { - this._obj = this._obj || {}; - this._obj.__x = 'X!' + if (this._obj === Object(this._obj)) { + this._obj.__x = 'X!' + } } ); @@ -939,8 +940,9 @@ describe('utilities', function () { new chai.Assertion(this._obj).to.be.equal('x'); } , function () { - this._obj = this._obj || {}; - this._obj.__x = 'X!' + if (this._obj === Object(this._obj)) { + this._obj.__x = 'X!' + } } );