build fails without message when Unity.init is called with quoted object keys
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
WebApps: Applications Data |
Fix Released
|
Low
|
Unassigned | ||
webapps-applications (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Quantal |
Won't Fix
|
Undecided
|
Unassigned | ||
Raring |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
I've added my own user script under src/Deezer/
./configure --enable-
make
which fails, displaying only
[object Object]
make[1]: *** [manifests_
I patched the last try-catch in scripts/manifest.js to include:
printerr(
and it showed error in line 65, which is an assertion:
jsUnit.
I realized this piece of code takes care of Unity.init() call, more specifically, its object parameter, and requires object keys to be identifiers, not allowing strings literals.
E.g.:
Unity.init({
'name': 'SomeApp'
});
will fail, while
Unity.init({
name: 'SomeApp'
});
will be built successfully.
First of all, I suggest printing out error messages, not only throwing exception object, as it does not explain anything to the user.
Second, since the script runs fine with quoted keys, I'd allow prop[0].type in line 65 to be IDENTIFIER or STRING.
JavaScript specs allow object keys to be identifiers, string literals or number literals; even more, JSON specs (although independent from JS Object notation), even require quoted keys, so I do not understand why they'd have to be strictly identifiers in this case.
=======
[Impact]
Low, this fix is just to help identify problems in third party userscripts which actually wouldn't have worked anyway. It helps show the developer why the build failed, and possible even less likely to fail.
[Test Case]
Break an existing userscript by adding quotes to the object key:
Unity.init({
'name': 'SomeApp'
});
Then attempt to build with applications enabled:
./configure --enable-
make
[Regression Potential]
None, this wasn't breaking any of the existing webapps, but the fix does help third party webapp developers creating userscripts.
Related branches
- PS Jenkins bot (community): Needs Fixing (continuous-integration)
- Víctor R. Ruiz (community): Approve
-
Diff: 68 lines (+14/-10)1 file modifiedscripts/manifest.js (+14/-10)
description: | updated |
Changed in webapps-applications: | |
importance: | Undecided → Medium |
Changed in webapps-applications: | |
status: | New → In Progress |
importance: | Medium → Low |
Changed in webapps-applications: | |
status: | In Progress → Fix Committed |
Changed in webapps-applications: | |
status: | Fix Committed → Fix Released |
Changed in webapps-applications (Ubuntu): | |
status: | New → Fix Released |
description: | updated |
quantal has seen the end of its life and is no longer receiving any updates. Marking the quantal task for this ticket as "Won't Fix".