diff --git a/src/12.datetimeformat.js b/src/12.datetimeformat.js index 4ca8666b..371ab1e0 100644 --- a/src/12.datetimeformat.js +++ b/src/12.datetimeformat.js @@ -789,11 +789,6 @@ defineProperty(Intl.DateTimeFormat, 'supportedLocalesOf', { get: GetFormatDateTime }); -defineProperty(Intl.DateTimeFormat.prototype, 'formatToParts', { - configurable: true, - get: GetFormatToPartsDateTime -}); - function GetFormatDateTime() { let internal = this !== null && typeof this === 'object' && getInternalProperties(this); @@ -836,7 +831,7 @@ function GetFormatDateTime() { return internal['[[boundFormat]]']; } -function GetFormatToPartsDateTime() { +Intl.DateTimeFormat.prototype.formatToParts = function formatToParts() { let internal = this !== null && typeof this === 'object' && getInternalProperties(this); if (!internal || !internal['[[initializedDateTimeFormat]]']) @@ -851,7 +846,7 @@ function GetFormatToPartsDateTime() { internal['[[boundFormatToParts]]'] = bf; } return internal['[[boundFormatToParts]]']; -} +}; function CreateDateTimeParts(dateTimeFormat, x) { // 1. If x is not a finite Number, then throw a RangeError exception. diff --git a/src/util.js b/src/util.js index 40a83f2c..23ef78f8 100644 --- a/src/util.js +++ b/src/util.js @@ -1,8 +1,12 @@ const realDefineProp = (function () { let sentinel = {}; try { - Object.defineProperty(sentinel, 'a', {}); - return 'a' in sentinel; + Object.defineProperty(sentinel, 'a', { + get: function () { + return 1; + } + }); + return sentinel.a === 1; } catch (e) { return false; }