Array binding: add deleted Array.prototype[Symbol.iterator] test case

This commit is contained in:
Alexey Shvayka 2020-08-19 13:47:20 +03:00 committed by Rick Waldron
parent 36f73c6142
commit 2f8e8fa6b0
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Abrupt completion returned by GetIterator
template: error
info: |
Runtime Semantics: BindingInitialization
BindingPattern : ArrayBindingPattern
1. Let iteratorRecord be ? GetIterator(value).
GetIterator ( obj [ , hint [ , method ] ] )
[...]
4. Let iterator be ? Call(method, obj).
Call ( F, V [ , argumentsList ] )
[...]
2. If IsCallable(F) is false, throw a TypeError exception.
features: [Symbol.iterator]
---*/
//- setup
delete Array.prototype[Symbol.iterator];
//- elems
[x, y, z]
//- vals
[1, 2, 3]
//- error
TypeError