Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 537 Bytes

example.md

File metadata and controls

35 lines (24 loc) · 537 Bytes

ECMAScript proposal: Support union of "types" by | operator

Motivation

i current world

if (a instanceof UnknownError || a instanceof UnexpectedError) {
}

High-level API

Example 1:

if (a instanceof UnknownError|UnexpectedError) {
}

Example 2:

If #7 will be accepted (syntax ver 2), we can do

try {
   doStuff();
} catch (e instaceof UnknownError|UnexpectedError) {

}