refactor(TypeScript): Add noImplicitAny
We automatically insert explicit 'any's where needed. These need to be addressed as in #9100. Fixes #4924
This commit is contained in:
@ -20,12 +20,12 @@ import {
|
||||
} from '@angular/compiler/src/css/lexer';
|
||||
|
||||
export function main() {
|
||||
function tokenize(code, trackComments: boolean = false,
|
||||
function tokenize(code: any /** TODO #9100 */, trackComments: boolean = false,
|
||||
mode: CssLexerMode = CssLexerMode.ALL): CssToken[] {
|
||||
var scanner = new CssLexer().scan(code, trackComments);
|
||||
scanner.setMode(mode);
|
||||
|
||||
var tokens = [];
|
||||
var tokens: any[] /** TODO #9100 */ = [];
|
||||
var output = scanner.scan();
|
||||
while (output != null) {
|
||||
var error = output.error;
|
||||
@ -280,7 +280,7 @@ export function main() {
|
||||
it('should throw an error if a selector is being parsed while in the wrong mode', () => {
|
||||
var cssCode = ".class > tag";
|
||||
|
||||
var capturedMessage;
|
||||
var capturedMessage: any /** TODO #9100 */;
|
||||
try {
|
||||
tokenize(cssCode, false, CssLexerMode.STYLE_BLOCK);
|
||||
} catch (e) {
|
||||
@ -304,7 +304,7 @@ export function main() {
|
||||
describe('Attribute Mode', () => {
|
||||
it('should consider attribute selectors as valid input and throw when an invalid modifier is used',
|
||||
() => {
|
||||
function tokenizeAttr(modifier) {
|
||||
function tokenizeAttr(modifier: any /** TODO #9100 */) {
|
||||
var cssCode = "value" + modifier + "='something'";
|
||||
return tokenize(cssCode, false, CssLexerMode.ATTRIBUTE_SELECTOR);
|
||||
}
|
||||
@ -322,7 +322,7 @@ export function main() {
|
||||
|
||||
describe('Media Query Mode', () => {
|
||||
it('should validate media queries with a reduced subset of valid characters', () => {
|
||||
function tokenizeQuery(code) { return tokenize(code, false, CssLexerMode.MEDIA_QUERY); }
|
||||
function tokenizeQuery(code: any /** TODO #9100 */) { return tokenize(code, false, CssLexerMode.MEDIA_QUERY); }
|
||||
|
||||
// the reason why the numbers are so high is because MediaQueries keep
|
||||
// track of the whitespace values
|
||||
@ -341,7 +341,7 @@ export function main() {
|
||||
describe('Pseudo Selector Mode', () => {
|
||||
it('should validate pseudo selector identifiers with a reduced subset of valid characters',
|
||||
() => {
|
||||
function tokenizePseudo(code) {
|
||||
function tokenizePseudo(code: any /** TODO #9100 */) {
|
||||
return tokenize(code, false, CssLexerMode.PSEUDO_SELECTOR);
|
||||
}
|
||||
|
||||
@ -358,7 +358,7 @@ export function main() {
|
||||
describe('Pseudo Selector Mode', () => {
|
||||
it('should validate pseudo selector identifiers with a reduced subset of valid characters',
|
||||
() => {
|
||||
function tokenizePseudo(code) {
|
||||
function tokenizePseudo(code: any /** TODO #9100 */) {
|
||||
return tokenize(code, false, CssLexerMode.PSEUDO_SELECTOR);
|
||||
}
|
||||
|
||||
@ -374,7 +374,7 @@ export function main() {
|
||||
|
||||
describe('Style Block Mode', () => {
|
||||
it('should style blocks with a reduced subset of valid characters', () => {
|
||||
function tokenizeStyles(code) { return tokenize(code, false, CssLexerMode.STYLE_BLOCK); }
|
||||
function tokenizeStyles(code: any /** TODO #9100 */) { return tokenize(code, false, CssLexerMode.STYLE_BLOCK); }
|
||||
|
||||
expect(tokenizeStyles(`
|
||||
key: value;
|
||||
|
Reference in New Issue
Block a user