зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1439788 - Add performance.now() function to JS shell. r=arai
--HG-- extra : rebase_source : ac2642afd1fd76909d690b51eb62035c5d77ee92
This commit is contained in:
Родитель
f4757bccc2
Коммит
e4460fcc51
|
@ -7457,6 +7457,14 @@ TestAssertRecoveredOnBailout,
|
|||
JS_FS_HELP_END
|
||||
};
|
||||
|
||||
static const JSFunctionSpecWithHelp performance_functions[] = {
|
||||
JS_FN_HELP("now", Now, 0, 0,
|
||||
"now()",
|
||||
" Return the current time with sub-ms precision.\n"
|
||||
" This function is an alias of the dateNow() function."),
|
||||
JS_FS_HELP_END
|
||||
};
|
||||
|
||||
static const JSFunctionSpecWithHelp console_functions[] = {
|
||||
JS_FN_HELP("log", Print, 0, 0,
|
||||
"log([exp ...])",
|
||||
|
@ -8385,6 +8393,8 @@ NewGlobalObject(JSContext* cx, JS::CompartmentOptions& options,
|
|||
RootedObject performanceObj(cx, JS_NewObject(cx, nullptr));
|
||||
if (!performanceObj)
|
||||
return nullptr;
|
||||
if (!JS_DefineFunctionsWithHelp(cx, performanceObj, performance_functions))
|
||||
return nullptr;
|
||||
RootedObject mozMemoryObj(cx, JS_NewObject(cx, nullptr));
|
||||
if (!mozMemoryObj)
|
||||
return nullptr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче