« Bugzilla Issues Index
#3399 — 12.1.1.1 ToDateTimeOptions: Change Throw parameter to true
- bug_id:
3399
- creation_ts:
2014-12-03 13:40:00 -0800
- short_desc:
12.1.1.1 ToDateTimeOptions: Change Throw parameter to true
- delta_ts:
2015-02-09 08:28:26 -0800
- product:
Internationalization - ECMA-402
- component:
Specification
- version:
Edition 2.0 drafts
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
normal
- everconfirmed:
true
- reporter:
André Bargull
- assigned_to:
Rick Waldron
- cc:
waldron.rick
- commentid:
10706
- comment_count:
0
- who:
André Bargull
- bug_when:
2014-12-03 13:40:57 -0800
12.1.1.1 ToDateTimeOptions, steps 7.a.i and 8.a.i:
The Throw parameter for the [[DefineOwnProperty]] calls should be changed from `false` to `true`, because
1) it's more in line with other uses in ES5/6
2) implementations (IE11, V8, SpiderMonkey) already throw.
Test case:
---
var options = {get second() {
Object.defineProperty(this, "year", {value: "2-digit"});
}};
new Intl.DateTimeFormat("de", options).format(new Date);
---
Expected (ECMA-402 1st, 2nd draft Feb 28 2013): No exception thrown
Actual (implementations): TypeError is thrown (e.g. V8 reports "TypeError: Cannot redefine property: year")
- commentid:
10725
- comment_count:
1
- who:
André Bargull
- bug_when:
2014-12-04 11:14:25 -0800
Forgot to mention:
In ES6 terms this means using CreateDataPropertyOrThrow instead of CreateDataProperty.
- commentid:
12242
- comment_count:
2
- who:
Rick Waldron
- bug_when:
2015-02-09 08:28:26 -0800
Fixed in rev7