Commit edad3a0f authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[foozzie] Make date mock more reliable.

TBR=mathias@chromium.org

Bug: chromium:1054390
Change-Id: I9533a0ca0faa0afa7032aa7dde144df48408c9d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2066958Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66377}
parent 04eed294
......@@ -32,10 +32,11 @@ var prettyPrinted = function prettyPrinted(msg) { return msg; };
}
const origDate = Date;
const construct = Reflect.construct;
const constructDate = function(args) {
let result;
if (args.length) {
result = new origDate(...args);
result = construct(origDate, args);
} else {
result = new origDate(mockDateNow());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment