Skip to content

Commit a5477a5

Browse files
author
Dmitry Dutikov
committed
constructor serializing test added
1 parent 39ddf7a commit a5477a5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/stringify.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,13 @@ suite('Stringify method tests', function () {
208208
assert.equal(string, json);
209209
});
210210

211+
test('constructor - too much arguments check', () => {
212+
const Ctor = function(a, b) {
213+
this.value = [a, b, 3, 4];
214+
this.valueOf = () => this.value;
215+
};
216+
const js = new Ctor(1, 2);
217+
assert.throws(() => JSON22.parse(js));
218+
});
219+
211220
});

0 commit comments

Comments
 (0)