利用者:Ef3/ECMAScript の変遷

出典: フリー教科書『ウィキブックス(Wikibooks)』

JavaScriptの言語コアは、ECMAScript;ECMAIntl.のTC39でECMA-262として標準化されています。

各版の新機能など[編集]

版ごとに改訂の様子を観ていきましょう。

ECMAScript 1st Edition(ES1)[編集]

ECMAScript言語仕様の開発は、1996年11月に開始されました。このEcma規格の初版は、1997年6月のEcma総会で採択されました。

バージョン
初版
発行
1997 年 6 月
仕様書
https://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%201st%20edition,%20June%201997.pdf

標準の章立てに従った分類(ES1)[編集]

1.Scope (ES1)[編集]
2.Conformance (ES1)[編集]
3.References (ES1)[編集]
4.Overview (ES1)[編集]
  • Web Scripting
  • Language Overview
    • Objects
  • Definitions
    • Type
    • Primitive value
    • Object
    • Constructor
    • Prototype
    • Native object
    • Built-in object
    • Host object
    • Undefined
    • Undefined type
    • Null
    • Null type
    • Boolean value
    • Boolean type
    • Boolean object
    • String value
    • String type
    • String object
    • Number value
    • Number type
    • Number object
    • Infinity
    • NaN
5.Notational Conventions (ES1)[編集]
  • Syntactic and Lexical Grammars
    • Context-Free Grammars
    • The lexical grammar
    • The numeric string grammar
    • The syntactic grammar
    • Grammar Notation
  • Algorithm conventions
6.Source Text (ES1)[編集]
7.Lexical Conventions (ES1)[編集]
  • White Space
  • Line Terminators
  • Comments
  • Tokens
    • Reserved Words
    • Keywords
    • Future Reserved Words
  • Identifiers
  • Punctuators
  • Literals
    • Null Literals
    • Boolean Literals
    • Numeric Literals
    • String Literals
  • Automatic semicolon insertion
    • Rules of automatic semicolon insertion
    • Examples of Automatic Semicolon Insertion
8.Types (ES1)[編集]
  • The Undefined type
  • The Null type
  • The Boolean type
  • The String type
  • The Number type
  • The Object type
    • Property attributes
    • Internal Properties and Methods
  • The Reference Type
    • GetBase(V)
    • GetPropertyName(V)
    • GetValue(V)
    • PutValue(V, W)
  • The List type
  • The Completion Type
9.Type Conversion (ES1)[編集]
  • ToPrimitive
  • ToBoolean
  • ToNumber
    • ToNumber Applied to the String Type
  • ToInteger
  • ToInt32:(signed 32 bit integer)
  • ToUint32:(unsigned 32 bit integer)
  • ToUint16:(unsigned 16 bit integer)
  • ToString
    • ToString Applied to the Number Type
  • ToObject
10.Execution Contexts (ES1)[編集]
  • Definitions
    • Function Objects
    • Types of Executable Code
    • Variable instantiation
    • Scope Chain and Identifier Resolution
    • Global Object
    • Activation object
    • This
    • Arguments Object
  • Entering An Execution Context
    • Global Code
    • Eval Code
    • Function and Anonymous Code
    • Implementation-supplied Code
11.Expressions (ES1)[編集]
  • Primary Expressions
    • The this keyword
    • Identifier reference
    • Literal reference
    • The Grouping Operator
  • Left-Hand-Side Expressions
    • Property Accessors
    • The new operator
    • Function Calls
    • Argument Lists
  • Postfix expressions
    • Postfix increment operator
    • Postfix decrement operator
  • Unary operators
    • The delete operator
    • The void operator
    • The typeof operator
    • Prefix increment operator
    • Prefix decrement operator
    • Unary + operator
    • Unary - operator
    • The bitwise NOT operator(~)
    • Logical NOT operator(!)
  • Multiplicative operators
    • Applying the * operator
    • Applying the / operator
    • Applying the % operator
  • Additive operators
    • The addition operator(+)
    • The subtraction operator(-)
    • Applying the additive operators(+, -) to numbers
  • Bitwise shift operators
    • The left shift operator(<<)
    • The signed right shift operator(>>)
    • The unsigned right shift operator(>>>)
  • Relational operators
    • The less-than operator(<)
    • The greater-than operator(>)
    • The less-than-or-equal operator(<=)
    • The greater-than-or-equal operator(>=)
    • The abstract relational comparison algorithm
  • Equality operators
    • The equals operator(==)
    • The does-not-equals operator(!=)
    • The abstract equality comparison algorithm
  • Binary bitwise operators
  • Binary logical operators
  • Conditional operator(?:)
  • Assignment operators
    • Simple Assignment(=)
    • Compound assignment(op=)
  • Comma operator(,)
12.Statements (ES1)[編集]
  • Block
  • Variable statement
  • Empty statement
  • Expression statement
  • The IF statement
  • Iteration statements
    • The while statement
    • The for statement
    • The for..in statement
  • The CONTINUE statement
  • The BREAK statement
  • The RETURN statement
  • The WITH statement
13.Function Definition (ES1)[編集]
14.Program (ES1)[編集]
15.Native ECMAScript objects (ES1)[編集]
  • The global object
    • Value properties of the global object
      • NaN
      • Infinity
    • Function properties of the global object
      • eval(x)
      • parseInt(string, radix)
      • parseFloat(string)
      • escape(string)
      • unescape(string)
      • isNaN(number)
      • isFinite(number)
    • Constructor Properties of the Global Object
      • Object(. . .)
      • Function(. . .)
      • Array(. . .)
      • String(. . .)
      • Boolean(. . .)
      • Number(. . .)
      • Date(. . .)
    • Other Properties of the Global Object
      • Math
  • Object Objects
    • The Object Constructor Called as a Function
      • Object(value)
      • Object()
    • The Object Constructor
      • new Object(value)
      • new Object()
    • Properties of the Object Constructor
      • Object.prototype
    • Properties of the Object Prototype Object
      • Object.prototype.constructor
      • Object.prototype.toString()
      • Object.prototype.valueOf()
    • Properties of Object Instances
  • Function Objects
    • The Function Constructor Called as a Function
      • Function(p1, p2, . . . , pn, body)
    • The Function Constructor
      • new Function(p1, p2, . . . , pn, body)
    • Properties of the Function Constructor
      • Function.prototype
      • Function.length
    • Properties of the Function Prototype Object
      • Function.prototype.constructor
      • Function.prototype.toString()
    • Properties of Function Instances
      • length
      • prototype
      • arguments
  • Array Objects
    • The Array Constructor Called as a Function
      • Array(item0, item1, . . .)
      • Array(len)
      • Array()
    • The Array Constructor
      • new Array(item0, item1, . . .)
      • new Array(len)
      • new Array()
    • Properties of the Array Constructor
      • Array.prototype
      • Array.length
    • Properties of the Array Prototype Object
      • Array.prototype.constructor
      • Array.prototype.toString()
      • Array.prototype.join(separator)
      • Array.prototype.reverse()
      • Array.prototype.sort(comparefn)
    • Properties of Array Instances
      • length
  • String Objects
    • The String Constructor Called as a Function
      • String(value)
      • String()
    • The String Constructor
      • new String(value)
      • new String()
    • Properties of the String Constructor
      • String.prototype
      • String.fromCharCode(char0, char1, . . .)
    • Properties of the String Prototype Object
      • String.prototype.constructor
      • String.prototype.toString()
      • String.prototype.valueOf()
      • String.prototype.charAt(pos)
      • String.prototype.charCodeAt(pos)
      • String.prototype.indexOf(searchString, position)
      • String.prototype.lastIndexOf(searchString, position)
      • String.prototype.split(separator)
      • String.prototype.substring(start)
      • String.prototype.substring(start, end)
      • String.prototype.toLowerCase
      • String.prototype.toUpperCase
    • Properties of String Instances
      • length
  • Boolean Objects
    • The Boolean Constructor Called as a Function
      • Boolean(value)
      • Boolean()
    • The Boolean Constructor
      • new Boolean(value)
      • new Boolean()
    • Properties of the Boolean Constructor
      • Boolean.prototype
    • Properties of the Boolean Prototype Object
      • Boolean.prototype.constructor
      • Boolean.prototype.toString()
      • Boolean.prototype.valueOf()
    • Properties of Boolean Instances
  • Number Objects
    • The Number Constructor Called as a Function
      • Number(value)
      • Number()
    • The Number Constructor
      • new Number(value)
      • new Number()
    • Properties of the Number Constructor
      • Number.prototype
      • Number.MAX_VALUE
      • Number.MIN_VALUE
      • Number.NaN
      • Number.NEGATIVE_INFINITY
      • Number.POSITIVE_INFINITY
    • Properties of the Number Prototype Object
      • Number.prototype.constructor
      • Number.prototype.toString(radix)
      • Number.prototype.valueOf()
    • Properties of Number Instances
  • The Math Object
    • Value Properties of the Math Object
      • Math.E
      • Math.LOG2E
      • Math.LOG10E
      • Math.PI
    • Function Properties of the Math Object
      • Math.abs(x)
      • Math.acos(x)
      • Math.asin(x)
      • Math.atan(x)
      • Math.atan2(y, x)
      • Math.ceil(x)
      • Math.cos(x)
      • Math.exp(x)
      • Math.floor(x)
      • Math.log(x)
      • Math.max(x, y)
      • Math.min(x, y)
      • Math.pow(x, y)
      • Math.random()
      • Math.round(x)
      • Math.sin(x)
      • Math.sqrt(x)
      • Math.tan(x)
  • Date Objects
    • Overview of Date Objects and Definitions of Internal Operators
      • Time Range
      • Day Number and Time within Day
      • Year Number
      • Month Number
      • Date Number
      • Week Day
      • Local Time Zone Adjustment
      • Daylight Saving Time Adjustment
      • Local Time
      • Hours, Minutes, Second, and Milliseconds
      • MakeTime(hour, min, sec, ms)
      • MakeDay(year, month, date)
      • MakeDate(day, time)
      • TimeClip(time)
    • The Date Constructor Called As a Function
      • Date(year, month, date, hours, minutes, seconds, ms)
      • Date(year, month, date, hours, minutes, seconds)
      • Date(year, month, date, hours, minutes)
      • Date(year, month, date, hours)
      • Date(year, month, day)
      • Date(year, month)
      • Date(value)
      • Date()
    • The Date Constructor
      • new Date(year, month, date, hours, minutes, seconds, ms)
      • new Date(year, month, date, hours, minutes, seconds)
      • new Date(year, month, date, hours, minutes)
      • new Date(year, month, date, hours)
      • new Date(year, month, day)
      • new Date(year, month)
      • new Date(value)
      • new Date()
    • Properties of the Date Constructor
      • Date.prototype
      • Date.parse(string)
      • Date.UTC(year, month, date, hours, minutes, seconds, ms)
      • Date.UTC(year, month, date, hours, minutes, seconds)
      • Date.UTC(year, month, date, hours, minutes)
      • Date.UTC(year, month, date, hours)
      • Date.UTC(year, month, date)
      • Date.UTC(year, month)
      • Date.UTC(year)
      • Date.UTC()
    • Properties of the Date Prototype Object
      • Date.prototype.constructor
      • Date.prototype.toString()
      • Date.prototype.valueOf()
      • Date.prototype.getTime()
      • Date.prototype.getYear()
      • Date.prototype.getFullYear()
      • Date.prototype.getUTCFullYear()
      • Date.prototype.getMonth()
      • Date.prototype.getUTCMonth()
      • Date.prototype.getDate()
      • Date.prototype.getUTCDate()
      • Date.prototype.getDay()
      • Date.prototype.getUTCDay()
      • Date.prototype.getHours()
      • Date.prototype.getUTCHours()
      • Date.prototype.getMinutes()
      • Date.prototype.getUTCMinutes()
      • Date.prototype.getSeconds()
      • Date.prototype.getUTCSeconds()
      • Date.prototype.getMilliseconds()
      • Date.prototype.getUTCMilliseconds()
      • Date.prototype.getTimezoneOffset()
      • Date.prototype.setTime(time)
      • Date.prototype.setMilliseconds(ms)
      • Date.prototype.setUTCMilliseconds(ms)
      • Date.prototype.setSeconds(sec [, ms ])
      • Date.prototype.setUTCSeconds(sec [, ms ])
      • Date.prototype.setMinutes(min [, sec [, ms ]])
      • Date.prototype.setUTCMinutes(min [, sec [, ms ]])
      • Date.prototype.setHours(hour [, min [, sec [, ms ]]])
      • Date.prototype.setUTCHours(hour [, min [, sec [, ms ]]])
      • Date.prototype.setDate(date)
      • Date.prototype.setUTCDate(date)
      • Date.prototype.setMonth(mon [, date ])
      • Date.prototype.setUTCMonth(mon [, date ])
      • Date.prototype.setFullYear(year [, month [, date ]])
      • Date.prototype.setUTCFullYear(year [, month [, date ]])
      • Date.prototype.setYear(year)
      • Date.prototype.toLocaleString()
      • Date.prototype.toUTCString()
      • Date.prototype.toGMTString()
    • Properties of Date Instances
16.Errors (ES1)[編集]

※ ES1 には、まだ Errorオブジェクトはありません。

ECMAScript 2nd Edition(ES2)[編集]

第2版は、ISO/IEC JTC 1に提出され、ファストトラック方式[1]で採択され、1998年4月に国際規格ISO/IEC 16262として承認されました。1998年6月のEcma総会では、ISO/IEC 16262との整合性を保つためにECMA-262の第2版が承認された。第 1 版と第 2 版の間の変更点は、編集上のものである。

バージョン
第2版
発行
1998 年 8 月
ISO
ISO 16262:1998
JIS
JIS X 3060:2000[2]
仕様書
https://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%202nd%20edition,%20August%201998.pdf

標準の章立てに従った分類(ES2)[編集]

1.Scope (ES2)[編集]
2.Conformance (ES2)[編集]
3.References (ES2)[編集]
4.Overview (ES2)[編集]
  • Definitions
    • Undefined
    • Undefined value
    • Null
    • Null value
5.Notational Conventions (ES2)[編集]
6.Source Text (ES2)[編集]
  • character encoding.
7.Lexical Conventions (ES2)[編集]
8.Types (ES2)[編集]
9.Type Conversion (ES2)[編集]
10.Execution Contexts (ES2)[編集]
11.Expressions (ES2)[編集]
12.Statements (ES2)[編集]
13.Function Definition (ES2)[編集]
14.Program (ES2)[編集]
15.Native ECMAScript objects (ES2)[編集]
  • Function Objects
    • Properties of Function Instances
      • arguments
16.Errors (ES2)[編集]

ECMAScript 3rd Edition(ES3)[編集]

第3版では、将来の言語の成長を見越したマイナーチェンジなどが導入されました。ECMAScript規格の第3版は、1999年12月のEcma総会で採択され、2002年6月にISO/IEC 16262:2002として発行されました。

バージョン
第3版
発行
1999 年 12 月
JavaScriptのバージョン
JavaScript 1.5
仕様書
https://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%203rd%20edition,%20December%201999.pdf

変更点 (ES3)[編集]

ES3では、正規表現・ do-while 文・switch 文・ラベル文・throw文・try文・undefined(グローバル)・URI ハンドリング用の関数・グローバル・オブジェクトのコンストラクタ・プロパティ などが追加され、escape()/unescape()が仕様から削除されました。

(この部分の要約の仕方は思案中で、以下に階層的に一覧化した)

表記方法 (ES3)[編集]
  • 正規表現文法(追加)
語彙規約 (ES3)[編集]
  • リテラル
    • 正規表現リテラル(追加)
文 (ES3)[編集]
  • 反復文
    • do-while 文(追加)
  • switch 文(追加)
  • ラベル文(追加)
  • throw文(追加)
  • try文(追加)
ECMAScript ネイティブオブジェクト (ES3)[編集]
  • グローバル・オブジェクト
    • グローバル・オブジェクトの値プロパティ
      • undefined(追加)
    • グローバル・オブジェクトの関数プロパティ
      • escape(string)(削除)
      • unescape(string)(削除)
    • URI ハンドリング用の関数プロパティ(追加)
      • decodeURI(encodedURI)(追加)
      • decodeURIComponent(encodedURIComponent)(追加)
      • encodeURI(uri)(追加)
      • encodeURIComponent(uriComponent)(追加)
    • グローバル・オブジェクトのコンストラクタ・プロパティ
      • RegExp(. . .)(追加)
      • Error(. . .)(追加)
      • EvalError(. . .)(追加)
      • RangeError(. . .)(追加)
      • ReferenceError(...)(追加)
      • SyntaxError(. . .)(追加)
      • TypeError(. . .)(追加)
      • URIError(. . .)(追加)
  • Objectオブジェクト
    • 関数として呼び出されるObjectオブジェクトコンストラクタ
      • Object(value)(削除)
      • Object()(削除)
      • Object([ value ])(追加)
    • Objectオブジェクトコンストラクタ
      • new Object(value)(削除)
      • new Object()(削除)
      • new Object([ value ])(追加)
    • Objectオブジェクトのプロパティ プロトタイプ オブジェクト
      • Object.prototype.toLocaleString()(追加)
      • Object.prototype.hasOwnProperty(V)(追加)
      • Object.prototype.isPrototypeOf(V)(追加)
      • Object.prototype.propertyIsEnumerable(V)(追加)
  • Function オブジェクト
    • Functionオブジェクトコンストラクタのプロパティ
      • Function.length(削除)
    • Functionオブジェクトのプロパティ プロトタイプ オブジェクト
      • Function.prototype.apply(thisArg, argArray)(追加)
      • Function.prototype.call(thisArg [ , arg1 [ , arg2, … ] ])(追加)
  • Arrayオブジェクト
    • Properties of the Array Constructor
      • Array.length(削除)
    • Properties of the Array Prototype Object
      • Array.prototype.toLocaleString()(追加)
      • Array.prototype.concat([ item1 [ , item2 [ , … ] ] ])(追加)
      • Array.prototype.pop()(追加)
      • Array.prototype.push([ item1 [ , item2 [ , … ] ] ])(追加)
      • Array.prototype.shift()(追加)
      • Array.prototype.slice(start, end)(追加)
      • Array.prototype.splice(start, deleteCount [ , item1 [ , item2 [ , … ] ] ])(追加)
      • Array.prototype.unshift([ item1 [ , item2 [ , … ] ] ])(追加)
  • String Objects
    • Properties of the String Constructor
      • String.fromCharCode(char0, char1, . . .)(削除)
      • String.fromCharCode([ char0 [ , char1 [ , … ] ] ])(追加)
    • Properties of the String Prototype Object
      • String.prototype.concat([ string1 [ , string2 [ , … ] ] ])(追加)
      • String.prototype.split(separator)(削除)
      • String.prototype.substring(start)(削除)
      • String.prototype.localeCompare(that)(追加)
      • String.prototype.match(regexp)(追加)
      • String.prototype.replace(searchValue, replaceValue)(追加)
      • String.prototype.search(regexp)(追加)
      • String.prototype.slice(start, end)(追加)
      • String.prototype.split(separator, limit)(追加)
      • String.prototype.toLowerCase(削除)
      • String.prototype.toUpperCase(削除)
      • String.prototype.toLowerCase()(追加)
      • String.prototype.toLocaleLowerCase()(追加)
      • String.prototype.toUpperCase()(追加)
      • String.prototype.toLocaleUpperCase()(追加)
  • Boolean Objects
    • The Boolean Constructor Called as a Function
      • Boolean()(削除)
    • The Boolean Constructor
      • new Boolean()(削除)
  • Number Objects
    • Properties of the Number Prototype Object
      • Number.prototype.toLocaleString()(追加)
      • Number.prototype.toFixed(fractionDigits)(追加)
      • Number.prototype.toExponential(fractionDigits)(追加)
      • Number.prototype.toPrecision(precision)(追加)
  • The Math Object
    • Function Properties of the Math Object
      • Math.max(x, y)(削除)
      • Math.min(x, y)(削除)
      • Math.max([ value1 [ , value2 [ , … ] ] ])(追加)
      • Math.min([ value1 [ , value2 [ , … ] ] ])(追加)
  • Date Objects
    • Properties of the Date Prototype Object
      • Date.prototype.toDateString()(追加)
      • Date.prototype.toTimeString()(追加)
      • Date.prototype.toLocaleString()(追加)
      • Date.prototype.toLocaleDateString()(追加)
      • Date.prototype.toLocaleTimeString()(追加)
      • Date.prototype.getYear()(削除)
      • Date.prototype.setMonth(mon [, date ])(削除)
      • Date.prototype.setUTCMonth(mon [, date ])(削除)
      • Date.prototype.setMonth(month [, date ])(追加)
      • Date.prototype.setUTCMonth(month [, date ])(追加)
      • Date.prototype.setYear(year)(削除)
      • Date.prototype.toLocaleString()(削除)
      • Date.prototype.toGMTString()(削除)
  • RegExp(Regular Expression) Objects(追加)
    • Patterns(追加)
    • Pattern Semantics(追加)
      • Notation(追加)
      • Pattern(追加)
      • Disjunction(追加)
      • Alternative(追加)
      • Term(追加)
      • Assertion(追加)
      • Quantifier(追加)
      • Atom(追加)
      • AtomEscape(追加)
      • CharacterEscape(追加)
      • DecimalEscape(追加)
      • CharacterClassEscape(追加)
      • CharacterClass(追加)
      • ClassRanges(追加)
      • NonemptyClassRanges(追加)
      • NonemptyClassRangesNoDash(追加)
      • ClassAtom(追加)
      • ClassAtomNoDash(追加)
      • ClassEscape(追加)
    • The RegExp Constructor Called as a Function(追加)
      • RegExp(pattern, flags)(追加)
    • The RegExp Constructor(追加)
      • new RegExp(pattern, flags)(追加)
    • Properties of the RegExp Constructor(追加)
      • RegExp.prototype(追加)
    • Properties of the RegExp Prototype Object(追加)
      • RegExp.prototype.constructor(追加)
      • RegExp.prototype.exec(string)(追加)
      • RegExp.prototype.test(string)(追加)
      • RegExp.prototype.toString()(追加)
    • Properties of RegExp Instances(追加)
      • source(追加)
      • global(追加)
      • ignoreCase(追加)
      • multiline(追加)
      • lastIndex(追加)
  • Error Objects(追加)
    • The Error Constructor Called as a Function(追加)
      • Error(message)(追加)
    • The Error Constructor(追加)
      • new Error(message)(追加)
    • Properties of the Error Constructor(追加)
      • Error.prototype(追加)
    • Properties of the Error Prototype Object(追加)
      • Error.prototype.constructor(追加)
      • Error.prototype.name(追加)
      • Error.prototype.message(追加)
      • Error.prototype.toString()(追加)
    • Properties of Error Instances(追加)
    • Native Error Types Used in This Standard(追加)
      • EvalError(追加)
      • RangeError(追加)
      • ReferenceError(追加)
      • SyntaxError(追加)
      • TypeError(追加)
      • URIError(追加)
    • NativeError Object Structure(追加)
      • NativeError Constructors Called as Functions(追加)
      • NativeError(message)(追加)
      • The NativeError Constructors(追加)
      • New NativeError(message)(追加)
      • Properties of the NativeError Constructors(追加)
      • NativeError.prototype(追加)
      • Properties of the NativeError Prototype Objects(追加)
      • NativeError.prototype.constructor(追加)
      • NativeError.prototype.name(追加)
      • NativeError.prototype.message(追加)
      • Properties of NativeError Instances(追加)

標準の章立てに従った分類(ES3)[編集]

1.Scope (ES3)[編集]
2.Conformance (ES3)[編集]
3.References (ES3)[編集]
4.Overview (ES3)[編集]
5.Notational Conventions (ES3)[編集]
  • Syntactic and Lexical Grammars
    • The lexical grammar
    • The Lexical and RegExp Grammars
6.Source Text (ES3)[編集]
  • character encoding.
7.Lexical Conventions (ES3)[編集]
  • Unicode Format-Control Characters
  • Literals
    • Regular Expression Literals
8.Types (ES3)[編集]
  • The Reference Type
    • GetBase(V)
    • GetPropertyName(V)
9.Type Conversion (ES3)[編集]
10.Execution Contexts (ES3)[編集]
  • Entering An Execution Context
    • Function and Anonymous Code
    • Implementation-supplied Code
    • Function Code
11.Expressions (ES3)[編集]
  • Primary Expressions
    • Array Initialiser
    • Object Initialiser
  • Left-Hand-Side Expressions
    • Function Expressions
  • Unary operators
    • The bitwise NOT operator(~)
    • Bitwise NOT Operator(~)
  • Relational operators
    • The instanceof operator
    • The in operator
  • Equality operators
    • The Strict Equals Operator(===)
    • The Strict Does-not-equal Operator(!==)
    • The Strict Equality Comparison Algorithm
12.Statements (ES3)[編集]
  • Iteration statements
    • The do-while Statement
    • The for..in statement
    • The for-in Statement
  • The switch Statement
  • Labelled Statements
  • The throw statement
  • The try statement
13.Function Definition (ES3)[編集]
  • Definitions
    • Equated Grammar Productions
    • Joined Objects
  • Creating Function Objects
14.Program (ES3)[編集]
15.Native ECMAScript objects (ES3)[編集]
  • The Global Object
    • Value properties of the Global Object
      • undefined
    • Function properties of the Global Object
      • escape(string)
      • unescape(string)
    • URI Handling Function Properties
      • decodeURI(encodedURI)
      • decodeURIComponent(encodedURIComponent)
      • encodeURI(uri)
      • encodeURIComponent(uriComponent)
    • Constructor Properties of the Global Object
      • RegExp(. . .)
      • Error(. . .)
      • EvalError(. . .)
      • RangeError(. . .)
      • ReferenceError(...)
      • SyntaxError(. . .)
      • TypeError(. . .)
      • URIError(. . .)
  • Object Objects
    • The Object Constructor Called as a Function
      • Object(value)
      • Object()
      • Object([ value ])
    • The Object Constructor
      • new Object(value)
      • new Object()
      • new Object([ value ])
    • Properties of the Object Prototype Object
      • Object.prototype.toLocaleString()
      • Object.prototype.hasOwnProperty(V)
      • Object.prototype.isPrototypeOf(V)
      • Object.prototype.propertyIsEnumerable(V)
  • Function Objects
    • The Function Constructor Called as a Function
      • Function(p1, p2, . . . , pn, body)
      • Function(p1, p2, … , pn, body)
    • The Function Constructor
      • new Function(p1, p2, . . . , pn, body)
      • new Function(p1, p2, … , pn, body)
    • Properties of the Function Constructor
      • Function.length
    • Properties of the Function Prototype Object
      • Function.prototype.apply(thisArg, argArray)
      • Function.prototype.call(thisArg [ , arg1 [ , arg2, … ] ])
  • Array Objects
    • The Array Constructor Called as a Function
      • Array(item0, item1, . . .)
      • Array(len)
      • Array()
      • Array([ item1 [ , item2 [ , … ] ] ])
    • The Array Constructor
      • new Array(item0, item1, . . .)
      • new Array([ item0 [ , item1 [ , … ] ] ])
      • new Array()
    • Properties of the Array Constructor
      • Array.length
    • Properties of the Array Prototype Object
      • Array.prototype.toLocaleString()
      • Array.prototype.concat([ item1 [ , item2 [ , … ] ] ])
      • Array.prototype.pop()
      • Array.prototype.push([ item1 [ , item2 [ , … ] ] ])
      • Array.prototype.shift()
      • Array.prototype.slice(start, end)
      • Array.prototype.splice(start, deleteCount [ , item1 [ , item2 [ , … ] ] ])
      • Array.prototype.unshift([ item1 [ , item2 [ , … ] ] ])
  • String Objects
    • The String Constructor Called as a Function
      • String(value)
      • String()
      • String([ value ])
    • The String Constructor
      • new String(value)
      • new String()
      • new String([ value ])
    • Properties of the String Constructor
      • String.fromCharCode(char0, char1, . . .)
      • String.fromCharCode([ char0 [ , char1 [ , … ] ] ])
    • Properties of the String Prototype Object
      • String.prototype.concat([ string1 [ , string2 [ , … ] ] ])
      • String.prototype.split(separator)
      • String.prototype.substring(start)
      • String.prototype.localeCompare(that)
      • String.prototype.match(regexp)
      • String.prototype.replace(searchValue, replaceValue)
      • String.prototype.search(regexp)
      • String.prototype.slice(start, end)
      • String.prototype.split(separator, limit)
      • String.prototype.toLowerCase
      • String.prototype.toUpperCase
      • String.prototype.toLowerCase()
      • String.prototype.toLocaleLowerCase()
      • String.prototype.toUpperCase()
      • String.prototype.toLocaleUpperCase()
  • Boolean Objects
    • The Boolean Constructor Called as a Function
      • Boolean()
    • The Boolean Constructor
      • new Boolean()
  • Number Objects
    • The Number Constructor Called as a Function
      • Number(value)
      • Number()
      • Number([ value ])
    • The Number Constructor
      • new Number(value)
      • new Number()
      • new Number([ value ])
    • Properties of the Number Prototype Object
      • Number.prototype.toLocaleString()
      • Number.prototype.toFixed(fractionDigits)
      • Number.prototype.toExponential(fractionDigits)
      • Number.prototype.toPrecision(precision)
  • The Math Object
    • Function Properties of the Math Object
      • Math.max(x, y)
      • Math.min(x, y)
      • Math.max([ value1 [ , value2 [ , … ] ] ])
      • Math.min([ value1 [ , value2 [ , … ] ] ])
  • Date Objects
    • The Date Constructor Called As a Function
      • Date(year, month, date, hours, minutes, seconds, ms)
      • Date(year, month, date, hours, minutes, seconds)
      • Date(year, month, date, hours, minutes)
      • Date(year, month, date, hours)
      • Date(year, month, day)
      • Date(year, month)
      • Date(value)
      • Date()
      • Date([ year [, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] ] ])
    • The Date Constructor
      • new Date(year, month, date, hours, minutes, seconds, ms)
      • new Date(year, month, date, hours, minutes, seconds)
      • new Date(year, month, date, hours, minutes)
      • new Date(year, month, date, hours)
      • new Date(year, month, day)
      • new Date(year, month)
      • new Date(year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ])
    • Properties of the Date Constructor
      • Date.UTC(year, month, date, hours, minutes, seconds, ms)
      • Date.UTC(year, month, date, hours, minutes, seconds)
      • Date.UTC(year, month, date, hours, minutes)
      • Date.UTC(year, month, date, hours)
      • Date.UTC(year, month, date)
      • Date.UTC(year, month)
      • Date.UTC(year)
      • Date.UTC()
      • Date.UTC(year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ])
    • Properties of the Date Prototype Object
      • Date.prototype.toDateString()
      • Date.prototype.toTimeString()
      • Date.prototype.toLocaleString()
      • Date.prototype.toLocaleDateString()
      • Date.prototype.toLocaleTimeString()
      • Date.prototype.getYear()
      • Date.prototype.setMonth(mon [, date ])
      • Date.prototype.setUTCMonth(mon [, date ])
      • Date.prototype.setMonth(month [, date ])
      • Date.prototype.setUTCMonth(month [, date ])
      • Date.prototype.setYear(year)
      • Date.prototype.toLocaleString()
      • Date.prototype.toGMTString()
  • RegExp(Regular Expression) Objects
    • Patterns
    • Pattern Semantics
      • Notation
      • Pattern
      • Disjunction
      • Alternative
      • Term
      • Assertion
      • Quantifier
      • Atom
      • AtomEscape
      • CharacterEscape
      • DecimalEscape
      • CharacterClassEscape
      • CharacterClass
      • ClassRanges
      • NonemptyClassRanges
      • NonemptyClassRangesNoDash
      • ClassAtom
      • ClassAtomNoDash
      • ClassEscape
    • The RegExp Constructor Called as a Function
      • RegExp(pattern, flags)
    • The RegExp Constructor
      • new RegExp(pattern, flags)
    • Properties of the RegExp Constructor
      • RegExp.prototype
    • Properties of the RegExp Prototype Object
      • RegExp.prototype.constructor
      • RegExp.prototype.exec(string)
      • RegExp.prototype.test(string)
      • RegExp.prototype.toString()
    • Properties of RegExp Instances
      • source
      • global
      • ignoreCase
      • multiline
      • lastIndex
  • Error Objects
    • The Error Constructor Called as a Function
      • Error(message)
    • The Error Constructor
      • new Error(message)
    • Properties of the Error Constructor
      • Error.prototype
    • Properties of the Error Prototype Object
      • Error.prototype.constructor
      • Error.prototype.name
      • Error.prototype.message
      • Error.prototype.toString()
    • Properties of Error Instances
    • Native Error Types Used in This Standard
      • EvalError
      • RangeError
      • ReferenceError
      • SyntaxError
      • TypeError
      • URIError
    • NativeError Object Structure
      • NativeError Constructors Called as Functions
      • NativeError(message)
      • The NativeError Constructors
      • New NativeError(message)
      • Properties of the NativeError Constructors
      • NativeError.prototype
      • Properties of the NativeError Prototype Objects
      • NativeError.prototype.constructor
      • NativeError.prototype.name
      • NativeError.prototype.message
      • Properties of NativeError Instances
16.Errors (ES3)[編集]

ECMAScript 4th Edition(ES4)[編集]

ECMAScriptは、第3版の発表後、 World Wide Web に合わせて大々的に採用され、基本的にすべてのWebブラウザでサポートされるプログラミング言語となりました。ECMAScriptの第4版を開発するために重要な作業が行われました。しかし、その作業は完了せず、ECMAScript第4版として出版されませんでしたが、その一部は第6版の開発に取り入れられました。

バージョン
第4版
発行
リリースに至らず
仕様書
リリースに至らず

After publication of the third edition, ECMAScript achieved massive adoption in conjunction with the World Wide Web where it has become the programming language that is supported by essentially all web browsers. Significant work was done to develop a fourth edition of ECMAScript. However, that work was not completed and not published as the fourth edition of ECMAScript but some of it was incorporated into the development of the sixth edition.


ECMAScriptは、第3版の発表後、WWWに合わせて大々的に採用され、基本的にすべてのWebブラウザでサポートされるプログラミング言語となりました。ECMAScriptの第4版を開発するために重要な作業が行われました。しかし、その作業は完了せず、ECMAScript第4版として出版されませんでしたが、その一部は第6版の開発に取り入れられました。

ECMAScript 5th Edition(ES5)[編集]

第5版は、ブラウザの実装で一般的になっている言語仕様のデファクトスタンダードな解釈を成文化したもので、第3版の発表以降に登場した新機能をサポートしています。 第5版は、2009年12月のEcma総会で採択されました。 第5版は、ISO/IEC JTC 1に提出され、ファストトラック方式で採択され、国際規格ISO/IEC 16262:2011として承認されました。

バージョン
第5版
発行
2009 年 12 月
仕様書
https://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262%205th%20edition%20December%202009.pdf

概要[編集]

  • アクセサ・プロパティ
  • オブジェクトの反射的な生成・検査
  • プロパティ属性のプログラム制御
  • 配列操作関数の追加
  • JSONオブジェクト・エンコーディング・フォーマットのサポート
  • エラーチェックとプログラム・セキュリティを強化するためのストリクト・モード

  • Object.getPrototypeOf(O)
  • Object.getOwnPropertyDescriptor(O, P)
  • Object.getOwnPropertyNames(O)
  • Object.create(O [, Properties])
  • Object.defineProperty(O, P, Attributes)
  • Object.defineProperties(O, Properties)
  • Object.seal(O)
  • Object.freeze(O)
  • Object.preventExtensions(O)
  • Object.isSealed(O)
  • Object.isFrozen(O)
  • Object.isExtensible(O)
  • Object.keys(O)
  • Function.prototype.bind(thisArg [, arg1 [, arg2, …]])
  • Array.isArray(obj)
  • Array.prototype.indexOf(searchElement [ , fromIndex ])
  • Array.prototype.lastIndexOf(searchElement [ , fromIndex ])
  • Array.prototype.every(callbackfn [ , thisArg ])
  • Array.prototype.some(callbackfn [ , thisArg ])
  • Array.prototype.forEach(callbackfn [ , thisArg ])
  • Array.prototype.map(callbackfn [ , thisArg ])
  • Array.prototype.filter(callbackfn [ , thisArg ])
  • Array.prototype.reduce(callbackfn [ , initialValue ])
  • Array.prototype.reduceRight(callbackfn [ , initialValue ])
  • String.prototype.trim()
  • Number.prototype.toString([ radix ])[3]
  • Date.now()
  • Date.prototype.toISOString()
  • Date.prototype.toJSON(key)
  • JSON.parse()
  • JSON.stringify()
  • Date.now()

Object.getPrototypeOf, Object.getOwnPropertyDescriptor, Object.getOwnPropertyNames, Object.create, Object.defineProperty, Object.defineProperties, Object.seal, Object.freeze, Object.preventExtensions, Object.isSealed, Object.isFrozen, Object.isExtensible, Object.keys, Function.prototype.bind, Array.prototype.indexOf, Array.prototype.lastIndexOf, Array.prototype.every, Array.prototype.some, Array.prototype.forEach, Array.prototype.map, Array.prototype.filter, Array.prototype.reduce, Array.prototype.reduceRight, String.prototype.trim, Date.now, Date.prototype.toISOString, Date.prototype.toJSON.

ES5 Syntactical Changes

  • Property access [ ] on strings
  • Trailing commas in array and object literals
  • Multiline string literals
  • Reserved words as property names

The fifth edition of ECMAScript (published as ECMA-262 5th edition) codified de facto interpretations of the language specification that have become common among browser implementations and added support for new features that had emerged since the publication of the third edition. Such features include accessor properties, reflective creation and inspection of objects, program control of property attributes, additional array manipulation functions, support for the JSON object encoding format, and a strict mode that provides enhanced error checking and program security. The fifth edition was adopted by the Ecma General Assembly of December 2009.


ECMAScriptの第5版(ECMA-262 5th edition)は、ブラウザの実装で一般的になっている言語仕様のデファクトスタンダードな解釈を成文化したもので、第3版の発表以降に登場した新機能をサポートしています。具体的には、アクセサ・プロパティ、オブジェクトの反射的な生成・検査、プロパティ属性のプログラム制御、配列操作関数の追加、JSONオブジェクト・エンコーディング・フォーマットのサポート、エラーチェックとプログラム・セキュリティを強化するためのストリクト・モードなどがある。第5版は、2009年12月のEcma総会で採択されました。


Annex E (informative) Additions and Changes in the 5th Edition that Introduce Incompatibilities with the 3rd Edition 7.1: Unicode format control characters are no longer stripped from ECMAScript source text before processing. In Edition 5, if such a character appears in a StringLiteral or RegularExpressionLiteral the character will be incorporated into the literal where in Edition 3 the character would not be incorporated into the literal. 7.2: Unicode character <BOM> is now treated as whitespace and its presence in the middle of what appears to be an identifier could result in a syntax error which would not have occurred in Edition 3 7.3: Line terminator characters that are preceded by an escape sequence are now allowed within a string literal token. In Edition 3 a syntax error would have been produced. 7.8.5: Regular expression literals now return a unique object each time the literal is evaluated. This change is detectable by any programs that test the object identity of such literal values or that are sensitive to the shared side effects. 7.8.5: Edition 5 requires early reporting of any possible RegExp constructor errors that would be produced when converting a RegularExpressionLiteral to a RegExp object. Prior to Edition 5 implementations were permitted to defer the reporting of such errors until the actual execution time creation of the object. 7.8.5: In Edition 5 unescaped “/” characters may appear as a CharacterClass in a regular expression literal. In Edition 3 such a character would have been interpreted as the final character of the literal. 10.4.2: In Edition 5, indirect calls to the eval function use the global environment as both the variable environment and lexical environment for the eval code. In Edition 3, the variable and lexical environments of the caller of an indirect eval was used as the environments for the eval code. 15.4.4: In Edition 5 all methods of Array.prototype are intentionally generic. In Edition 3 toString and toLocaleString were not generic and would throw a TypeError exception if applied to objects that were not instances of Array. 10.6: In Edition 5 the array indexed properties of argument objects that correspond to actual formal parameters are enumerable. In Edition 3, such properties were not enumerable. 10.6: In Edition 5 the value of the Class internal property of an arguments object is "Arguments". In Edition 3, it was "Object". This is observable if toString is called as a method of an arguments object. 12.6.4: for-in statements no longer throw a TypeError if the in expression evaluates to null or undefined. Instead, the statement behaves as if the value of the expression was an object with no enumerable properties. 15: In Edition 5, the following new properties are defined on built-in objects that exist in Edition 3: Object.getPrototypeOf, Object.getOwnPropertyDescriptor, Object.getOwnPropertyNames, Object.create, Object.defineProperty, Object.defineProperties, Object.seal, Object.freeze, Object.preventExtensions, Object.isSealed, Object.isFrozen, Object.isExtensible, Object.keys, Function.prototype.bind, Array.prototype.indexOf, Array.prototype.lastIndexOf, Array.prototype.every, Array.prototype.some, Array.prototype.forEach, Array.prototype.map, Array.prototype.filter, Array.prototype.reduce, Array.prototype.reduceRight, String.prototype.trim, Date.now, Date.prototype.toISOString, Date.prototype.toJSON. 15: Implementations are now required to ignore extra arguments to standard built-in methods unless otherwise explicitly specified. In Edition 3 the handling of extra arguments was unspecified and implementations were explicitly allowed to throw a TypeError exception. 15.1.1: The value properties NaN, Infinity, and undefined of the Global Object have been changed to be read-only properties. 15.1.2.1. Implementations are no longer permitted to restrict the use of eval in ways that are not a direct call. In addition, any invocation of eval that is not a direct call uses the global environment as its variable environment rather than the caller’s variable environment. 15.1.2.2: The specification of the function parseInt no longer allows implementations to treat Strings beginning with a 0 character as octal values. 15.3.4.3: In Edition 3, a TypeError is thrown if the second argument passed to Function.prototype.apply is neither an array object nor an arguments object. In Edition 5, the second argument may be any kind of generic array-like object that has a valid length property. 15.3.4.3, 15.3.4.4: In Edition 3 passing undefined or null as the first argument to either Function.prototype.apply or Function.prototype.call causes the global object to be passed to the indirectly invoked target function as the this value. If the first argument is a primitive value the result of calling ToObject on the primitive value is passed as the this value. In Edition 5, these transformations are not performed and the actual first argument value is passed as the this value. This difference will normally be unobservable to existing ECMAScript Edition 3 code because a corresponding transformation takes place upon activation of the target function. However, depending upon the implementation, this difference may be observable by host object functions called using apply or call. In addition, invoking a standard built-in function in this manner with null or undefined passed as the this value will in many cases cause behaviour in Edition 5 implementations that differ from Edition 3 behaviour. In particular, in Edition 5 built-in functions that are specified to actually use the passed this value as an object typically throw a TypeError exception if passed null or undefined as the this value. 15.3.5.2: In Edition 5, the prototype property of Function instances is not enumerable. In Edition 3, this property was enumerable. 15.5.5.2: In Edition 5, the individual characters of a String object’s [[PrimitiveValue] may be accessed as array indexed properties of the String object. These properties are non-writable and non-configurable and shadow any inherited properties with the same names. In Edition 3, these properties did not exist and ECMAScript code could dynamically add and remove writable properties with such names and could access inherited properties with such names. 15.9.4.2: Date.parse is now required to first attempt to parse its argument as an ISO format string. Programs that use this format but depended upon implementation specific behaviour (including failure) may behave differently. 15.10.2.12: In Edition 5, \s now additionally matches <BOM>. 15.10.4.1: In Edition 3, the exact form of the String value of the source property of an object created by the RegExp constructor is implementation defined. In Edition 5, the String must conform to certain specified requirements and hence may be different from that produced by an Edition 3 implementation. 15.10.6.4: In Edition 3, the result of RegExp.prototype.toString need not be derived from the value of the RegExp object’s source property. In Edition 5 the result must be derived from the source property in a specified manner and hence may be different from the result produced by an Edition 3 implementation. 15.11.2.1, 15.11.4.3: In Edition 5, if an initial value for the message property of an Error object is not specified via the Error constructor the initial value of the property is the empty String. In Edition 3, such an initial value is implementation defined. 15.11.4.4: In Edition 3, the result of Error.prototype.toString is implementation defined. In Edition 5, the result is fully specified and hence may differ from some Edition 3 implementations. 15.12: In Edition 5, the name JSON is defined in the global environment. In Edition 3, testing for the presence of that name will show it to be undefined unless it is defined by the program or implementation.


附属書E (informative) 第5版の追加・変更点 第3版との非互換性を導入するもの 7.1: Unicode形式の制御文字は、ECMAScriptのソーステキストから処理前に取り除かれなくなった。 第 5 版では、このような文字が StringLiteral または RegularExpressionLiteral に含まれる場合、その文字はリテラルに組み込まれます。 Edition 5 では、このような文字が StringLiteral または RegularExpressionLiteral に含まれる場合、その文字はリテラルに組み込まれます。 7.2: Unicode 文字 <BOM> がホワイトスペースとして扱われるようになり、識別子と思われるものの中に存在すると 識別子の途中に存在すると、Edition 3では発生しなかった構文エラーが発生する可能性があります。 7.3: エスケープシーケンスに先行する改行文字が、文字列リテラルトークン内で許容されるようになりました。 文字列リテラルトークン内で許容されるようになりました。Edition 3 ではシンタックスエラーが発生していました。 7.8.5: 正規表現リテラルは、リテラルが評価されるたびに一意のオブジェクトを返すようになりました。 副作用に敏感なプログラムであれば、この変更を検知することができます。 7.8.5: Edition 5 では、RegularExpressionLiter の変換時に発生する可能性のある RegExp コンストラクタのエラーを早期に報告する必要があります。 7.8.5: Edition 5では、RegularExpressionLiteralをRegExpオブジェクトに変換する際に発生する可能性のあるRegExpコンストラクタのエラーを早期に報告する必要がある。Edition 5以前の実装では 7.8.5: Edition 5 では、RegularExpressionLiteral から RegExp オブジェクトへの変換時に発生する RegExp コンストラクタのエラーを早期に報告することが求められている。 7.8.5: Edition 5では、エスケープされていない「/」文字が正規表現リテラルのCharacterClassとして現れることがあります。エディション3では Edition 3 では、このような文字はリテラルの最後の文字として解釈されていた。 10.4.2: 10.4.2: エディション5では、eval関数の間接的な呼び出しは、グローバル環境を、変数環境と語彙環境の両方として使用する。 環境と,evalコードのための字句環境の両方として使用する。エディション3では、間接的なevalの呼び出し元の変数環境と字句環境は 間接的な eval の呼び出し元の変数環境と字句環境が eval コードの環境として使用されます。 15.4.4: Edition 5ではArray.prototypeのすべてのメソッドが意図的にジェネリックになっている。エディション 3 では、toString および toLocaleString は汎用的ではなく、Array.prototype のインスタンスではないオブジェクトに適用すると TypeError 例外が発生しました。 Arrayのインスタンスではないオブジェクトに適用されると、TypeError例外が発生します。 10.6: 第 5 版では、実際の正式なパラメータに対応する引数オブジェクトの配列インデックス付きプロパティは、列挙可能です。 パラメーターに対応する引数オブジェクトの配列インデックス付きプロパティが列挙可能になりました。Edition 3では、このようなプロパティは列挙できませんでした。 10.6:第5版では、引数オブジェクトのClass内部プロパティの値は "Arguments "である。エディション3では Edition 3では "Object "でした。これは、引数オブジェクトのメソッドとしてtoStringが呼び出された場合に観測できる。 12.6.4: for-in 文は、in 式が null または undefined と評価されても、TypeError を発生させなくなりました。 代わりに、ステートメントは式の値が列挙可能なプロパティを持たないオブジェクトであるかのように動作します。 15: Edition 5では、Edition 3に存在する組み込みオブジェクトに以下の新しいプロパティが定義されました。 Object.getPrototypeOf, Object.getOwnPropertyDescriptor, Object.getOwnPropertyNames, Object.create, Object.defineProperty, Object.defineProperties, Object.seal, Object.freeze, Object.preventExtensions, Object.isSealed, Object.isFrozen, Object.isExtensible, Object.keys, Function.prototype.bind, Array.prototype.indexOf, Array.prototype.lastIndexOf, Array.prototype.every, Array.prototype.some, Array.prototype.forEach、Array.prototype.map、Array.prototype.filter, Array.prototype.reduce、Array.prototype.reduceRight、String.prototype.trim、Date.now, Date.prototype.toISOString、Date.prototype.toJSON. 15: 実装は、他に明示的に指定されていない限り、標準的な組み込みメソッドへの追加の引数を無視することが要求されるようになりました。 明示的に指定されていない限り、標準の組み込みメソッドに追加の引数を無視するようになりました。第3版では、追加の引数の扱いは指定されておらず 実装は明示的に TypeError 例外を投げることが許されていました。 15.1.1: 15.1.1: グローバルオブジェクトの値のプロパティである NaN, Infinity, undefined が、読み取り専用のプロパティに変更されました。 読み込み専用のプロパティに変更されました。 15.1.2.1. 15.1.2.1. 実装では eval の使用を直接呼び出しではない方法で制限することはできなくなりました。 また,直接呼び出しではない eval の呼び出しは,呼び出し元の変数環境ではなく,グローバル環境を変数環境として使用します. 環境として使用します......呼び出し側の変数環境ではなく......。 15.1.2.2: 15.1.2.2: 関数 parseInt の仕様では、0 で始まる文字列を 8 進数として扱うことはできません。 を8進数の値として扱うことができなくなりました。 15.3.4.3: エディション3では、Function.prototype.applyに渡された第二引数がAnnualでない場合、TypeErrorが発生します。 Edition 3 では、Function.prototype.apply に渡される第 2 引数が、配列オブジェクトでも引数オブジェクトでもない場合、TypeError が発生しました。第5版では、第2引数の 第二引数は、有効な長さのプロパティを持つあらゆる種類の一般的な配列のようなオブジェクトであることができます。 15.3.4.3, 15.3.4.4: Edition 3 では、Function.prototype.apply または Function.prototype.call の第一引数に undefined または null を渡すと、グローバルオブジェクトが Function.prototype.applyまたはFunction.prototype.callの第1引数にundefinedまたはnullを渡すと、グローバルオブジェクトがthis値として 間接的に呼び出されるターゲット関数にこの値として渡されます。第1引数がプリミティブな値の場合、プリミティブな値に対してToObjectを呼び出した結果は プリミティブ値でToObjectを呼び出した結果がthis値として渡されます。Edition 5では、これらの変換は行われません。 実際の第一引数の値がthis値として渡されます。この違いは、通常 ECMAScript Edition 3 の既存のコードでは、ターゲット関数の起動時に対応する変換が行われるため ターゲット関数の起動時に対応する変換が行われるため、この違いは通常、既存のECMAScript Edition 3のコードでは観察できない。しかし、実装によっては、この違いが ホストオブジェクトの関数が apply や call を使って呼び出された場合には、この違いを観察することができます。また、標準的な組み込み関数をこのような方法でNULLやUNDERで呼び出すと さらに、標準的な組み込み関数を、nullまたはundefinedをthis値として渡してこの方法で呼び出すと、多くの場合、Edition 5の実装では、Edition 5とは異なる動作が発生します。 多くの場合、Edition 5の実装では、Edition 3の動作とは異なる動作が発生します。特に、Edition 5の組み込み関数では オブジェクトとして渡されたthis値を実際に使用するように指定されているEdition 5の組み込み関数は、this値としてnullやundefinedが渡された場合、通常TypeError例外をスローします。 この値としてnullまたはundefinedが渡された場合、TypeError例外が発生します。 15.3.5.2: Edition 5では、Functionインスタンスのprototypeプロパティが列挙可能ではありません。エディション3では、この プロパティは列挙可能でした。 15.5.5.2: Edition 5では、StringオブジェクトのPrimitiveValueの個々の文字には、Stringオブジェクトの配列 StringオブジェクトのPrimitiveValueの個々の文字は、Stringオブジェクトの配列としてアクセスすることができる。これらのプロパティは書き換えや設定ができず、同じ名前の継承されたプロパティは影に隠れてしまいます。 同じ名前の継承されたプロパティを影で支えています。エディション3では、これらのプロパティは存在せず、ECMAScript ECMAScript のコードは、このような名前の書き込み可能なプロパティを動的に追加・削除したり、このような名前の継承された プロパティにアクセスすることができる。 15.9.4.2: 15.9.4.2: Date.parse は、引数を ISO 形式の文字列として最初に解析することが必要になりました。 この形式を使用していても、実装特有の動作(失敗を含む)に依存していたプログラムは、異なる動作をするかもしれません。 このフォーマットを使用するプログラムが、実装特有の動作(失敗を含む)に依存している場合、異なる動作をすることがあります。 15.10.2.12: エディション5では、<BOM>にもマッチするようになりました。 15.10.4.1: 15.10.4.1: 第 3 版では、RegExp コンストラクタによって生成されたオブジェクトの source プロパティの String 値の正確な形式は、実装で定義される。 15.10.4.1: 第3版では,RegExp コンストラクタによって生成されたオブジェクトの source プロパティの String 値の正確な形式は,実装で定義されている。15.10.4.1: 第3版では、RegExpコンストラクタで生成されたオブジェクトのソースプロパティの文字列値の正確な形式は、実装で定義される。 そのため、第 3 版の実装で生成されたものとは異なる可能性がある。 15.10.6.4: Edition 3 では、RegExp.prototype.toString の結果は、RegExp オブジェクトの source プロパティの値から派生する必要はありません。 RegExp オブジェクトの source プロパティの値から派生する必要はありません。第 5 版では、結果は指定された方法でソース プロパティに由来する必要があります。 そのため、Edition 3 の実装で生成される結果とは異なる可能性がある。 15.11.2.1, 15.11.4.3: Edition 5では、Errorオブジェクトのmessageプロパティの初期値がErrorコンストラクタで指定されていない場合は 15.11.2.1 15.11.4.3: Edition 5 では、Error オブジェクトの message プロパティの初期値が Error コンストラクタで指定されていない場合、プロパティの初期値は空の String となる。エディション3では、このような初期値は実装で定義されています。 15.11.4.4: 第 3 版では、Error.prototype.toString の結果は、実装で定義されている。第 5 版では。 15.11.4.4: Edition 3 では、Error.prototype.toString の結果は実装で定義される。 15.12:Edition 5 では、JSON という名称がグローバル環境で定義されている。Edition 3では、その名前の存在をテストすると、プログラムや実装で定義されていない限り、未定義であることが示される。

変更点 (ES5)[編集]

表記方法 (ES5)[編集]
語彙規約 (ES5)[編集]
文 (ES5)[編集]
ECMAScript ネイティブオブジェクト (ES5)[編集]

標準の章立てに従った分類(ES5)[編集]

1.Scope (ES5)[編集]
2.Conformance (ES5)[編集]
4.Overview (ES5)[編集]
  • Language Overview
    • The Strict Variant of ECMAScript
5.Notational Conventions (ES5)[編集]
  • Syntactic and Lexical Grammars
    • The JSON Grammar
6.Source Text (ES5)[編集]
7.Lexical Conventions (ES5)[編集]
  • Tokens
  • Identifier Names and Identifiers
  • Identifiers
8.Types (ES5)[編集]
  • The Object Type
    • Internal Properties and Methods
  • The Reference Type
    • Object Internal Properties and Methods
  • The Reference Specification Type
    • GetValue(V)
    • PutValue(V, W)
  • The List Type
  • The Completion Type
  • The List Specification Type
  • The Completion Specification Type
  • The Property Descriptor and Property Identifier Specification Types
    • IsAccessorDescriptor(Desc)
    • IsDataDescriptor(Desc)
    • IsGenericDescriptor(Desc)
    • FromPropertyDescriptor(Desc)
    • ToPropertyDescriptor(Obj)
  • Algorithms for Object Internal Methods
  • CheckObjectCoercible
  • IsCallable
  • The SameValue Algorithm
  • Types of Executable Code
    • Strict Mode Code
  • Lexical Environments
    • Environment Records
      • Declarative Environment Records
        • HasBinding(N)
        • CreateMutableBinding(N, D)
        • SetMutableBinding(N,V,S)
        • GetBindingValue(N,S)
        • DeleteBinding(N)
        • ImplicitThisValue()
        • CreateImmutableBinding(N)
        • InitializeImmutableBinding(N,V)
      • Object Environment Records
        • HasBinding(N)
        • CreateMutableBinding(N, D)
        • SetMutableBinding(N,V,S)
        • GetBindingValue(N,S)
        • DeleteBinding(N)
        • ImplicitThisValue()
    • Lexical Environment Operations
      • GetIdentifierReference(lex, name, strict)
      • NewDeclarativeEnvironment(E)
      • NewObjectEnvironment(O, E)
    • The Global Environment
  • Execution Contexts
    • Identifier Resolution
  • Establishing an Execution Context
    • Entering Global Code
      • Initial Global Execution Context
    • Entering Eval Code
      • Strict Mode Restrictions
    • Entering Function Code
  • Declaration Binding Instantiation
  • Arguments Object
11.Expressions (ES5)[編集]
  • Additive Operators
    • Applying the Additive Operators(+,-) to Numbers
    • Applying the Additive Operators to Numbers
12.Statements (ES5)[編集]
  • Variable statement
    • Strict Mode Restrictions
  • The with Statement
    • Strict Mode Restrictions
  • The try statement
    • Strict Mode Restrictions
  • The debugger statement
13.Function Definition (ES5)[編集]
  • Definitions
    • Equated Grammar Productions
    • Joined Objects
  • Strict Mode Restrictions
  • Creating Function Objects
14.Program (ES5)[編集]
  • Directive Prologues and the Use Strict Directive
  • The Global Object
    • Function Properties of the Global Object
      • eval(x)
        • Direct Call to Eval
      • Math
      • JSON
  • Object Objects
    • Properties of the Object Constructor
      • Object.getPrototypeOf(O)
      • Object.getOwnPropertyDescriptor(O, P)
      • Object.getOwnPropertyNames(O)
      • Object.create(O [, Properties])
      • Object.defineProperty(O, P, Attributes)
      • Object.defineProperties(O, Properties)
      • Object.seal(O)
      • Object.freeze(O)
      • Object.preventExtensions(O)
      • Object.isSealed(O)
      • Object.isFrozen(O)
      • Object.isExtensible(O)
      • Object.keys(O)
  • Function Objects
    • Properties of the Function Constructor
      • Function.length
    • Properties of the Function Prototype Object
      • Function.prototype.bind(thisArg [, arg1 [, arg2, …]])
  • Array Objects
    • Properties of the Array Constructor
      • Array.isArray(arg)
    • Properties of the Array Prototype Object
      • Array.prototype.indexOf(searchElement [ , fromIndex ])
      • Array.prototype.lastIndexOf(searchElement [ , fromIndex ])
      • Array.prototype.every(callbackfn [ , thisArg ])
      • Array.prototype.some(callbackfn [ , thisArg ])
      • Array.prototype.forEach(callbackfn [ , thisArg ])
      • Array.prototype.map(callbackfn [ , thisArg ])
      • Array.prototype.filter(callbackfn [ , thisArg ])
      • Array.prototype.reduce(callbackfn [ , initialValue ])
      • Array.prototype.reduceRight(callbackfn [ , initialValue ])
  • String Objects
    • Properties of the String Prototype Object
      • String.prototype.trim()
  • Boolean Objects
    • The Boolean Constructor Called as a Function
      • Boolean(value)
    • The Boolean Constructor
      • new Boolean(value)
    • Properties of the Boolean Constructor
      • Boolean.prototype
    • Properties of the Boolean Prototype Object
      • Boolean.prototype.constructor
      • Boolean.prototype.toString()
      • Boolean.prototype.valueOf()
    • Properties of Boolean Instances
  • Number Objects
    • Properties of the Number Prototype Object
      • Number.prototype.toString(radix)
      • Number.prototype.toString([ radix ])
  • Date Objects
    • Overview of Date Objects and Definitions of Internal Operators
    • Overview of Date Objects and Definitions of Abstract Operators
      • Time Range
      • Time Values and Time Range
      • Date Time String Format
        • Extended years
    • Properties of the Date Constructor
      • Date.now()
    • Properties of the Date Prototype Object
      • Date.prototype.toISOString()
      • Date.prototype.toJSON(key)
  • The JSON Object
    • The JSON Grammar
      • The JSON Lexical Grammar
      • The JSON Syntactic Grammar
    • parse(text [ , reviver ])
    • stringify(value [ , replacer [ , space ] ])
16.Errors (ES5)[編集]

ECMAScript 5.1th Edition(ES5.1)[編集]

第5.1版には細かい修正が加えられ、ISO/IEC 16262:2011と同じ文章になっています。5.1版は2011年6月のEcma総会で採択されました。

バージョン
第5.1版
発行
2011 年 6 月
ISO/IEC
ISO/IEC 16262:2011 第 3 版
仕様書
https://www.ecma-international.org/ecma-262/5.1/

The fifth edition was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved as international standard ISO/IEC 16262:2011. Edition 5.1 of the ECMAScript Standard incorporated minor corrections and is the same text as ISO/IEC 16262:2011. The 5.1 Edition was adopted by the Ecma General Assembly of June 2011.


また、この第5版は、ISO/IEC JTC 1に提出され、ファストトラック方式で採択され、国際規格ISO/IEC 16262:2011として承認されました。

ECMAScript 6th Edition(ES6/ES2015)[編集]

第6版の開発は、第5版の出版準備中である2009年に集中的に開始されました。しかし、これに先立ち、1999年に第3版を出版したときから、実験と言語強化のための設計を行ってきました。 第6版の完成は、ある意味、15年にわたる取り組みの集大成とも言えます。 第6版では、大規模なアプリケーションのサポート、ライブラリの作成、他の言語のコンパイルターゲットとしてのECMAScriptの使用などを目標としました。 モジュール、クラス宣言、レキシカルブロックスコーピング、イテレータとジェネレータ、非同期プログラミングのためのプロミス、デストラクションパターン、適切なテールコールなどが主な改良点です。ビルドインのECMAScriptライブラリが拡張され、マップ、セット、2進数値の配列などのデータ抽象化に加え、文字列や正規表現におけるUnicode補助文字のサポートが追加されました。 また、ビルドインはサブクラス化により拡張可能になりました。 第6版は、言語やライブラリを定期的かつ段階的に拡張するための基盤となるものです。 第6版は、2015年6月の総会で採択されました。

バージョン
第6版
発行
2015 年 6 月
仕様書
https://www.ecma-international.org/ecma-262/6.0/
註記
この版から毎年リリースになる

ES6の新機能

  • 予約語 let (ブロックスコープな変数)
  • 予約語 const (ブロックスコープでイミュータブルな変数)
  • アロー関数
    • レキシカルなthis
  • 拡張された関数パラメータの扱い
    • デフォルト引数
    • レストパラメータ
    • スプレッド構文
  • テンプレートリテラル
    • 埋め込まれた式の展開
    • Raw String Access
  • 正規表現の拡張
    • Regular Expression Sticky Matching
  • オブジェクトのプロパティへのアクセス改善
    • Property Shorthand -> var x = 0, y = 0;obj = { x, y };
    • Computed Property Names -> let key="abc"、obj = { a:1, [key] = "board" };
    • Method Properties -> obj = { foo (a, b) { … }, bar (x, y) { … } };
  • Method Properties
  • 分割代入
    • 配列
    • オブジェクト
    • より深いオブジェクト
    • 既定値(オブジェクト及び配列)
    • 引数コンテキスト(オブジェクト及び配列)
    • フェイルソフトデストラクション
  • ECMACScript Module
    • JavaScript Modules
  • 予約語 class とその構文;定義 継承 拡張 基底クラスアクセス 静的メンバー ゲッター・セッター
  • Symbolオブジェクト
    • シンボル型
    • グローバルシンボル
  • イテレータ
    • 新しい for-of文
  • ジェネレター
    • ジェネレター関数、イテレータプロトコル
    • ジェネレター関数の直喩的評価
    • ジェネレターマッチング
    • 制御フロー
    • ジェネレーターメソッド
  • Map・Set と WeakMap/WeakSet
    • 集合のデータ構造
    • マップのデータ構造
    • 弱いリンクのデータ構造
  • 型付き配列
    • 多種
  • 新しい組み込みメソッド
    • Object.assign()
    • Array Element Finding
    • Array.prototype.find()
    • Array.prototype.findIndex()
    • String Repeating
    • String Searching
    • Number Type Checking
    • Number Safety Checking
    • Number Comparison
    • Number Truncation
    • Number Sign Determination
  • ---
    • New Math Methods
    • New Number Properties
    • New Number Methods
    • New Global Methods
  • Promiseオブジェクト
    • Promise Usage
    • Promise Combination
  • Meta-Programming
    • Proxying
    • Reflection
  • Internationalization & Localization
    • Collation
    • Number Formatting
    • Currency Formatting
    • Date/Time Formatting

Focused development of the sixth edition started in 2009, as the fifth edition was being prepared for publication. However, this was preceded by significant experimentation and language enhancement design efforts dating to the publication of the third edition in 1999. In a very real sense, the completion of the sixth edition is the culmination of a fifteen year effort. The goals for this edition included providing better support for large applications, library creation, and for use of ECMAScript as a compilation target for other languages. Some of its major enhancements included modules, class declarations, lexical block scoping, iterators and generators, promises for asynchronous programming, destructuring patterns, and proper tail calls. The ECMAScript library of built-ins was expanded to support additional data abstractions including maps, sets, and arrays of binary numeric values as well as additional support for Unicode supplemental characters in strings and regular expressions. The built-ins were also made extensible via subclassing. The sixth edition provides the foundation for regular, incremental language and library enhancements. The sixth edition was adopted by the General Assembly of June 2015.


第6版の開発は、第5版の出版準備中である2009年に集中的に開始されました。しかし、これに先立ち、1999年に第3版を出版したときから、実験と言語強化のための設計を行ってきました。第6版の完成は、ある意味、15年にわたる取り組みの集大成とも言えます。第6版では、大規模なアプリケーションのサポート、ライブラリの作成、他の言語のコンパイルターゲットとしてのECMAScriptの使用などを目標としました。モジュール、クラス宣言、レキシカルブロックスコーピング、イテレータとジェネレータ、非同期プログラミングのためのプロミス、デストラクションパターン、適切なテールコールなどが主な改良点です。ビルドインのECMAScriptライブラリが拡張され、マップ、セット、2進数値の配列などのデータ抽象化に加え、文字列や正規表現におけるUnicode補助文字のサポートが追加されました。また、ビルドインはサブクラス化により拡張可能になりました。第6版は、言語やライブラリを定期的かつ段階的に拡張するための基盤となるものです。第6版は、2015年6月の総会で採択されました。

変更点 (ES6)[編集]

表記方法 (ES6)[編集]
語彙規約 (ES6)[編集]
文 (ES6)[編集]
ECMAScript ネイティブオブジェクト (ES6)[編集]

標準の章立てに従った分類(ES6)[編集]

ECMAScript 7th Edition(ES7/ES2016)[編集]

ECMAScript 2016は、Ecma TC39の新しい年1回のリリースサイクルとオープンな開発プロセスの下でリリースされた最初のECMAScript版です。 ECMAScript 2015のソース文書から平文のソース文書が作成され、GitHub上で開発が進められました。 本規格の開発期間中には、何百ものプルリクエストや課題が提出され、何千ものバグ修正、編集上の修正、その他の改善が行われました。 また、Ecmarkup、Ecmarkdown、Grammarkdownなどのソフトウェアツールが開発され、この作業を支援しました。

バージョン
第7版/2016
発行
2016 年 6 月
仕様書
https://www.ecma-international.org/ecma-262/7.0/

New Features in ECMAScript 2016 This chapter introduces the new features in ECMAScript 2016:

https://www.w3schools.com/js/js_2016.asp

  • 指数演算子 (**)
  • 指数代入演算子 (**=)
  • Array.prototype.includes()

ECMAScript 2016 was the first ECMAScript edition released under Ecma TC39's new yearly release cadence and open development process. A plain-text source document was built from the ECMAScript 2015 source document to serve as the base for further development entirely on GitHub. Over the year of this standard's development, hundreds of pull requests and issues were filed representing thousands of bug fixes, editorial fixes and other improvements. Additionally, numerous software tools were developed to aid in this effort including Ecmarkup, Ecmarkdown, and Grammarkdown. ES2016 also included support for a new exponentiation operator and adds a new method to Array.prototype called includes.


ECMAScript 2016は、Ecma TC39の新しい年1回のリリースサイクルとオープンな開発プロセスの下でリリースされた最初のECMAScript版です。ECMAScript 2015のソース文書から平文のソース文書が作成され、GitHub上で開発が進められました。本規格の開発期間中には、何百ものプルリクエストや課題が提出され、何千ものバグ修正、編集上の修正、その他の改善が行われました。また、Ecmarkup、Ecmarkdown、Grammarkdownなどのソフトウェアツールが開発され、この作業を支援しました。また、ES2016では、新しい指数演算子がサポートされ、Array.prototypeにincludesという新しいメソッドが追加されました。

ECMAScript 8th Edition(ES8/ES2017)[編集]

ECMAScript 2017では、非同期関数、共有メモリ、アトミックが導入されたほか、言語やライブラリの機能強化、バグ修正、編集部の更新が行われました。 非同期関数は、プロミスを返す関数の構文を提供することで、非同期プログラミングの利便性を向上させます。 Shared MemoryとAtomicsは、マルチエージェントプログラムが、並列CPU上でも明確な実行順序を保証するアトミック操作を用いて通信できるようにする、新しいメモリモデルを導入しています。 また、Object.Value、Object.Entries、Object.Entriesの新しいスタティック・メソッドが追加されました。 Object.values、Object.entries、Object.getOwnPropertyDescriptorsです。

バージョン
第8版/2017
発行
2017 年 6 月
仕様書
https://www.ecma-international.org/ecma-262/8.0/

https://www.w3schools.com/js/js_2017.asp

New Features in ECMAScript 2017 This chapter introduces the new features in ECMAScript 2017:

ECMAScript 2017 introduced Async Functions, Shared Memory, and Atomics along with smaller language and library enhancements, bug fixes, and editorial updates. Async functions improve the asynchronous programming experience by providing syntax for promise-returning functions. Shared Memory and Atomics introduce a new memory model that allows multi-agent programs to communicate using atomic operations that ensure a well-defined execution order even on parallel CPUs. It also included new static methods on Object: Object.values, Object.entries, and Object.getOwnPropertyDescriptors.


ECMAScript 2017では、非同期関数、共有メモリ、アトミックが導入されたほか、言語やライブラリの機能強化、バグ修正、編集部の更新が行われました。非同期関数は、プロミスを返す関数の構文を提供することで、非同期プログラミングの利便性を向上させます。Shared MemoryとAtomicsは、マルチエージェントプログラムが、並列CPU上でも明確な実行順序を保証するアトミック操作を用いて通信できるようにする、新しいメモリモデルを導入しています。また、Object.Value、Object.Entries、Object.Entriesの新しいスタティック・メソッドが追加されました。Object.values、Object.entries、Object.getOwnPropertyDescriptorsです。

ECMAScript 9th Edition(ES9/ES2018)[編集]

ECMAScript 2018では、AsyncIteratorプロトコルと非同期ジェネレータによる非同期反復のサポートが導入されました。 また、dotAll フラグ、名前付きキャプチャグループ、Unicode プロパティエスケープ、および look-behind アサーションという 4 つの新しい正規表現機能が追加されました。 最後に、オブジェクトレストとスプレッドプロパティが追加されました。

バージョン
第9版/2018
発行
2018 年 6 月
仕様書
https://www.ecma-international.org/ecma-262/9.0/

https://www.w3schools.com/js/js_2018.asp

New Features in ECMAScript 2018 This chapter introduces the new features in ECMAScript 2018:

  • Asynchronous Iteration
    • AsyncIteratorプロトコルと非同期ジェネレータによる非同期反復のサポートが導入されました。
  • Promise Finally
  • Object Rest Properties
    • オブジェクトレストとスプレッドプロパティが追加されました。
  • New RegExp Features
    • dotAll フラグ、名前付きキャプチャグループ、Unicode プロパティエスケープ、および look-behind アサーションという 4 つの新しい正規表現機能が追加されました。

ECMAScript 2018 introduced support for asynchronous iteration via the AsyncIterator protocol and async generators. It also included four new regular expression features: the dotAll flag, named capture groups, Unicode property escapes, and look-behind assertions. Lastly it included object rest and spread properties.


ECMAScript 2018では、AsyncIteratorプロトコルと非同期ジェネレータによる非同期反復のサポートが導入されました。また、dotAll フラグ、名前付きキャプチャグループ、Unicode プロパティエスケープ、および look-behind アサーションという 4 つの新しい正規表現機能が追加されました。最後に、オブジェクトレストとスプレッドプロパティが追加されました。

ECMAScript 10th Edition(ES10/ES2019)[編集]

ECMAScript 2019 では、いくつかの新しい組み込み関数が導入されました。 配列をフラットにする Array.prototype の flat および flatMap、Object.entries の戻り値を新しい Object に直接変換する Object.fromEntries、広く実装されているが標準的ではない String.prototype.trimLeft および trimRight 組み込み関数に代わる、より良い名前の String.prototype の trimStart および trimEnd です。 さらに、構文とセマンティクスに関するいくつかのマイナーな更新も含まれています。 更新された構文には、オプションのキャッチ・バインディング・パラメータや、文字列リテラルのU+2028(LINE SEPARATOR)とU+2029(PARAGRAPH SEPARATOR)をJSONに合わせて許可することなどが含まれます。その他の更新点としては、Array.prototype.sortが安定したソートであること、JSON.stringifyが入力に関わらず整形されたUTF-8を返すこと、Function.prototype.toStringを明確にし、対応するオリジナルのソーステキストか標準のプレースホルダーを返すことを要求しました。

バージョン
第10版/2019
発行
2019 年 6 月
仕様書
https://www.ecma-international.org/ecma-262/10.0/
  • Array.prototype.flat()
  • Array.prototype.flatMap()
  • Object.fromEntries()
  • Object.entries()
  • String.prototype.trimStart()
  • String.prototype.trimEnd()
    • String.prototype.trimLeft and trimRight as alias
  • 文字列リテラルのU+2028(LINE SEPARATOR)とU+2029(PARAGRAPH SEPARATOR)をJSONに合わせて許可
  • try / catch の catch節の(error)が省略可能になった
  • Array.prototype.sortが安定したソートであること
  • JSON.stringifyが入力に関わらず整形されたUTF-8を返す
  • Function.prototype.toStringを明確にし、対応するオリジナルのソーステキストか標準のプレースホルダーを返すことを要求

ECMAScript 2019 introduced a few new built-in functions: flat and flatMap on Array.prototype for flattening arrays, Object.fromEntries for directly turning the return value of Object.entries into a new Object, and trimStart and trimEnd on String.prototype as better-named alternatives to the widely implemented but non-standard String.prototype.trimLeft and trimRight built-ins. In addition, it included a few minor updates to syntax and semantics. Updated syntax included optional catch binding parameters and allowing U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH SEPARATOR) in string literals to align with JSON. Other updates included requiring that Array.prototype.sort be a stable sort, requiring that JSON.stringify return well-formed UTF-8 regardless of input, and clarifying Function.prototype.toString by requiring that it either return the corresponding original source text or a standard placeholder.


ECMAScript 2019 では、いくつかの新しい組み込み関数が導入されました。配列をフラットにする Array.prototype の flat および flatMap、Object.entries の戻り値を新しい Object に直接変換する Object.fromEntries、広く実装されているが標準的ではない String.prototype.trimLeft および trimRight 組み込み関数に代わる、より良い名前の String.prototype の trimStart および trimEnd です。さらに、構文とセマンティクスに関するいくつかのマイナーな更新も含まれています。更新された構文には、オプションのキャッチ・バインディング・パラメータや、文字列リテラルのU+2028(LINE SEPARATOR)とU+2029(PARAGRAPH SEPARATOR)をJSONに合わせて許可することなどが含まれます。その他の更新点としては、Array.prototype.sortが安定したソートであること、JSON.stringifyが入力に関わらず整形されたUTF-8を返すこと、Function.prototype.toStringを明確にし、対応するオリジナルのソーステキストか標準のプレースホルダーを返すことを要求しました。

https://tc39.es/ecma262/#sec-intro

ECMAScript 11st Edition(ES11/ES2020)[編集]

ECMAScript 2020 第 11 版では、グローバルな正規表現で生成されたすべてのマッチオブジェクトのイテレータを生成する、文字列の matchAll メソッドが導入されました。 globalThisはグローバルな this 値にアクセスするための普遍的な方法を提供します。 モジュール内で使用するための 'module' 構文からの専用 export * as ns。 for-in 列挙順序の標準化の強化。 import. さらに、"nullish "な値(null または undefined)の扱いを改善するために、2 つの新しい構文機能が追加されました。 値選択演算子の nullish coalescing と、アクセス/呼び出しする値が nullish である場合に短絡するプロパティアクセスおよび関数呼び出し演算子の optional chaining です。

バージョン
第11版/2020
発行
2020 年 6 月
仕様書
https://www.ecma-international.org/ecma-262/11.0/
  • String.prototype.matchAll()
  • globalThis
  • 'module' 構文からの専用 export * as ns
  • for-in 列挙順序の標準化の強化
  • import.meta
  • オプショナルチェイニング演算子 (?.)
  • null合体演算子(??)

ECMAScript 2020, the 11th edition, introduces the matchAll method for Strings, to produce an iterator for all match objects generated by a global regular expression; import(), a syntax to asynchronously import Modules with a dynamic specifier; BigInt, a new number primitive for working with arbitrary precision integers; Promise.allSettled, a new Promise combinator that does not short-circuit; globalThis, a universal way to access the global this value; dedicated export * as ns from 'module' syntax for use within modules; increased standardization of for-in enumeration order; import.meta, a host-populated object available in Modules that may contain contextual information about the Module; as well as adding two new syntax features to improve working with “nullish” values (null or undefined): nullish coalescing, a value selection operator; and optional chaining, a property access and function invocation operator that short-circuits if the value to access/invoke is nullish.


ECMAScript 2020 第 11 版では、グローバルな正規表現で生成されたすべてのマッチオブジェクトのイテレータを生成する、文字列の matchAll メソッドが導入されました。 globalThis: グローバルな this 値にアクセスするための普遍的な方法; モジュール内で使用するための 'module' 構文からの専用 export * as ns; for-in 列挙順序の標準化の強化; import. さらに、"nullish "な値(null または undefined)の扱いを改善するために、2 つの新しい構文機能が追加されました。値選択演算子の nullish coalescing と、アクセス/呼び出しする値が nullish である場合に短絡するプロパティアクセスおよび関数呼び出し演算子の optional chaining です。

ECMAScript 12nd Edition(ES12/ES2021)[編集]

第12版となるECMAScript 2021では、StringsのreplaceAllメソッド、入力値が満たされたときに短絡的に処理を行うPromiseコンビネーターのPromise.any、複数のエラーを一度に表現するための新しいErrorタイプのAggregateError、論理的な代入演算子(? =, &&=, ||=)、ターゲットオブジェクトをガベージコレクションから保存せずに参照するための WeakRef、ターゲットオブジェクトがガベージコレクションされるときに実行されるクリーンアップ処理の登録と解除を管理する FinalizationRegistry、数値リテラルのセパレータ(1_000)、Array.prototype.sort がより正確になり、実装で定義されたソート順になるケースが減りました。

バージョン
第12版/2021
発行
2021年 6月
仕様書
https://262.ecma-international.org/12.0/
  • Strings.prototype.replaceAll()
  • Promise.any()
  • AggregateError -- 複数のエラーを一度に表現するための新しいErrorタイプ
  • 論理代入演算子(? =, &&=, ||=)
  • WeakRef / FinalizationRegistry -- メモリー管理
  • 数値リテラルのセパレータ(1_000)
  • Array.prototype.sort() がより正確に

ECMAScript 2021, the 12th edition, introduces the replaceAll method for Strings; Promise.any, a Promise combinator that short-circuits when an input value is fulfilled; AggregateError, a new Error type to represent multiple errors at once; logical assignment operators (??=, &&=, ||=); WeakRef, for referring to a target object without preserving it from garbage collection, and FinalizationRegistry, to manage registration and unregistration of cleanup operations performed when target objects are garbage collected; separators for numeric literals (1_000); and Array.prototype.sort was made more precise, reducing the amount of cases that result in an implementation-defined sort order.


第12版となるECMAScript 2021では、StringsのreplaceAllメソッド、入力値が満たされたときに短絡的に処理を行うPromiseコンビネーターのPromise.any、複数のエラーを一度に表現するための新しいErrorタイプのAggregateError、論理的な代入演算子(? =, &&=, ||=)、ターゲットオブジェクトをガベージコレクションから保存せずに参照するための WeakRef、ターゲットオブジェクトがガベージコレクションされるときに実行されるクリーンアップ処理の登録と解除を管理する FinalizationRegistry、数値リテラルのセパレータ(1_000)、Array.prototype.sort がより正確になり、実装で定義されたソート順になるケースが減りました。


ECMAScriptの守備範囲[編集]

言語コア以外:Web API

プロポーザル[編集]

脚注[編集]

  1. ^ ファストトラック方式 -- 新しい技術などの普及に迅速に対応できるよう、審査を優先的に実施し、また簡略化する制度。
  2. ^ JIS X 3060:2000 ECMAScript言語 Information technology -- ECMAScript language specification
  3. ^ 基数がオプションに

外部リンク[編集]