Skip to content

Commit

Permalink
Fixes #154
Browse files Browse the repository at this point in the history
  • Loading branch information
iccir committed Sep 25, 2018
1 parent 41cfe27 commit fa51cff
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 37 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,6 @@ no-implicit-returns | Boolean | Disallow implicit returns (`tsc --noImpli
no-unreachable-code | Boolean | Disallow unreachable code (inverse of `tsc --allowUnreachableCode`)
strict-functions | Boolean | Enforce TypeScript-style functions
strict-object-literals | Boolean | Enforce TypeScript object literals
warn-debugger | Boolean | Warn about use of 'debugger' statement
warn-empty-array-element | Boolean | Warn about empty array element
warn-global-no-type | Boolean | Warn about missing type annotations on @globals
warn-this-in-methods | Boolean | Warn about usage of 'this' in NilScript methods
warn-self-in-non-methods | Boolean | Warn about usage of 'self' in non-NilScript methods
Expand Down
2 changes: 0 additions & 2 deletions bin/nsc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ let opt = getopt.create([
[ "", "strict-functions", "type checker: enforce TypeScript-style functions" ],
[ "", "strict-object-literals", "type checker: enforce TypeScript object literals" ],

[ "", "warn-debugger", "warn about use of 'debugger' statement" ],
[ "", "warn-empty-array-element", "warn about empty array element" ],
[ "", "warn-global-no-type", "warn about missing type annotations on @globals" ],
[ "", "warn-this-in-methods", "warn about usage of 'this' in NilScript methods" ],
[ "", "warn-self-in-non-methods", "warn about usage of 'self' in non-methods" ],
Expand Down
17 changes: 0 additions & 17 deletions src/Generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ generate()

let methodUsesSelfVar = false;

let optionWarnDebugger = options["warn-debugger"];
let optionWarnEmptyArrayElement = options["warn-empty-array-element"];
let optionWarnGlobalNoType = options["warn-global-no-type"];
let optionWarnThisInMethods = options["warn-this-in-methods"];
let optionWarnSelfInNonMethod = options["warn-self-in-non-methods"];
Expand Down Expand Up @@ -1360,21 +1358,6 @@ generate()

} else if (type === Syntax.Property) {
handleProperty(node);

// Additional warnings
} else if (type === Syntax.ArrayExpression) {
if (optionWarnEmptyArrayElement) {
_.each(node.elements, element => {
if (element === null) {
warnings.push(Utils.makeError(NSWarning.UseOfEmptyArrayElement, "Use of empty array element", node));
}
});
}

} else if (type === Syntax.DebuggerStatement) {
if (optionWarnDebugger) {
warnings.push(Utils.makeError(NSWarning.UseOfDebugger, "Use of debugger statement", node));
}
}

}, function(node, parent) {
Expand Down
16 changes: 0 additions & 16 deletions test/multi/TestErrors.oj
Original file line number Diff line number Diff line change
Expand Up @@ -411,22 +411,6 @@ function test() {
@end


// --------------------------------------------------------------------
// @name Warn Debugger
// @opts { "warn-debugger": true }

function foo() {
debugger; //@warning NilScriptUseOfDebuggerWarning
}


// --------------------------------------------------------------------
// @name Warn Empty Array
// @opts { "warn-empty-array-element": true }

var arr = [,,,,]; //@warning NilScriptUseOfEmptyArrayElementWarning


// --------------------------------------------------------------------
// @name Warn Unused Ivars
// @opts { "warn-unused-ivars": true }
Expand Down

0 comments on commit fa51cff

Please sign in to comment.