зеркало из https://github.com/mozilla/pluotsorbet.git
Default to anonymous functions in release builds.
This commit is contained in:
Родитель
0765f845fc
Коммит
86d3918e6a
|
@ -1222,6 +1222,13 @@ module J2ME {
|
|||
linkedMethods[methodInfo.id] = fn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable this if you want your profiles to have nice function names. Naming eval'ed functions
|
||||
* using: |new Function("return function displayName {}");| can cause performance problems and
|
||||
* we keep it disabled by default.
|
||||
*/
|
||||
var nameJITFunctions = false;
|
||||
|
||||
/**
|
||||
* Links up compiled method at runtime.
|
||||
*/
|
||||
|
@ -1230,8 +1237,14 @@ module J2ME {
|
|||
|
||||
enterTimeline("Eval Compiled Code");
|
||||
// This overwrites the method on the global object.
|
||||
// var fn = new Function(args.join(','), body);
|
||||
var fn = new Function("return function fn_" + methodInfo.implKey.replace(/\W+/g, "_") + "(" + args.join(",") + "){ " + body + "}")();
|
||||
|
||||
var fn = null;
|
||||
if (!release || nameJITFunctions) {
|
||||
fn = new Function("return function fn_" + methodInfo.implKey.replace(/\W+/g, "_") + "(" + args.join(",") + "){ " + body + "}")();
|
||||
} else {
|
||||
fn = new Function(args.join(','), body);
|
||||
}
|
||||
|
||||
leaveTimeline("Eval Compiled Code");
|
||||
|
||||
methodInfo.state = MethodState.Compiled;
|
||||
|
|
Загрузка…
Ссылка в новой задаче