Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
VJET/Validation Requirements
< VJET
Revision as of 21:16, 5 February 2013 by Earlyster.gmail.com (Talk | contribs) (New page: === JSDT parse – produces syntax errors lists === === Translation errors – errors are not reported to user === === Resolution errors – errors are reported to user === === Semantic va...)
Contents
- 1 JSDT parse – produces syntax errors lists
- 2 Translation errors – errors are not reported to user
- 3 Resolution errors – errors are reported to user
- 4 Semantic validation errors
- 5 Syntax validation
- 5.1 Syntax version based on JavaScript 1.6.
- 5.2 We are using the JSDT syntax validation (deals with validation and error recovery)
- 5.3 We need to file bugs to them to fix problem areas.
- 5.4 TODO - Need to double check syntax version
- 5.5 Translation Errors – currently uses ErrorObject – move to IJstProblem
- 6 Semantic Validation Asserts
- 7 BestCodePractices Asserts
- 8 Headless Requirement
- 9 Eclipse Integration
JSDT parse – produces syntax errors lists
Translation errors – errors are not reported to user
Resolution errors – errors are reported to user
Semantic validation errors
Syntax validation
Syntax version based on JavaScript 1.6.
We are using the JSDT syntax validation (deals with validation and error recovery)
We need to file bugs to them to fix problem areas.
TODO - Need to double check syntax version
Translation Errors – currently uses ErrorObject – move to IJstProblem
Semantic Validation Asserts
UniquenessValidator (IJstType and IJstTypeSpace required)
Local
assertUniqueMembers
vjo.ctype("a.b.c")
.protos({
a:1,
a:function(){}
})
.props({
b:1,
b:function(){}
})
assertUniqueParamsAndVariables
a:function(a,a){
var a; a;
}
Redefining variable is wrong
Redefining parameter is wrong
assertUniqueNeedNames
Global
assertUniqueType
vjo.type('a.b.c.A')
.endType();
vjo.type('a.b.c.A')
.endType();
Redefining the type can cause issues
assertNoNativeOverRides
vjo.type('Date')
.endType();
Redefining the native types can cause collisions
assertNoDomOverRides
vjo.type('window')
.endType();
Redefining the dom types can cause collisions
ResolutionValidation (Resolved Jst required)
If Build path is incorrect resolving will fail
assertResolvedNeeds
assertResolvedParamTypes
assertResolvedVarTypes
assertResolvedMethodTypes
assertResolvedPropertyTypes
DependencyValidation (Type + TS)
Local
assertNoUnusedNeeds
this can be problematic if developers use with or eval.
assertValidateUseNeedsAlias
vjo.ctype('partials.NeedsAliasTest')
.needs('partials.Bug2149TypeB', 'MyAlias');
.props({
main: function() { //< public void main (String ... arguments)
this.vj$.Myalias
}
}).endType();
this.vj$.Myalias – is wrong name
AccessValidation (Type + TS)
assertTypeRefCanAccessTargetType
assertMethodRefCanAccessTargetMethod
assertPropertyRefCanAccessTargetProperty
ModifierValidation
assertValidTypeModifiers
vjo.ctype('a.b.c.D') //<public final
public is ok
final is not okay we have vjo method for that
assertValidMethodModifiers
assertValidPropertyModifiers
assertValidVariableModifiers
VJOStructureValidation
RequiredInput
assertTypeHasStringInput
assertValidNeedsInput
assertProtosHasObjectLiteral
assertPropsHasObjectLiteral
assertInitsHasFunction
RequiredStructure
assertEndTypeAtEndOfTypeDef
vjo.type("vjo.example.ExVjoType")
.satisfies("vjo.example.ISatisfier")
.protos({
doIt:function(){
// impl goes here
},
doIt2:function(){
// impl goes here
}});
.endType() is missing after definition of protos
assertETypeRequiredKeywordSet
assertCTypeRequiredKeywordSet
vjo.ctype("a.b.c.D")
.expects()
.endType();