Skip to main content

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.

Jump to: navigation, search

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...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Contents

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();

Expects is working
assertMTypeRequiredKeywordSet

BestCodePractices Asserts

These could be Find Bug style but are optional

Headless Requirement

Validation should work without Eclipse UI. Ensuring that all logic is in infrastructure to be used in other other tooling such as CLI or other tooling platform such as Netbeans.

Eclipse Integration

Validation Configuration

Validation Preferences

Enabling/Disabling Validation

Build automatically turns it on but we need way to filter and turn off JS errors.

Manual Validation

Hook into right click validate menu

Incremental validation

While you type for specific scope

Dependency validation

Using build spec in .project file

Validation filters

Because there are cases where you want to inherit old code you want ways to turn off validation.

3rd party code such as Js from Omniture
Other library code you do not own.

Validation markers

Ability to default problems to error, warning, informational as required.

Extension points for additional custom validation.

Back to the top