Skip to content

Commit ff71d3c

Browse files
jugglinmikerwaldron
authored andcommitted
[[FIX]] Remove warning W100
No justification could be found for this warning. See #2741
1 parent bcb3b23 commit ff71d3c

File tree

4 files changed

+5
-32
lines changed

4 files changed

+5
-32
lines changed

src/lex.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,13 +1516,6 @@ Lexer.prototype = {
15161516
this.input.search(/(\u00A0)/) : -1;
15171517
},
15181518

1519-
/*
1520-
* Scan for characters that get silently deleted by one or more browsers.
1521-
*/
1522-
scanUnsafeChars: function() {
1523-
return this.input.search(reg.unsafeChars);
1524-
},
1525-
15261519
/*
15271520
* Produce the next raw token or return 'null' if no tokens can be matched.
15281521
* This method skips over all space characters.
@@ -1615,16 +1608,6 @@ Lexer.prototype = {
16151608
}
16161609

16171610
this.input = this.input.replace(/\t/g, state.tab);
1618-
char = this.scanUnsafeChars();
1619-
1620-
if (char >= 0) {
1621-
this.triggerAsync(
1622-
"warning",
1623-
{ code: "W100", line: this.line, character: char },
1624-
checks,
1625-
function() { return true; }
1626-
);
1627-
}
16281611

16291612
// If there is a limit on line length, warn when lines get too
16301613
// long.

src/messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ var warnings = {
188188
W097: "Use the function form of \"use strict\".",
189189
W098: "'{a}' is defined but never used.",
190190
W099: null,
191-
W100: "This character may get silently deleted by one or more browsers.",
191+
W100: null,
192192
W101: "Line is too long.",
193193
W102: null,
194194
W103: "The '{a}' property is deprecated.",

src/reg.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
exports.unsafeString =
1111
/@cc|<\/?|script|\]\s*\]|<\s*!|&lt/i;
1212

13-
// Unsafe characters that are silently deleted by one or more browsers (cx)
14-
exports.unsafeChars =
15-
/[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/;
16-
1713
// Characters in strings that need escaping (nx and nxg)
1814
exports.needEsc =
1915
/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/;

tests/unit/parser.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ var fs = require('fs');
99
var TestRun = require("../helpers/testhelper").setup.testRun;
1010
var path = require("path");
1111

12+
/**
13+
* The warning for this input was intentionally disabled after research into
14+
* its justification produced no results.
15+
*/
1216
exports.unsafe = function (test) {
1317
var code = [
1418
"var a\u000a = 'Here is a unsafe character';",
1519
];
1620

1721
TestRun(test)
18-
.addError(1, 5, "This character may get silently deleted by one or more browsers.")
1922
.test(code, {es3: true});
2023

2124
test.done();
@@ -26,36 +29,30 @@ exports.peekOverDirectives = function (test) {
2629

2730
TestRun(test)
2831
// Within object literal
29-
.addError(18, 15, "This character may get silently deleted by one or more browsers.")
3032
.addError(18, 14, "Unexpected control character in regular expression.")
3133
.addError(19, 14, "Unexpected escaped character '<' in regular expression.")
3234
.addError(20, 81, "Line is too long.")
3335
.addError(21, 15, "Control character in string: <non-printable>.")
34-
.addError(21, 14, "This character may get silently deleted by one or more browsers.")
3536
.addError(22, 14, "'Octal integer literal' is only available in ES6 (use 'esversion: 6').")
3637
.addError(23, 14, "'Binary integer literal' is only available in ES6 (use 'esversion: 6').")
3738
.addError(24, 14, "'template literal syntax' is only available in ES6 (use 'esversion: 6').")
3839
.addError(25, 14, "'Sticky RegExp flag' is only available in ES6 (use 'esversion: 6').")
3940

4041
// Within array literal:
41-
.addError(44, 4, "This character may get silently deleted by one or more browsers.")
4242
.addError(44, 3, "Unexpected control character in regular expression.")
4343
.addError(45, 3, "Unexpected escaped character '<' in regular expression.")
4444
.addError(46, 81, "Line is too long.")
4545
.addError(47, 4, "Control character in string: <non-printable>.")
46-
.addError(47, 3, "This character may get silently deleted by one or more browsers.")
4746
.addError(48, 3, "'Octal integer literal' is only available in ES6 (use 'esversion: 6').")
4847
.addError(49, 3, "'Binary integer literal' is only available in ES6 (use 'esversion: 6').")
4948
.addError(50, 3, "'template literal syntax' is only available in ES6 (use 'esversion: 6').")
5049
.addError(51, 3, "'Sticky RegExp flag' is only available in ES6 (use 'esversion: 6').")
5150

5251
// Within grouping operator:
53-
.addError(70, 4, "This character may get silently deleted by one or more browsers.")
5452
.addError(70, 3, "Unexpected control character in regular expression.")
5553
.addError(71, 3, "Unexpected escaped character '<' in regular expression.")
5654
.addError(72, 81, "Line is too long.")
5755
.addError(73, 4, "Control character in string: <non-printable>.")
58-
.addError(73, 3, "This character may get silently deleted by one or more browsers.")
5956
.addError(74, 3, "'Octal integer literal' is only available in ES6 (use 'esversion: 6').")
6057
.addError(75, 3, "'Binary integer literal' is only available in ES6 (use 'esversion: 6').")
6158
.addError(76, 3, "'template literal syntax' is only available in ES6 (use 'esversion: 6').")
@@ -574,9 +571,7 @@ exports.regexp = function (test) {
574571
];
575572

576573
var run = TestRun(test)
577-
.addError(1, 11, "This character may get silently deleted by one or more browsers.")
578574
.addError(1, 10, "Unexpected control character in regular expression.")
579-
.addError(2, 12, "This character may get silently deleted by one or more browsers.")
580575
.addError(2, 10, "Unexpected control character in regular expression.")
581576
.addError(3, 10, "Unexpected escaped character '<' in regular expression.")
582577
.addError(4, 10, "Unexpected escaped character '<' in regular expression.")
@@ -723,7 +718,6 @@ exports.strings = function (test) {
723718

724719
var run = TestRun(test)
725720
.addError(1, 10, "Control character in string: <non-printable>.")
726-
.addError(1, 9, "This character may get silently deleted by one or more browsers.")
727721
.addError(7, 12, "Unclosed string.")
728722
.addError(7, 12, "Missing semicolon.");
729723
run.test(code, {es3: true});

0 commit comments

Comments
 (0)