Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@kazatsuyu

Description

@kazatsuyu
Issue body actions

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:

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.