Skip to content

Commit

Permalink
In IE 6-8, Date inside the function expression does not reference `…
Browse files Browse the repository at this point in the history
…DateShim`.

Fixes #303.
  • Loading branch information
ljharb committed May 21, 2015
1 parent 21fd976 commit 9fb2120
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions es5-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ if (!Date.parse || doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExt
if (this instanceof NativeDate) {
date = length === 1 && String(Y) === Y ? // isString(Y)
// We explicitly pass it through parse:
new NativeDate(Date.parse(Y)) :
new NativeDate(DateShim.parse(Y)) :
// We have to manually make calls depending on argument
// length here
length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) :
Expand All @@ -941,7 +941,7 @@ if (!Date.parse || doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExt
date = NativeDate.apply(this, arguments);
}
// Prevent mixups with unfixed Date object
defineProperties(date, { constructor: Date }, true);
defineProperties(date, { constructor: DateShim }, true);
return date;
};

Expand Down

0 comments on commit 9fb2120

Please sign in to comment.