Skip to content

Commit 3bd2c17

Browse files
authored
Remove references to dateNow (#19662)
It seems that this was once needed to support some JS shell or another. However, as of today the only shell the defines this is `spidermonkey`, and they also define performance.now() .. seemingly to the same thing: ``` $ ~/.jsvu/engines/spidermonkey/spidermonkey js> dateNow() - performance.now() -0.0029296875 js> ``` Neither d8 now jsc define dateNow.
1 parent 65b026b commit 3bd2c17

File tree

5 files changed

+0
-27
lines changed

5 files changed

+0
-27
lines changed

src/closure-externs/spidermonkey-externs.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ var scriptArgs = [];
3333
* @suppress {duplicate}
3434
*/
3535
var quit = function(status) {};
36-
/**
37-
* @return {number}
38-
* @suppress {duplicate}
39-
*/
40-
var dateNow = function() {};
4136
/**
4237
* This is to prevent Closure Compiler to use `gc` as variable name anywhere, otherwise it might collide with SpiderMonkey's shell `gc()` function
4338
*/

src/closure-externs/v8-externs.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,3 @@ var scriptArgs = [];
3232
* @suppress {duplicate}
3333
*/
3434
var quit = function(status) {};
35-
/**
36-
* @return {number}
37-
* @suppress {duplicate}
38-
*/
39-
var dateNow = function() {};

src/library.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2334,11 +2334,6 @@ mergeInto(LibraryManager.library, {
23342334
// respective time origins.
23352335
_emscripten_get_now = () => performance.timeOrigin + {{{ getPerformanceNow() }}}();
23362336
#else
2337-
#if ENVIRONMENT_MAY_BE_SHELL
2338-
if (typeof dateNow != 'undefined') {
2339-
_emscripten_get_now = dateNow;
2340-
} else
2341-
#endif
23422337
#if MIN_IE_VERSION <= 9 || MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 || AUDIO_WORKLET // https://caniuse.com/#feat=high-resolution-time
23432338
// AudioWorkletGlobalScope does not have performance.now()
23442339
// (https://github.com/WebAudio/web-audio-api/issues/2527), so if building
@@ -2368,11 +2363,6 @@ mergeInto(LibraryManager.library, {
23682363
return 1; // nanoseconds
23692364
}
23702365
#endif
2371-
#if ENVIRONMENT_MAY_BE_SHELL
2372-
if (typeof dateNow != 'undefined') {
2373-
return 1000; // microseconds (1/1000 of a millisecond)
2374-
}
2375-
#endif
23762366
#if MIN_IE_VERSION <= 9 || MIN_FIREFOX_VERSION <= 14 || MIN_CHROME_VERSION <= 23 || MIN_SAFARI_VERSION <= 80400 // https://caniuse.com/#feat=high-resolution-time
23772367
if (typeof performance == 'object' && performance && typeof performance['now'] == 'function') {
23782368
return 1000; // microseconds (1/1000 of a millisecond)
@@ -2392,9 +2382,6 @@ mergeInto(LibraryManager.library, {
23922382
((typeof performance == 'object' && performance && typeof performance['now'] == 'function')
23932383
#if ENVIRONMENT_MAY_BE_NODE
23942384
|| ENVIRONMENT_IS_NODE
2395-
#endif
2396-
#if ENVIRONMENT_MAY_BE_SHELL
2397-
|| (typeof dateNow != 'undefined')
23982385
#endif
23992386
);`,
24002387
#else

test/optimizer/applyImportAndExportNameChanges2-output.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ if (ENVIRONMENT_IS_NODE) {
200200
var t = process.hrtime();
201201
return t[0] * 1e3 + t[1] / 1e6;
202202
};
203-
} else if (typeof dateNow !== "undefined") {
204-
_emscripten_get_now = dateNow;
205203
} else if (typeof self === "object" && self["performance"] && typeof self["performance"]["now"] === "function") {
206204
_emscripten_get_now = function() {
207205
return self["performance"]["now"]();

test/optimizer/applyImportAndExportNameChanges2.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ if (ENVIRONMENT_IS_NODE) {
192192
var t = process.hrtime();
193193
return t[0] * 1e3 + t[1] / 1e6
194194
}
195-
} else if (typeof dateNow !== "undefined") {
196-
_emscripten_get_now = dateNow
197195
} else if (typeof self === "object" && self["performance"] && typeof self["performance"]["now"] === "function") {
198196
_emscripten_get_now = (function() {
199197
return self["performance"]["now"]()

0 commit comments

Comments
 (0)