You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h1><span class="secnum">E</span> Corrections and Clarifications in ECMAScript 2015 with Possible Compatibility Impact</h1>
99
-
<p><emu-xref href="#sec-candeclareglobalvar" id="_ref_920"><a href="executable-code-and-execution-contexts.html#sec-candeclareglobalvar">9.1.1.4.15</a></emu-xref>-<emu-xref href="#sec-createglobalfunctionbinding" id="_ref_921"><a href="executable-code-and-execution-contexts.html#sec-createglobalfunctionbinding">9.1.1.4.18</a></emu-xref> Edition 5 and 5.1 used a property existence test to determine whether a <emu-xref href="#sec-global-object" id="_ref_16241"><a href="global-object.html#sec-global-object">global object</a></emu-xref> property corresponding to a new global declaration already existed. ECMAScript 2015 uses an own property existence test. This corresponds to what has been most commonly implemented by web browsers.</p>
100
-
<p><emu-xref href="#sec-array-exotic-objects-defineownproperty-p-desc" id="_ref_922"><a href="ordinary-and-exotic-objects-behaviours.html#sec-array-exotic-objects-defineownproperty-p-desc">10.4.2.1</a></emu-xref>: The 5<sup>th</sup> Edition moved the capture of the current array length prior to the <emu-xref href="#integer" id="_ref_16242"><a href="notational-conventions.html#integer">integer</a></emu-xref> conversion of the <emu-xref href="#array-index" id="_ref_16243"><a href="ecmascript-data-types-and-values.html#array-index">array index</a></emu-xref> or new length value. However, the captured length value could become invalid if the conversion process has the side-effect of changing the array length. ECMAScript 2015 specifies that the current array length must be captured after the possible occurrence of such side-effects.</p>
101
-
<p><emu-xref href="#sec-timeclip" id="_ref_923"><a href="numbers-and-dates.html#sec-timeclip">21.4.1.31</a></emu-xref>: Previous editions permitted the <emu-xref aoid="TimeClip" id="_ref_16244"><a href="numbers-and-dates.html#sec-timeclip">TimeClip</a></emu-xref> abstract operation to return either <emu-val>+0</emu-val><sub>𝔽</sub> or <emu-val>-0</emu-val><sub>𝔽</sub> as the representation of a 0 <emu-xref href="#sec-time-values-and-time-range" id="_ref_16245"><a href="numbers-and-dates.html#sec-time-values-and-time-range">time value</a></emu-xref>. ECMAScript 2015 specifies that <emu-val>+0</emu-val><sub>𝔽</sub> always returned. This means that for ECMAScript 2015 the <emu-xref href="#sec-time-values-and-time-range" id="_ref_16246"><a href="numbers-and-dates.html#sec-time-values-and-time-range">time value</a></emu-xref> of a Date is never observably <emu-val>-0</emu-val><sub>𝔽</sub> and methods that return <emu-xref href="#sec-time-values-and-time-range" id="_ref_16247"><a href="numbers-and-dates.html#sec-time-values-and-time-range">time values</a></emu-xref> never return <emu-val>-0</emu-val><sub>𝔽</sub>.</p>
99
+
<p><emu-xref href="#sec-candeclareglobalvar" id="_ref_920"><a href="executable-code-and-execution-contexts.html#sec-candeclareglobalvar">9.1.1.4.15</a></emu-xref>-<emu-xref href="#sec-createglobalfunctionbinding" id="_ref_921"><a href="executable-code-and-execution-contexts.html#sec-createglobalfunctionbinding">9.1.1.4.18</a></emu-xref> Edition 5 and 5.1 used a property existence test to determine whether a <emu-xref href="#sec-global-object" id="_ref_16237"><a href="global-object.html#sec-global-object">global object</a></emu-xref> property corresponding to a new global declaration already existed. ECMAScript 2015 uses an own property existence test. This corresponds to what has been most commonly implemented by web browsers.</p>
100
+
<p><emu-xref href="#sec-array-exotic-objects-defineownproperty-p-desc" id="_ref_922"><a href="ordinary-and-exotic-objects-behaviours.html#sec-array-exotic-objects-defineownproperty-p-desc">10.4.2.1</a></emu-xref>: The 5<sup>th</sup> Edition moved the capture of the current array length prior to the <emu-xref href="#integer" id="_ref_16238"><a href="notational-conventions.html#integer">integer</a></emu-xref> conversion of the <emu-xref href="#array-index" id="_ref_16239"><a href="ecmascript-data-types-and-values.html#array-index">array index</a></emu-xref> or new length value. However, the captured length value could become invalid if the conversion process has the side-effect of changing the array length. ECMAScript 2015 specifies that the current array length must be captured after the possible occurrence of such side-effects.</p>
101
+
<p><emu-xref href="#sec-timeclip" id="_ref_923"><a href="numbers-and-dates.html#sec-timeclip">21.4.1.31</a></emu-xref>: Previous editions permitted the <emu-xref aoid="TimeClip" id="_ref_16240"><a href="numbers-and-dates.html#sec-timeclip">TimeClip</a></emu-xref> abstract operation to return either <emu-val>+0</emu-val><sub>𝔽</sub> or <emu-val>-0</emu-val><sub>𝔽</sub> as the representation of a 0 <emu-xref href="#sec-time-values-and-time-range" id="_ref_16241"><a href="numbers-and-dates.html#sec-time-values-and-time-range">time value</a></emu-xref>. ECMAScript 2015 specifies that <emu-val>+0</emu-val><sub>𝔽</sub> always returned. This means that for ECMAScript 2015 the <emu-xref href="#sec-time-values-and-time-range" id="_ref_16242"><a href="numbers-and-dates.html#sec-time-values-and-time-range">time value</a></emu-xref> of a Date is never observably <emu-val>-0</emu-val><sub>𝔽</sub> and methods that return <emu-xref href="#sec-time-values-and-time-range" id="_ref_16243"><a href="numbers-and-dates.html#sec-time-values-and-time-range">time values</a></emu-xref> never return <emu-val>-0</emu-val><sub>𝔽</sub>.</p>
102
102
<p><emu-xref href="#sec-date-time-string-format" id="_ref_924"><a href="numbers-and-dates.html#sec-date-time-string-format">21.4.1.32</a></emu-xref>: If a UTC offset representation is not present, the local time zone is used. Edition 5.1 incorrectly stated that a missing time zone should be interpreted as <emu-val>"z"</emu-val>.</p>
103
103
<p><emu-xref href="#sec-date.prototype.toisostring" id="_ref_925"><a href="numbers-and-dates.html#sec-date.prototype.toisostring">21.4.4.36</a></emu-xref>: If the year cannot be represented using the Date Time String Format specified in <emu-xref href="#sec-date-time-string-format" id="_ref_926"><a href="numbers-and-dates.html#sec-date-time-string-format">21.4.1.32</a></emu-xref> a RangeError exception is thrown. Previous editions did not specify the behaviour for that case.</p>
104
-
<p><emu-xref href="#sec-date.prototype.tostring" id="_ref_927"><a href="numbers-and-dates.html#sec-date.prototype.tostring">21.4.4.41</a></emu-xref>: Previous editions did not specify the value returned by <code>Date.prototype.toString</code> when the <emu-xref href="#sec-time-values-and-time-range" id="_ref_16248"><a href="numbers-and-dates.html#sec-time-values-and-time-range">time value</a></emu-xref> is <emu-val>NaN</emu-val>. ECMAScript 2015 specifies the result to be the String value <emu-val>"Invalid Date"</emu-val>.</p>
104
+
<p><emu-xref href="#sec-date.prototype.tostring" id="_ref_927"><a href="numbers-and-dates.html#sec-date.prototype.tostring">21.4.4.41</a></emu-xref>: Previous editions did not specify the value returned by <code>Date.prototype.toString</code> when the <emu-xref href="#sec-time-values-and-time-range" id="_ref_16244"><a href="numbers-and-dates.html#sec-time-values-and-time-range">time value</a></emu-xref> is <emu-val>NaN</emu-val>. ECMAScript 2015 specifies the result to be the String value <emu-val>"Invalid Date"</emu-val>.</p>
105
105
<p><emu-xref href="#sec-regexp-pattern-flags" id="_ref_928"><a href="text-processing.html#sec-regexp-pattern-flags">22.2.4.1</a></emu-xref>, <emu-xref href="#sec-escaperegexppattern" id="_ref_929"><a href="text-processing.html#sec-escaperegexppattern">22.2.6.13.1</a></emu-xref>: Any LineTerminator code points in the value of the <emu-val>"source"</emu-val> property of a RegExp instance must be expressed using an escape sequence. Edition 5.1 only required the escaping of <code>/</code>.</p>
106
106
<p><emu-xref href="#sec-regexp.prototype-%symbol.match%" id="_ref_930"><a href="text-processing.html#sec-regexp.prototype-%symbol.match%">22.2.6.8</a></emu-xref>, <emu-xref href="#sec-regexp.prototype-%symbol.replace%" id="_ref_931"><a href="text-processing.html#sec-regexp.prototype-%symbol.replace%">22.2.6.11</a></emu-xref>: In previous editions, the specifications for <code>String.prototype.match</code> and <code>String.prototype.replace</code> was incorrect for cases where the pattern argument was a RegExp value whose <code>global</code> flag is set. The previous specifications stated that for each attempt to match the pattern, if <code>lastIndex</code> did not change, it should be incremented by 1. The correct behaviour is that <code>lastIndex</code> should be incremented by 1 only if the pattern matched the empty String.</p>
107
-
<p><emu-xref href="#sec-array.prototype.sort" id="_ref_932"><a href="indexed-collections.html#sec-array.prototype.sort">23.1.3.30</a></emu-xref>: Previous editions did not specify how a <emu-val>NaN</emu-val> value returned by a <var>comparator</var> was interpreted by <code>Array.prototype.sort</code>. ECMAScript 2015 specifies that such as value is treated as if <emu-val>+0</emu-val><sub>𝔽</sub> was returned from the <var>comparator</var>. ECMAScript 2015 also specifies that <emu-xref aoid="ToNumber" id="_ref_16249"><a href="abstract-operations.html#sec-tonumber">ToNumber</a></emu-xref> is applied to the result returned by a <var>comparator</var>. In previous editions, the effect of a <var>comparator</var> result that <emu-xref href="#sec-ecmascript-language-types-number-type" id="_ref_16250"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-number-type">is not a Number</a></emu-xref> value was <emu-xref href="#implementation-defined" id="_ref_16251"><a href="overview.html#implementation-defined">implementation-defined</a></emu-xref>. In practice, implementations call <emu-xref aoid="ToNumber" id="_ref_16252"><a href="abstract-operations.html#sec-tonumber">ToNumber</a></emu-xref>.</p>
107
+
<p><emu-xref href="#sec-array.prototype.sort" id="_ref_932"><a href="indexed-collections.html#sec-array.prototype.sort">23.1.3.30</a></emu-xref>: Previous editions did not specify how a <emu-val>NaN</emu-val> value returned by a <var>comparator</var> was interpreted by <code>Array.prototype.sort</code>. ECMAScript 2015 specifies that such as value is treated as if <emu-val>+0</emu-val><sub>𝔽</sub> was returned from the <var>comparator</var>. ECMAScript 2015 also specifies that <emu-xref aoid="ToNumber" id="_ref_16245"><a href="abstract-operations.html#sec-tonumber">ToNumber</a></emu-xref> is applied to the result returned by a <var>comparator</var>. In previous editions, the effect of a <var>comparator</var> result that <emu-xref href="#sec-ecmascript-language-types-number-type" id="_ref_16246"><a href="ecmascript-data-types-and-values.html#sec-ecmascript-language-types-number-type">is not a Number</a></emu-xref> value was <emu-xref href="#implementation-defined" id="_ref_16247"><a href="overview.html#implementation-defined">implementation-defined</a></emu-xref>. In practice, implementations call <emu-xref aoid="ToNumber" id="_ref_16248"><a href="abstract-operations.html#sec-tonumber">ToNumber</a></emu-xref>.</p>
0 commit comments