Skip to content

Commit 3d5d622

Browse files
committed
[Tests] add coverage
From tc39/test262#4477
1 parent fd65d41 commit 3d5d622

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

test/tests.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,27 @@ module.exports = function (arrayWith, t) {
133133

134134
st.end();
135135
});
136+
137+
t.test('test262: test/built-ins/Array/prototype/with/index-throw-completion', function (st) {
138+
function MyError() {} // eslint-disable-line func-style
139+
140+
var index = {
141+
valueOf: function () { throw new MyError(); }
142+
};
143+
144+
st['throws'](
145+
function () { arrayWith([], index, null); },
146+
MyError,
147+
'throws on index valueOf'
148+
);
149+
150+
st.end();
151+
});
152+
153+
t.test('test262: test/built-ins/Array/prototype/with/negative-fractional-index-truncated-to-zero', function (st) {
154+
var result = arrayWith([0], -0.5, 123);
155+
st.equal(result[0], 123);
156+
157+
st.end();
158+
});
136159
};

0 commit comments

Comments
 (0)