Skip to content

Commit

Permalink
Copy DateTime options to a new proto-less object (fixes #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyearnshaw committed Jan 10, 2014
1 parent ad3716d commit 3931e28
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
12 changes: 11 additions & 1 deletion Intl.complete.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion Intl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,17 @@ var dateTimeComponents = {
function ToDateTimeOptions (options, required, defaults) {
// 1. If options is undefined, then let options be null, else let options be
// ToObject(options).
options = options === undefined ? null : new Record(toObject(options));
if (options === undefined)
options = null;

else {
// (#12) options needs to be a Record, but it also needs to inherit properties
var opt2 = toObject(options);
options = new Record();

for (var k in opt2)
options[k] = opt2[k];
}

var
// 2. Let create be the standard built-in function object defined in ES5, 15.2.3.5.
Expand Down
Loading

0 comments on commit 3931e28

Please sign in to comment.