Skip to content

Array.prototype[Symbol.unscopables] is not a function #34610

@kazatsuyu

Description

@kazatsuyu

TypeScript Version: 3.7.0-dev.20191018

Search Terms:

  • Array
  • @@unscopables

Code

const x = [][Symbol.unscopables];
console.log(x.copyWithin);

const y = [][Symbol.unscopables]();
console.log(y.copyWithin);

Expected behavior:
x.copyWithin occurs no error, and [][Symbol.unscopables]() occurs type error.

Actual behavior:
x.copyWithin occurs type error, and [][Symbol.unscopables]() occurs runtime exception.

Playground Link:
http://www.typescriptlang.org/play/?ts=Nightly&ssl=6&ssc=1&pln=1&pc=1#code/MYewdgzgLgBAHjAvDA2gXRQZQJ4FsBGIANgHQCukoADgIb5ECmEaA3ALABQokxDJRIAOYAKOCWrYA6gEsoAC2lgAlOw6du0GNiSoMOAsXKUQtekzTCV68BF78hw7OJNTZC5aqA

Related Issues:

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions