[foozzie] Properly mock out Date
Yet another corner case how non-deterministic timestamps slipped into the tests. Bug: chromium:1064900 Change-Id: I33e8b4c8141b3854b7eca5d7ad9b45b6f5130d9e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2120584 Reviewed-by: Mathias Bynens <mathias@chromium.org> Commit-Queue: Michael Achenbach <machenbach@chromium.org> Cr-Commit-Position: refs/heads/master@{#66881}
This commit is contained in:
parent
51a55a3b28
commit
b30618cebe
@ -16,6 +16,7 @@ assertEquals(0.3, Math.random());
|
||||
assertEquals(1477662728698, Date.now());
|
||||
assertEquals(1477662728701, Date.now());
|
||||
assertEquals(1477662728705, new Date().getTime());
|
||||
assertEquals(710, new Date.prototype.constructor().getUTCMilliseconds());
|
||||
|
||||
// Deterministic arguments in constructor keep working.
|
||||
assertEquals(819134640000,
|
||||
|
@ -46,6 +46,10 @@ var prettyPrinted = function prettyPrinted(msg) { return msg; };
|
||||
return result;
|
||||
}
|
||||
|
||||
origDate.prototype.constructor = function(...args) {
|
||||
return constructDate(args);
|
||||
};
|
||||
|
||||
var handler = {
|
||||
apply: function(target, thisArg, args) {
|
||||
return constructDate(args);
|
||||
|
Loading…
Reference in New Issue
Block a user