Closed
Bug 805904
Opened 12 years ago
Closed 10 years ago
Remove unnecessary javascript function names
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: kats, Unassigned)
References
Details
Attachments
(3 files)
6.61 KB,
patch
|
Details | Diff | Splinter Review | |
471 bytes,
text/x-python
|
Details | |
54.68 KB,
text/plain
|
Details |
As of FF 17, the JS engine can infer function names from "anonymous" functions, so we shouldn't need to duplicate them. i.e. instead of
name: function debug_name(arguments) {
}
we can just do
name: function(arguments) {
}
See http://javascript-reverse.tumblr.com/post/34328529526/javascript-function-name-inference-aka-stop-function
Comment 1•12 years ago
|
||
We could probably modify the JS parser to dump function lines and scripts where we name functions, but have sufficient name inference. And then put it on the try server.
Comment 2•12 years ago
|
||
I modified the NameFunctions code so it dumps out unnecessary names.
Comment 3•12 years ago
|
||
Running this very ugly python script, produces a list of all functions that could be simplified.
Comment 4•12 years ago
|
||
Running the script produces this output. This is only for code in chrome:// that is also hit by mochitests. Now we need start looking at renaming this stuff :)
Reporter | ||
Comment 5•12 years ago
|
||
The output is for desktop, right? Can we get one for Fennec as well?
Reporter | ||
Comment 6•12 years ago
|
||
(Specifically we have a different browser.js than desktop so the output here doesn't apply to Fennec's browser.js)
Comment 7•12 years ago
|
||
We can probably parse the result of this try push: https://tbpl.mozilla.org/?tree=Try&rev=e7e93b94fcf2.
Reporter | ||
Comment 8•12 years ago
|
||
The try push above failed on non-debug builds, and the debug build for Android doesn't run any tests. I'm not sure why the Linux build log itself has the output (does the JS compiler frontend get run during the build process itself?) but the Android one sadly does not.
I tried taking your patch and applying it to my local build which worked fine, but then starting Fennec on a device didn't print out the name info like I thought it would.
Reporter | ||
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INCOMPLETE
Assignee | ||
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•