From 2f8e8fa6b0c25a66a95c3f7557ab406ad48874af Mon Sep 17 00:00:00 2001 From: Alexey Shvayka Date: Wed, 19 Aug 2020 13:47:20 +0300 Subject: [PATCH] Array binding: add deleted Array.prototype[Symbol.iterator] test case --- ...ary-init-iter-get-err-array-prototype.case | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/dstr-binding/ary-init-iter-get-err-array-prototype.case diff --git a/src/dstr-binding/ary-init-iter-get-err-array-prototype.case b/src/dstr-binding/ary-init-iter-get-err-array-prototype.case new file mode 100644 index 0000000000..ffb709efbd --- /dev/null +++ b/src/dstr-binding/ary-init-iter-get-err-array-prototype.case @@ -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