Closed
Bug 693869
Opened 14 years ago
Closed 11 years ago
JavaScript with illegal octal aborts the spidermonkey reflection
Categories
(addons.mozilla.org Graveyard :: Developer Pages, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: kumar, Unassigned)
Details
Attachments
(1 file)
|
789 bytes,
application/x-xpinstall
|
Details |
STR: run the attached addon through the validator like:
./addon-validator --determined -o json ~/Downloads/octal-test-addon.xpi
This dies a horrible death (traceback below). There is a javascript file that triggers the error with this line of JS:
// illegal octal
var foo = 09;
Quick fix: let the validator ignore the warning and continue on.
Nicer long term fix: maybe we should turn this into a warning? Jorge?
Traceback (most recent call last):
File "./addon-validator", line 6, in <module>
validator.main.main()
File "/Users/kumar/dev/amo-validator/validator/main.py", line 119, in main
for_appversions=for_appversions)
File "/Users/kumar/dev/amo-validator/validator/validate.py", line 47, in validate
for_appversions=for_appversions)
File "/Users/kumar/dev/amo-validator/validator/submain.py", line 57, in prepare_package
for_appversions)
File "/Users/kumar/dev/amo-validator/validator/submain.py", line 143, in test_package
return test_inner_package(err, package, for_appversions)
File "/Users/kumar/dev/amo-validator/validator/submain.py", line 307, in test_inner_package
test_func(err, xpi_package)
File "/Users/kumar/dev/amo-validator/validator/testcases/content.py", line 237, in test_packed_scripts
testendpoint_js.test_js_file(err, script, file_data)
File "/Users/kumar/dev/amo-validator/validator/testcases/scripting.py", line 44, in test_js_file
err=err)
File "/Users/kumar/dev/amo-validator/validator/testcases/javascript/spidermonkey.py", line 27, in get_tree
shell if shell else SPIDERMONKEY_INSTALLATION)
File "/Users/kumar/dev/amo-validator/validator/testcases/javascript/spidermonkey.py", line 121, in _get_tree
raise RuntimeError('Error calling %r: %s' % (cmd, stderr))
RuntimeError: Error calling ['/usr/local/bin/js', '-e', 'try{\n print(JSON.stringify(Reflect.parse(read("/var/folders/Od/OdI+ssWOET0fCQRT0VwwDE+++TI/-Tmp-/tmpWUsZQb"))));\n } catch(e) {\n print(JSON.stringify({\n "error":true,\n "error_message":e.toString(),\n "line_number":e.lineNumber\n }));\n }', '-U']: 2: warning: 09 is not a legal ECMA-262 octal constant:
2: warning: var foo = 09;
2: warning: ..........^
| Reporter | ||
Comment 1•14 years ago
|
||
Comment 2•14 years ago
|
||
Does this actually break anything or does the JS work as expected?
| Reporter | ||
Comment 3•14 years ago
|
||
Good question. Jorge, do you know if octals mess anything up at runtime? I'm assuming that the dev who reported the problem did not run into runtime problems when testing (see bug 693457)
Comment 4•14 years ago
|
||
(In reply to Kumar McMillan [:kumar] from comment #3)
> Good question. Jorge, do you know if octals mess anything up at runtime?
> I'm assuming that the dev who reported the problem did not run into runtime
> problems when testing (see bug 693457)
I don't know. Kris, do you know?
Comment 5•14 years ago
|
||
Oh. That's interesting. I've never seen that before.
There shouldn't be any runtime issues, no. I suspect that it would suffice to turn stderr output to a validator warning rather than a runtime error so long as we get valid JSON output.
Comment 6•11 years ago
|
||
Thanks for filing this. Due to resource constraints we are closing bugs which we won't realistically be able to fix. If you have a patch that applies to this bug please reopen.
For more info see http://micropipes.com/blog/2014/09/24/the-great-add-on-bug-triage/
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
| Assignee | ||
Updated•10 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•