Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0009453 | Openbravo ERP | A. Platform | public | 2009-06-12 11:29 | 2009-11-20 00:00 |
|
Reporter | iperdomo | |
Assigned To | iperdomo | |
Priority | low | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 20 | OS Version | rPath Linux |
Product Version | pi | |
Target Version | pi | Fixed in Version | | |
Merge Request Status | |
Review Assigned To | |
OBNetwork customer | No |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0009453: JS API check doesn't distinguish between a parameter and a local variable |
Description | The .details of a js file contains the definition of the API.
When generating this file we include the function scope's variables. This includes the local ones.
There is no API breakage if a local variable is changed. They are not accessed from the outside.
This gives false positives in the module API checks e.g. [1]
[1] http://builds.openbravo.com/job/erp_devel_pi-module-integrity-test/45/consoleFull [^] |
Steps To Reproduce | |
Proposed Solution | * Makes the .details files with only the parameters of the function and not the local variables |
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2009-06-12 11:29 | iperdomo | New Issue | |
2009-06-12 11:29 | iperdomo | Assigned To | => iperdomo |
2009-06-12 11:29 | iperdomo | OBNetwork customer | => No |
2009-06-29 13:14 | psarobe | Status | new => scheduled |
2009-06-29 13:14 | psarobe | fix_in_branch | => pi |
2009-11-17 18:42 | iperdomo | Note Added: 0021929 | |
2009-11-17 21:11 | hgbot | Checkin | |
2009-11-17 21:11 | hgbot | Note Added: 0021934 | |
2009-11-17 21:11 | hgbot | Status | scheduled => resolved |
2009-11-17 21:11 | hgbot | Resolution | open => fixed |
2009-11-17 21:11 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/eb78c81738a119940ee93ff678f00a522235a2d0 [^] |
2009-11-17 21:13 | hgbot | Checkin | |
2009-11-17 21:13 | hgbot | Note Added: 0021935 | |
2009-11-17 21:13 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/devel/pi/rev/eb78c81738a119940ee93ff678f00a522235a2d0 [^] => http://code.openbravo.com/erp/devel/api-checks/rev/d4ae029642eb8f156b7b082fe8df0e2fd4de711a [^] |
2009-11-19 15:35 | shuehner | Note Added: 0022022 | |
2009-11-19 15:35 | shuehner | Status | resolved => closed |
2009-11-20 00:00 | anonymous | sf_bug_id | 0 => 2900807 |
Notes |
|
|
The way to ensure a non JavaScript API breakage is implementing the necessary checks in the function itself. Comparing how many parameters the function has is irrelevant, JavaScript doesn't care about it. If you pass more parameters than expected, they will be ignored, if you pass less parameters than expected the missing ones will be *undefined*.
The parameters part of the .details files will be removed to avoid false positives.
Using a firebug console:
function test(p) { console.log("typeof p: " + typeof p);}
---
>>> test('hello world');
typeof p: string
>>> test(1, 'hello world');
typeof p: number
>>> test();
typeof p: undefined |
|
|
(0021934)
|
hgbot
|
2009-11-17 21:11
|
|
Repository: erp/devel/pi
Changeset: eb78c81738a119940ee93ff678f00a522235a2d0
Author: Iván Perdomo <ivan.perdomo <at> openbravo.com>
Date: Tue Nov 17 21:10:27 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/eb78c81738a119940ee93ff678f00a522235a2d0 [^]
Fixes issue 9453: Removed parameters from function details
---
M src-test/org/openbravo/test/javascript/JavaScriptAPIChecker.java
M src-test/org/openbravo/test/javascript/JavaScriptParser.java
---
|
|
|
(0021935)
|
hgbot
|
2009-11-17 21:13
|
|
Repository: erp/devel/api-checks
Changeset: d4ae029642eb8f156b7b082fe8df0e2fd4de711a
Author: Iván Perdomo <ivan.perdomo <at> openbravo.com>
Date: Tue Nov 17 21:12:06 2009 +0100
URL: http://code.openbravo.com/erp/devel/api-checks/rev/d4ae029642eb8f156b7b082fe8df0e2fd4de711a [^]
Related to issue 9453: Updated desc files, removed parameters from function definitions
---
M js/ajax.js.details
M js/appStatus.js.details
M js/calculator.js.details
M js/callOut.js.details
M js/error.js.details
M js/genericTree.js.details
M js/menuKeyboard.js.details
M js/messages.js.details
M js/multilinea.js.details
M js/multilineaOculto.js.details
M js/searchs.js.details
M js/shortcuts.js.details
M js/utils.js.details
M js/windowKeyboard.js.details
---
|
|
|
|
Change checked, parameters are now completely ignored as they cannot be teted by this check at all. |
|