Skip to content

Commit

Permalink
Disallow unknown properties (5/5).
Browse files Browse the repository at this point in the history
This is part of adding a new conformance rule to add additional type
safety.  This will disallow using properties of unknown types or using
unknown properties.

This enables the new conformance rule.

Change-Id: Ifae3f16930e8df4a09915236108151168b5aa5fb
  • Loading branch information
TheModMaker committed Jul 5, 2017
1 parent a180717 commit 5315542
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build/conformance.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ requirement: {
whitelist_regexp: 'test/*'
}

# Ban accessing members of unknown types.
requirement: {
type: CUSTOM
java_class: 'com.google.javascript.jscomp.ConformanceRules$'
'BanUnknownTypedClassPropsReferences'
error_message: 'Using properties of unknown types is not allowed: add an '
'explicit type to the variable.'
whitelist_regexp: 'demo/*'
}

requirement: {
type: BANNED_CODE_PATTERN
value: 'function template() { throw new Error(); }'
Expand Down

0 comments on commit 5315542

Please sign in to comment.