From 12ad9d0aaf622c91d7551b577bf6de5df2304b22 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Fri, 2 Sep 2016 13:39:56 -0700 Subject: [PATCH 01/44] Search for `node_modules` in parent directories when getting type roots. --- src/compiler/program.ts | 37 ++++- .../reference/library-reference-11.trace.json | 6 +- .../reference/library-reference-12.trace.json | 6 +- .../reference/library-reference-3.trace.json | 6 +- .../reference/library-reference-7.trace.json | 6 +- ...RootsFromMultipleNodeModulesDirectories.js | 31 ++++ ...FromMultipleNodeModulesDirectories.symbols | 34 ++++ ...mMultipleNodeModulesDirectories.trace.json | 157 ++++++++++++++++++ ...tsFromMultipleNodeModulesDirectories.types | 36 ++++ ...peRootsFromNodeModulesInParentDirectory.js | 17 ++ ...tsFromNodeModulesInParentDirectory.symbols | 14 ++ ...romNodeModulesInParentDirectory.trace.json | 39 +++++ ...ootsFromNodeModulesInParentDirectory.types | 14 ++ ...RootsFromMultipleNodeModulesDirectories.ts | 27 +++ ...peRootsFromNodeModulesInParentDirectory.ts | 15 ++ 15 files changed, 422 insertions(+), 23 deletions(-) create mode 100644 tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.js create mode 100644 tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.symbols create mode 100644 tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.trace.json create mode 100644 tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.types create mode 100644 tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.js create mode 100644 tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.symbols create mode 100644 tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.trace.json create mode 100644 tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.types create mode 100644 tests/cases/compiler/typeRootsFromMultipleNodeModulesDirectories.ts create mode 100644 tests/cases/compiler/typeRootsFromNodeModulesInParentDirectory.ts diff --git a/src/compiler/program.ts b/src/compiler/program.ts index dac3374ab15..9d9af0fe842 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -9,8 +9,6 @@ namespace ts { const emptyArray: any[] = []; - const defaultTypeRoots = ["node_modules/@types"]; - export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean): string { while (true) { const fileName = combinePaths(searchPath, "tsconfig.json"); @@ -169,7 +167,7 @@ namespace ts { const typeReferenceExtensions = [".d.ts"]; - function getEffectiveTypeRoots(options: CompilerOptions, host: ModuleResolutionHost) { + function getEffectiveTypeRoots(options: CompilerOptions, host: ModuleResolutionHost): string[] | undefined { if (options.typeRoots) { return options.typeRoots; } @@ -182,12 +180,37 @@ namespace ts { currentDirectory = host.getCurrentDirectory(); } - if (!currentDirectory) { - return undefined; - } - return map(defaultTypeRoots, d => combinePaths(currentDirectory, d)); + return currentDirectory && getDefaultTypeRoots(currentDirectory, host); } + /** + * Returns the path to every node_modules/@types directory from some ancestor directory. + * Returns undefined if there are none. + */ + function getDefaultTypeRoots(currentDirectory: string, host: ModuleResolutionHost): string[] | undefined { + if (!host.directoryExists) { + return [combinePaths(currentDirectory, nodeModulesAtTypes)]; + } + + let typeRoots: string[]; + + while (true) { + const atTypes = combinePaths(currentDirectory, nodeModulesAtTypes); + if (host.directoryExists(atTypes)) { + (typeRoots || (typeRoots = [])).push(atTypes); + } + + const parent = getDirectoryPath(currentDirectory); + if (parent === currentDirectory) { + break; + } + currentDirectory = parent; + } + + return typeRoots; + } + const nodeModulesAtTypes = combinePaths("node_modules", "@types"); + /** * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown. * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups diff --git a/tests/baselines/reference/library-reference-11.trace.json b/tests/baselines/reference/library-reference-11.trace.json index 365fe3ce72d..e0af1e39c5a 100644 --- a/tests/baselines/reference/library-reference-11.trace.json +++ b/tests/baselines/reference/library-reference-11.trace.json @@ -1,8 +1,6 @@ [ - "======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory '/node_modules/@types'. ========", - "Resolving with primary search path '/node_modules/@types'", - "File '/node_modules/@types/jquery/package.json' does not exist.", - "File '/node_modules/@types/jquery/index.d.ts' does not exist.", + "======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory not set. ========", + "Root directory cannot be determined, skipping primary search paths.", "Looking up in 'node_modules' folder, initial location '/a/b'", "File '/a/b/node_modules/jquery.ts' does not exist.", "File '/a/b/node_modules/jquery.d.ts' does not exist.", diff --git a/tests/baselines/reference/library-reference-12.trace.json b/tests/baselines/reference/library-reference-12.trace.json index 84144f82729..2cdf1f5f20a 100644 --- a/tests/baselines/reference/library-reference-12.trace.json +++ b/tests/baselines/reference/library-reference-12.trace.json @@ -1,8 +1,6 @@ [ - "======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory '/node_modules/@types'. ========", - "Resolving with primary search path '/node_modules/@types'", - "File '/node_modules/@types/jquery/package.json' does not exist.", - "File '/node_modules/@types/jquery/index.d.ts' does not exist.", + "======== Resolving type reference directive 'jquery', containing file '/a/b/consumer.ts', root directory not set. ========", + "Root directory cannot be determined, skipping primary search paths.", "Looking up in 'node_modules' folder, initial location '/a/b'", "File '/a/b/node_modules/jquery.ts' does not exist.", "File '/a/b/node_modules/jquery.d.ts' does not exist.", diff --git a/tests/baselines/reference/library-reference-3.trace.json b/tests/baselines/reference/library-reference-3.trace.json index 730835c65e9..419fe6d055d 100644 --- a/tests/baselines/reference/library-reference-3.trace.json +++ b/tests/baselines/reference/library-reference-3.trace.json @@ -1,8 +1,6 @@ [ - "======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory '/src/node_modules/@types'. ========", - "Resolving with primary search path '/src/node_modules/@types'", - "File '/src/node_modules/@types/jquery/package.json' does not exist.", - "File '/src/node_modules/@types/jquery/index.d.ts' does not exist.", + "======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory not set. ========", + "Root directory cannot be determined, skipping primary search paths.", "Looking up in 'node_modules' folder, initial location '/src'", "File '/src/node_modules/jquery.ts' does not exist.", "File '/src/node_modules/jquery.d.ts' does not exist.", diff --git a/tests/baselines/reference/library-reference-7.trace.json b/tests/baselines/reference/library-reference-7.trace.json index b681ea312a8..419fe6d055d 100644 --- a/tests/baselines/reference/library-reference-7.trace.json +++ b/tests/baselines/reference/library-reference-7.trace.json @@ -1,8 +1,6 @@ [ - "======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory '/node_modules/@types'. ========", - "Resolving with primary search path '/node_modules/@types'", - "File '/node_modules/@types/jquery/package.json' does not exist.", - "File '/node_modules/@types/jquery/index.d.ts' does not exist.", + "======== Resolving type reference directive 'jquery', containing file '/src/consumer.ts', root directory not set. ========", + "Root directory cannot be determined, skipping primary search paths.", "Looking up in 'node_modules' folder, initial location '/src'", "File '/src/node_modules/jquery.ts' does not exist.", "File '/src/node_modules/jquery.d.ts' does not exist.", diff --git a/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.js b/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.js new file mode 100644 index 00000000000..a2542ca9cc0 --- /dev/null +++ b/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/typeRootsFromMultipleNodeModulesDirectories.ts] //// + +//// [index.d.ts] + +declare module "xyz" { + export const x: number; +} + +//// [index.d.ts] +declare module "pdq" { + export const y: number; +} + +//// [index.d.ts] +declare module "abc" { + export const z: number; +} + +//// [a.ts] +import { x } from "xyz"; +import { y } from "pdq"; +import { z } from "abc"; +x + y + z; + + +//// [a.js] +"use strict"; +var xyz_1 = require("xyz"); +var pdq_1 = require("pdq"); +var abc_1 = require("abc"); +xyz_1.x + pdq_1.y + abc_1.z; diff --git a/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.symbols b/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.symbols new file mode 100644 index 00000000000..67fd371f8ee --- /dev/null +++ b/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.symbols @@ -0,0 +1,34 @@ +=== /foo/bar/a.ts === +import { x } from "xyz"; +>x : Symbol(x, Decl(a.ts, 0, 8)) + +import { y } from "pdq"; +>y : Symbol(y, Decl(a.ts, 1, 8)) + +import { z } from "abc"; +>z : Symbol(z, Decl(a.ts, 2, 8)) + +x + y + z; +>x : Symbol(x, Decl(a.ts, 0, 8)) +>y : Symbol(y, Decl(a.ts, 1, 8)) +>z : Symbol(z, Decl(a.ts, 2, 8)) + +=== /node_modules/@types/dopey/index.d.ts === + +declare module "xyz" { + export const x: number; +>x : Symbol(x, Decl(index.d.ts, 2, 16)) +} + +=== /foo/node_modules/@types/grumpy/index.d.ts === +declare module "pdq" { + export const y: number; +>y : Symbol(y, Decl(index.d.ts, 1, 16)) +} + +=== /foo/node_modules/@types/sneezy/index.d.ts === +declare module "abc" { + export const z: number; +>z : Symbol(z, Decl(index.d.ts, 1, 16)) +} + diff --git a/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.trace.json b/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.trace.json new file mode 100644 index 00000000000..c734e57cda2 --- /dev/null +++ b/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.trace.json @@ -0,0 +1,157 @@ +[ + "======== Resolving module 'xyz' from '/foo/bar/a.ts'. ========", + "Module resolution kind is not specified, using 'NodeJs'.", + "Loading module 'xyz' from 'node_modules' folder.", + "File '/foo/bar/node_modules/xyz.ts' does not exist.", + "File '/foo/bar/node_modules/xyz.tsx' does not exist.", + "File '/foo/bar/node_modules/xyz.d.ts' does not exist.", + "File '/foo/bar/node_modules/xyz/package.json' does not exist.", + "File '/foo/bar/node_modules/xyz/index.ts' does not exist.", + "File '/foo/bar/node_modules/xyz/index.tsx' does not exist.", + "File '/foo/bar/node_modules/xyz/index.d.ts' does not exist.", + "File '/foo/bar/node_modules/@types/xyz.ts' does not exist.", + "File '/foo/bar/node_modules/@types/xyz.tsx' does not exist.", + "File '/foo/bar/node_modules/@types/xyz.d.ts' does not exist.", + "File '/foo/bar/node_modules/@types/xyz/package.json' does not exist.", + "File '/foo/bar/node_modules/@types/xyz/index.ts' does not exist.", + "File '/foo/bar/node_modules/@types/xyz/index.tsx' does not exist.", + "File '/foo/bar/node_modules/@types/xyz/index.d.ts' does not exist.", + "File '/foo/node_modules/xyz.ts' does not exist.", + "File '/foo/node_modules/xyz.tsx' does not exist.", + "File '/foo/node_modules/xyz.d.ts' does not exist.", + "File '/foo/node_modules/xyz/package.json' does not exist.", + "File '/foo/node_modules/xyz/index.ts' does not exist.", + "File '/foo/node_modules/xyz/index.tsx' does not exist.", + "File '/foo/node_modules/xyz/index.d.ts' does not exist.", + "File '/foo/node_modules/@types/xyz.ts' does not exist.", + "File '/foo/node_modules/@types/xyz.tsx' does not exist.", + "File '/foo/node_modules/@types/xyz.d.ts' does not exist.", + "File '/foo/node_modules/@types/xyz/package.json' does not exist.", + "File '/foo/node_modules/@types/xyz/index.ts' does not exist.", + "File '/foo/node_modules/@types/xyz/index.tsx' does not exist.", + "File '/foo/node_modules/@types/xyz/index.d.ts' does not exist.", + "File '/node_modules/xyz.ts' does not exist.", + "File '/node_modules/xyz.tsx' does not exist.", + "File '/node_modules/xyz.d.ts' does not exist.", + "File '/node_modules/xyz/package.json' does not exist.", + "File '/node_modules/xyz/index.ts' does not exist.", + "File '/node_modules/xyz/index.tsx' does not exist.", + "File '/node_modules/xyz/index.d.ts' does not exist.", + "File '/node_modules/@types/xyz.ts' does not exist.", + "File '/node_modules/@types/xyz.tsx' does not exist.", + "File '/node_modules/@types/xyz.d.ts' does not exist.", + "File '/node_modules/@types/xyz/package.json' does not exist.", + "File '/node_modules/@types/xyz/index.ts' does not exist.", + "File '/node_modules/@types/xyz/index.tsx' does not exist.", + "File '/node_modules/@types/xyz/index.d.ts' does not exist.", + "======== Module name 'xyz' was not resolved. ========", + "======== Resolving module 'pdq' from '/foo/bar/a.ts'. ========", + "Module resolution kind is not specified, using 'NodeJs'.", + "Loading module 'pdq' from 'node_modules' folder.", + "File '/foo/bar/node_modules/pdq.ts' does not exist.", + "File '/foo/bar/node_modules/pdq.tsx' does not exist.", + "File '/foo/bar/node_modules/pdq.d.ts' does not exist.", + "File '/foo/bar/node_modules/pdq/package.json' does not exist.", + "File '/foo/bar/node_modules/pdq/index.ts' does not exist.", + "File '/foo/bar/node_modules/pdq/index.tsx' does not exist.", + "File '/foo/bar/node_modules/pdq/index.d.ts' does not exist.", + "File '/foo/bar/node_modules/@types/pdq.ts' does not exist.", + "File '/foo/bar/node_modules/@types/pdq.tsx' does not exist.", + "File '/foo/bar/node_modules/@types/pdq.d.ts' does not exist.", + "File '/foo/bar/node_modules/@types/pdq/package.json' does not exist.", + "File '/foo/bar/node_modules/@types/pdq/index.ts' does not exist.", + "File '/foo/bar/node_modules/@types/pdq/index.tsx' does not exist.", + "File '/foo/bar/node_modules/@types/pdq/index.d.ts' does not exist.", + "File '/foo/node_modules/pdq.ts' does not exist.", + "File '/foo/node_modules/pdq.tsx' does not exist.", + "File '/foo/node_modules/pdq.d.ts' does not exist.", + "File '/foo/node_modules/pdq/package.json' does not exist.", + "File '/foo/node_modules/pdq/index.ts' does not exist.", + "File '/foo/node_modules/pdq/index.tsx' does not exist.", + "File '/foo/node_modules/pdq/index.d.ts' does not exist.", + "File '/foo/node_modules/@types/pdq.ts' does not exist.", + "File '/foo/node_modules/@types/pdq.tsx' does not exist.", + "File '/foo/node_modules/@types/pdq.d.ts' does not exist.", + "File '/foo/node_modules/@types/pdq/package.json' does not exist.", + "File '/foo/node_modules/@types/pdq/index.ts' does not exist.", + "File '/foo/node_modules/@types/pdq/index.tsx' does not exist.", + "File '/foo/node_modules/@types/pdq/index.d.ts' does not exist.", + "File '/node_modules/pdq.ts' does not exist.", + "File '/node_modules/pdq.tsx' does not exist.", + "File '/node_modules/pdq.d.ts' does not exist.", + "File '/node_modules/pdq/package.json' does not exist.", + "File '/node_modules/pdq/index.ts' does not exist.", + "File '/node_modules/pdq/index.tsx' does not exist.", + "File '/node_modules/pdq/index.d.ts' does not exist.", + "File '/node_modules/@types/pdq.ts' does not exist.", + "File '/node_modules/@types/pdq.tsx' does not exist.", + "File '/node_modules/@types/pdq.d.ts' does not exist.", + "File '/node_modules/@types/pdq/package.json' does not exist.", + "File '/node_modules/@types/pdq/index.ts' does not exist.", + "File '/node_modules/@types/pdq/index.tsx' does not exist.", + "File '/node_modules/@types/pdq/index.d.ts' does not exist.", + "======== Module name 'pdq' was not resolved. ========", + "======== Resolving module 'abc' from '/foo/bar/a.ts'. ========", + "Module resolution kind is not specified, using 'NodeJs'.", + "Loading module 'abc' from 'node_modules' folder.", + "File '/foo/bar/node_modules/abc.ts' does not exist.", + "File '/foo/bar/node_modules/abc.tsx' does not exist.", + "File '/foo/bar/node_modules/abc.d.ts' does not exist.", + "File '/foo/bar/node_modules/abc/package.json' does not exist.", + "File '/foo/bar/node_modules/abc/index.ts' does not exist.", + "File '/foo/bar/node_modules/abc/index.tsx' does not exist.", + "File '/foo/bar/node_modules/abc/index.d.ts' does not exist.", + "File '/foo/bar/node_modules/@types/abc.ts' does not exist.", + "File '/foo/bar/node_modules/@types/abc.tsx' does not exist.", + "File '/foo/bar/node_modules/@types/abc.d.ts' does not exist.", + "File '/foo/bar/node_modules/@types/abc/package.json' does not exist.", + "File '/foo/bar/node_modules/@types/abc/index.ts' does not exist.", + "File '/foo/bar/node_modules/@types/abc/index.tsx' does not exist.", + "File '/foo/bar/node_modules/@types/abc/index.d.ts' does not exist.", + "File '/foo/node_modules/abc.ts' does not exist.", + "File '/foo/node_modules/abc.tsx' does not exist.", + "File '/foo/node_modules/abc.d.ts' does not exist.", + "File '/foo/node_modules/abc/package.json' does not exist.", + "File '/foo/node_modules/abc/index.ts' does not exist.", + "File '/foo/node_modules/abc/index.tsx' does not exist.", + "File '/foo/node_modules/abc/index.d.ts' does not exist.", + "File '/foo/node_modules/@types/abc.ts' does not exist.", + "File '/foo/node_modules/@types/abc.tsx' does not exist.", + "File '/foo/node_modules/@types/abc.d.ts' does not exist.", + "File '/foo/node_modules/@types/abc/package.json' does not exist.", + "File '/foo/node_modules/@types/abc/index.ts' does not exist.", + "File '/foo/node_modules/@types/abc/index.tsx' does not exist.", + "File '/foo/node_modules/@types/abc/index.d.ts' does not exist.", + "File '/node_modules/abc.ts' does not exist.", + "File '/node_modules/abc.tsx' does not exist.", + "File '/node_modules/abc.d.ts' does not exist.", + "File '/node_modules/abc/package.json' does not exist.", + "File '/node_modules/abc/index.ts' does not exist.", + "File '/node_modules/abc/index.tsx' does not exist.", + "File '/node_modules/abc/index.d.ts' does not exist.", + "File '/node_modules/@types/abc.ts' does not exist.", + "File '/node_modules/@types/abc.tsx' does not exist.", + "File '/node_modules/@types/abc.d.ts' does not exist.", + "File '/node_modules/@types/abc/package.json' does not exist.", + "File '/node_modules/@types/abc/index.ts' does not exist.", + "File '/node_modules/@types/abc/index.tsx' does not exist.", + "File '/node_modules/@types/abc/index.d.ts' does not exist.", + "======== Module name 'abc' was not resolved. ========", + "======== Resolving type reference directive 'grumpy', containing file '/src/__inferred type names__.ts', root directory '/foo/node_modules/@types,/node_modules/@types'. ========", + "Resolving with primary search path '/foo/node_modules/@types, /node_modules/@types'", + "File '/foo/node_modules/@types/grumpy/package.json' does not exist.", + "File '/foo/node_modules/@types/grumpy/index.d.ts' exist - use it as a name resolution result.", + "======== Type reference directive 'grumpy' was successfully resolved to '/foo/node_modules/@types/grumpy/index.d.ts', primary: true. ========", + "======== Resolving type reference directive 'sneezy', containing file '/src/__inferred type names__.ts', root directory '/foo/node_modules/@types,/node_modules/@types'. ========", + "Resolving with primary search path '/foo/node_modules/@types, /node_modules/@types'", + "File '/foo/node_modules/@types/sneezy/package.json' does not exist.", + "File '/foo/node_modules/@types/sneezy/index.d.ts' exist - use it as a name resolution result.", + "======== Type reference directive 'sneezy' was successfully resolved to '/foo/node_modules/@types/sneezy/index.d.ts', primary: true. ========", + "======== Resolving type reference directive 'dopey', containing file '/src/__inferred type names__.ts', root directory '/foo/node_modules/@types,/node_modules/@types'. ========", + "Resolving with primary search path '/foo/node_modules/@types, /node_modules/@types'", + "File '/foo/node_modules/@types/dopey/package.json' does not exist.", + "File '/foo/node_modules/@types/dopey/index.d.ts' does not exist.", + "File '/node_modules/@types/dopey/package.json' does not exist.", + "File '/node_modules/@types/dopey/index.d.ts' exist - use it as a name resolution result.", + "======== Type reference directive 'dopey' was successfully resolved to '/node_modules/@types/dopey/index.d.ts', primary: true. ========" +] \ No newline at end of file diff --git a/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.types b/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.types new file mode 100644 index 00000000000..c47be9cdab3 --- /dev/null +++ b/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.types @@ -0,0 +1,36 @@ +=== /foo/bar/a.ts === +import { x } from "xyz"; +>x : number + +import { y } from "pdq"; +>y : number + +import { z } from "abc"; +>z : number + +x + y + z; +>x + y + z : number +>x + y : number +>x : number +>y : number +>z : number + +=== /node_modules/@types/dopey/index.d.ts === + +declare module "xyz" { + export const x: number; +>x : number +} + +=== /foo/node_modules/@types/grumpy/index.d.ts === +declare module "pdq" { + export const y: number; +>y : number +} + +=== /foo/node_modules/@types/sneezy/index.d.ts === +declare module "abc" { + export const z: number; +>z : number +} + diff --git a/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.js b/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.js new file mode 100644 index 00000000000..9e93755d1f0 --- /dev/null +++ b/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.js @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/typeRootsFromNodeModulesInParentDirectory.ts] //// + +//// [index.d.ts] + +declare module "xyz" { + export const x: number; +} + +//// [a.ts] +import { x } from "xyz"; +x; + + +//// [a.js] +"use strict"; +var xyz_1 = require("xyz"); +xyz_1.x; diff --git a/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.symbols b/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.symbols new file mode 100644 index 00000000000..10cbdaa3c53 --- /dev/null +++ b/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.symbols @@ -0,0 +1,14 @@ +=== /src/a.ts === +import { x } from "xyz"; +>x : Symbol(x, Decl(a.ts, 0, 8)) + +x; +>x : Symbol(x, Decl(a.ts, 0, 8)) + +=== /node_modules/@types/foo/index.d.ts === + +declare module "xyz" { + export const x: number; +>x : Symbol(x, Decl(index.d.ts, 2, 16)) +} + diff --git a/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.trace.json b/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.trace.json new file mode 100644 index 00000000000..7782ffc4ebf --- /dev/null +++ b/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.trace.json @@ -0,0 +1,39 @@ +[ + "======== Resolving module 'xyz' from '/src/a.ts'. ========", + "Module resolution kind is not specified, using 'NodeJs'.", + "Loading module 'xyz' from 'node_modules' folder.", + "File '/src/node_modules/xyz.ts' does not exist.", + "File '/src/node_modules/xyz.tsx' does not exist.", + "File '/src/node_modules/xyz.d.ts' does not exist.", + "File '/src/node_modules/xyz/package.json' does not exist.", + "File '/src/node_modules/xyz/index.ts' does not exist.", + "File '/src/node_modules/xyz/index.tsx' does not exist.", + "File '/src/node_modules/xyz/index.d.ts' does not exist.", + "File '/src/node_modules/@types/xyz.ts' does not exist.", + "File '/src/node_modules/@types/xyz.tsx' does not exist.", + "File '/src/node_modules/@types/xyz.d.ts' does not exist.", + "File '/src/node_modules/@types/xyz/package.json' does not exist.", + "File '/src/node_modules/@types/xyz/index.ts' does not exist.", + "File '/src/node_modules/@types/xyz/index.tsx' does not exist.", + "File '/src/node_modules/@types/xyz/index.d.ts' does not exist.", + "File '/node_modules/xyz.ts' does not exist.", + "File '/node_modules/xyz.tsx' does not exist.", + "File '/node_modules/xyz.d.ts' does not exist.", + "File '/node_modules/xyz/package.json' does not exist.", + "File '/node_modules/xyz/index.ts' does not exist.", + "File '/node_modules/xyz/index.tsx' does not exist.", + "File '/node_modules/xyz/index.d.ts' does not exist.", + "File '/node_modules/@types/xyz.ts' does not exist.", + "File '/node_modules/@types/xyz.tsx' does not exist.", + "File '/node_modules/@types/xyz.d.ts' does not exist.", + "File '/node_modules/@types/xyz/package.json' does not exist.", + "File '/node_modules/@types/xyz/index.ts' does not exist.", + "File '/node_modules/@types/xyz/index.tsx' does not exist.", + "File '/node_modules/@types/xyz/index.d.ts' does not exist.", + "======== Module name 'xyz' was not resolved. ========", + "======== Resolving type reference directive 'foo', containing file '/src/__inferred type names__.ts', root directory '/node_modules/@types'. ========", + "Resolving with primary search path '/node_modules/@types'", + "File '/node_modules/@types/foo/package.json' does not exist.", + "File '/node_modules/@types/foo/index.d.ts' exist - use it as a name resolution result.", + "======== Type reference directive 'foo' was successfully resolved to '/node_modules/@types/foo/index.d.ts', primary: true. ========" +] \ No newline at end of file diff --git a/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.types b/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.types new file mode 100644 index 00000000000..532a05fcb87 --- /dev/null +++ b/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.types @@ -0,0 +1,14 @@ +=== /src/a.ts === +import { x } from "xyz"; +>x : number + +x; +>x : number + +=== /node_modules/@types/foo/index.d.ts === + +declare module "xyz" { + export const x: number; +>x : number +} + diff --git a/tests/cases/compiler/typeRootsFromMultipleNodeModulesDirectories.ts b/tests/cases/compiler/typeRootsFromMultipleNodeModulesDirectories.ts new file mode 100644 index 00000000000..b7f194706a8 --- /dev/null +++ b/tests/cases/compiler/typeRootsFromMultipleNodeModulesDirectories.ts @@ -0,0 +1,27 @@ +// @noImplicitReferences: true +// @traceResolution: true +// @currentDirectory: /src + +// @Filename: /node_modules/@types/dopey/index.d.ts +declare module "xyz" { + export const x: number; +} + +// @Filename: /foo/node_modules/@types/grumpy/index.d.ts +declare module "pdq" { + export const y: number; +} + +// @Filename: /foo/node_modules/@types/sneezy/index.d.ts +declare module "abc" { + export const z: number; +} + +// @Filename: /foo/bar/a.ts +import { x } from "xyz"; +import { y } from "pdq"; +import { z } from "abc"; +x + y + z; + +// @Filename: /foo/bar/tsconfig.json +{} diff --git a/tests/cases/compiler/typeRootsFromNodeModulesInParentDirectory.ts b/tests/cases/compiler/typeRootsFromNodeModulesInParentDirectory.ts new file mode 100644 index 00000000000..59b7d6a3188 --- /dev/null +++ b/tests/cases/compiler/typeRootsFromNodeModulesInParentDirectory.ts @@ -0,0 +1,15 @@ +// @noImplicitReferences: true +// @traceResolution: true +// @currentDirectory: /src + +// @Filename: /node_modules/@types/foo/index.d.ts +declare module "xyz" { + export const x: number; +} + +// @Filename: /src/a.ts +import { x } from "xyz"; +x; + +// @Filename: /src/tsconfig.json +{} From b7289729a5cd60bf1b83dc84ecb6c06595697f09 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 4 Sep 2016 07:50:32 -0700 Subject: [PATCH 02/44] Introduce resolvingSignature to ensure caching works for anySignature --- src/compiler/checker.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d38ce359e8b..0d3c69f6b68 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -143,6 +143,7 @@ namespace ts { const anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); const unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + const resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); const enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true); @@ -12205,10 +12206,10 @@ namespace ts { // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work // to correctly fill the candidatesOutArray. const cached = links.resolvedSignature; - if (cached && cached !== anySignature && !candidatesOutArray) { + if (cached && cached !== resolvingSignature && !candidatesOutArray) { return cached; } - links.resolvedSignature = anySignature; + links.resolvedSignature = resolvingSignature; const result = resolveSignature(node, candidatesOutArray); // If signature resolution originated in control flow type analysis (for example to compute the // assigned type in a flow assignment) we don't cache the result as it may be based on temporary @@ -12220,7 +12221,7 @@ namespace ts { function getResolvedOrAnySignature(node: CallLikeExpression) { // If we're already in the process of resolving the given signature, don't resolve again as // that could cause infinite recursion. Instead, return anySignature. - return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node); + return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node); } function getInferredClassType(symbol: Symbol) { From 9adc26c3fd762fb8c1602d22feef3ec7bce317c7 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 4 Sep 2016 11:43:35 -0700 Subject: [PATCH 03/44] Add repro from #10697 --- .../reference/fixSignatureCaching.errors.txt | 2200 +++++++++++++++++ .../reference/fixSignatureCaching.js | 1902 ++++++++++++++ .../cases/conformance/fixSignatureCaching.ts | 985 ++++++++ 3 files changed, 5087 insertions(+) create mode 100644 tests/baselines/reference/fixSignatureCaching.errors.txt create mode 100644 tests/baselines/reference/fixSignatureCaching.js create mode 100644 tests/cases/conformance/fixSignatureCaching.ts diff --git a/tests/baselines/reference/fixSignatureCaching.errors.txt b/tests/baselines/reference/fixSignatureCaching.errors.txt new file mode 100644 index 00000000000..6677afc174a --- /dev/null +++ b/tests/baselines/reference/fixSignatureCaching.errors.txt @@ -0,0 +1,2200 @@ +tests/cases/conformance/fixSignatureCaching.ts(3,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/fixSignatureCaching.ts(9,10): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(284,10): error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(293,10): error TS2339: Property 'FALLBACK_PHONE' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(294,10): error TS2339: Property 'FALLBACK_TABLET' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(295,10): error TS2339: Property 'FALLBACK_MOBILE' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(327,74): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(366,10): error TS2339: Property 'findMatch' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(384,10): error TS2339: Property 'findMatches' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(404,10): error TS2339: Property 'getVersionStr' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(405,26): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(428,10): error TS2339: Property 'getVersion' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(429,28): error TS2339: Property 'getVersionStr' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(430,31): error TS2339: Property 'prepareVersionNo' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(440,10): error TS2339: Property 'prepareVersionNo' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(455,10): error TS2339: Property 'isMobileFallback' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(456,21): error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(457,18): error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(460,10): error TS2339: Property 'isTabletFallback' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(461,21): error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(464,10): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(471,23): error TS2339: Property 'findMatch' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(471,38): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(478,22): error TS2339: Property 'findMatch' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(478,37): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(486,18): error TS2339: Property 'isMobileFallback' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(487,39): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. +tests/cases/conformance/fixSignatureCaching.ts(489,37): error TS2339: Property 'FALLBACK_MOBILE' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(492,51): error TS2339: Property 'FALLBACK_PHONE' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(495,52): error TS2339: Property 'FALLBACK_TABLET' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(498,25): error TS2339: Property 'isTabletFallback' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(499,48): error TS2339: Property 'FALLBACK_TABLET' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(508,10): error TS2339: Property 'mobileGrade' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(633,10): error TS2339: Property 'detectOS' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(634,21): error TS2339: Property 'findMatch' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(634,36): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(635,18): error TS2339: Property 'findMatch' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(635,33): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(638,10): error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(639,16): error TS2304: Cannot find name 'window'. +tests/cases/conformance/fixSignatureCaching.ts(639,38): error TS2304: Cannot find name 'window'. +tests/cases/conformance/fixSignatureCaching.ts(640,13): error TS2304: Cannot find name 'window'. +tests/cases/conformance/fixSignatureCaching.ts(641,13): error TS2304: Cannot find name 'window'. +tests/cases/conformance/fixSignatureCaching.ts(704,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(734,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(783,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(805,46): error TS2339: Property 'findMatch' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(805,61): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(828,47): error TS2339: Property 'findMatches' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(828,64): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(845,39): error TS2339: Property 'detectOS' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(869,25): error TS2339: Property 'getVersion' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(890,25): error TS2339: Property 'getVersionStr' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(912,36): error TS2339: Property 'findMatches' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(912,53): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(941,33): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. +tests/cases/conformance/fixSignatureCaching.ts(952,42): error TS2339: Property 'mobileGrade' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(959,16): error TS2304: Cannot find name 'window'. +tests/cases/conformance/fixSignatureCaching.ts(959,42): error TS2304: Cannot find name 'window'. +tests/cases/conformance/fixSignatureCaching.ts(960,22): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. +tests/cases/conformance/fixSignatureCaching.ts(961,57): error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'. +tests/cases/conformance/fixSignatureCaching.ts(964,22): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. +tests/cases/conformance/fixSignatureCaching.ts(968,18): error TS2339: Property '_impl' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. +tests/cases/conformance/fixSignatureCaching.ts(970,18): error TS2339: Property 'version' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. +tests/cases/conformance/fixSignatureCaching.ts(974,4): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/fixSignatureCaching.ts(975,16): error TS2304: Cannot find name 'module'. +tests/cases/conformance/fixSignatureCaching.ts(975,42): error TS2304: Cannot find name 'module'. +tests/cases/conformance/fixSignatureCaching.ts(976,37): error TS2304: Cannot find name 'module'. +tests/cases/conformance/fixSignatureCaching.ts(977,23): error TS2304: Cannot find name 'define'. +tests/cases/conformance/fixSignatureCaching.ts(977,48): error TS2304: Cannot find name 'define'. +tests/cases/conformance/fixSignatureCaching.ts(978,16): error TS2304: Cannot find name 'define'. +tests/cases/conformance/fixSignatureCaching.ts(979,23): error TS2304: Cannot find name 'window'. +tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot find name 'window'. + + +==== tests/cases/conformance/fixSignatureCaching.ts (73 errors) ==== + // Repro from #10697 + + (function (define, undefined) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + define(function () { + ~~~~~~~~~~~~~~~~~~~~ + 'use strict'; + ~~~~~~~~~~~~~~~~~ + + + var impl = {}; + ~~~~~~~~~~~~~~~~~~ + + + impl.mobileDetectRules = { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + "phones": { + ~~~~~~~~~~~~~~~ + "iPhone": "\\biPhone\\b|\\biPod\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "BlackBerry": "BlackBerry|\\bBB10\\b|rim[0-9]+", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "HTC": "HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Nexus": "Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Dell": "Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Motorola": "Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Samsung": "Samsung|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "LG": "\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Sony": "SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Asus": "Asus.*Galaxy|PadFone.*Mobile", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "NokiaLumia": "Lumia [0-9]{3,4}", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Micromax": "Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Palm": "PalmSource|Palm", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Vertu": "Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Pantech": "PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Fly": "IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Wiko": "KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "iMobile": "i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "SimValley": "\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Wolfgang": "AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Alcatel": "Alcatel", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Nintendo": "Nintendo 3DS", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Amoi": "Amoi", + ~~~~~~~~~~~~~~~~~~~~~~~ + "INQ": "INQ", + ~~~~~~~~~~~~~~~~~~~~~ + "GenericPhone": "Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~ + "tablets": { + ~~~~~~~~~~~~~~~~ + "iPad": "iPad|iPad.*Mobile", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "NexusTablet": "Android.*Nexus[\\s]+(7|9|10)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "SamsungTablet": "SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Kindle": "Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "SurfaceTablet": "Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "HPTablet": "HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "AsusTablet": "^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K017 |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "BlackBerryTablet": "PlayBook|RIM Tablet", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "HTCtablet": "HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MotorolaTablet": "xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "NookTablet": "Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "AcerTablet": "Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "ToshibaTablet": "Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "LGTablet": "\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "FujitsuTablet": "Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PrestigioTablet": "PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "LenovoTablet": "Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "DellTablet": "Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "YarvikTablet": "Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MedionTablet": "Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "ArnovaTablet": "AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "IntensoTablet": "INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "IRUTablet": "M702pro", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MegafonTablet": "MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "EbodaTablet": "E-Boda (Supreme|Impresspeed|Izzycomm|Essential)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "AllViewTablet": "Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "ArchosTablet": "\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "AinolTablet": "NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "NokiaLumiaTablet": "Lumia 2520", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "SonyTablet": "Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612|SOT31", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PhilipsTablet": "\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "CubeTablet": "Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "CobyTablet": "MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MIDTablet": "M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MSITablet": "MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "SMiTTablet": "Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "RockChipTablet": "Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "FlyTablet": "IQ310|Fly Vision", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "bqTablet": "Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris E10)|Maxwell.*Lite|Maxwell.*Plus", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "HuaweiTablet": "MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "NecTablet": "\\bN-06D|\\bN-08D", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PantechTablet": "Pantech.*P4100", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "BronchoTablet": "Broncho.*(N701|N708|N802|a710)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "VersusTablet": "TOUCHPAD.*[78910]|\\bTOUCHTAB\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "ZyncTablet": "z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PositivoTablet": "TB07STA|TB10STA|TB07FTA|TB10FTA", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "NabiTablet": "Android.*\\bNabi", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "KoboTablet": "Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "DanewTablet": "DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "TexetTablet": "NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PlaystationTablet": "Playstation.*(Portable|Vita)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "TrekstorTablet": "ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PyleAudioTablet": "\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "AdvanTablet": "Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "DanyTechTablet": "Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "GalapadTablet": "Android.*\\bG1\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MicromaxTablet": "Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "KarbonnTablet": "Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "AllFineTablet": "Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PROSCANTablet": "\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "YONESTablet": "BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "ChangJiaTablet": "TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "GUTablet": "TX-A1301|TX-M9002|Q702|kf026", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PointOfViewTablet": "TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "OvermaxTablet": "OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "HCLTablet": "HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "DPSTablet": "DPS Dream 9|DPS Dual 7", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "VistureTablet": "V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "CrestaTablet": "CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MediatekTablet": "\\bMT8125|MT8389|MT8135|MT8377\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "ConcordeTablet": "Concorde([ ]+)?Tab|ConCorde ReadMan", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "GoCleverTablet": "GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "ModecomTablet": "FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "VoninoTablet": "\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "ECSTablet": "V07OT2|TM105A|S10OT1|TR10CS1", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "StorexTablet": "eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "VodafoneTablet": "SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "EssentielBTablet": "Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "RossMoorTablet": "RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "iMobileTablet": "i-mobile i-note", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "TolinoTablet": "tolino tab [0-9.]+|tolino shine", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "AudioSonicTablet": "\\bC-22Q|T7-QC|T-17B|T-17P\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "AMPETablet": "Android.* A78 ", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "SkkTablet": "Android.* (SKYPAD|PHOENIX|CYCLOPS)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "TecnoTablet": "TECNO P9", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "JXDTablet": "Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "iJoyTablet": "Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "FX2Tablet": "FX2 PAD7|FX2 PAD10", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "XoroTablet": "KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "ViewsonicTablet": "ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "OdysTablet": "LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "CaptivaTablet": "CAPTIVA PAD", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "IconbitTablet": "NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "TeclastTablet": "T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "OndaTablet": "\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "JaytechTablet": "TPC-PA762", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "BlaupunktTablet": "Endeavour 800NG|Endeavour 1010", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "DigmaTablet": "\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "EvolioTablet": "ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "LavaTablet": "QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "AocTablet": "MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MpmanTablet": "MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "CelkonTablet": "CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "WolderTablet": "miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MiTablet": "\\bMI PAD\\b|\\bHM NOTE 1W\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "NibiruTablet": "Nibiru M1|Nibiru Jupiter One", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "NexoTablet": "NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "LeaderTablet": "TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "UbislateTablet": "UbiSlate[\\s]?7C", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PocketBookTablet": "Pocketbook", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "KocasoTablet": "\\b(TB-1207)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Hudl": "Hudl HT7S3|Hudl 2", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "TelstraTablet": "T-Hub2", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "GenericTablet": "Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bJolla\\b|\\bTP750\\b" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~ + "oss": { + ~~~~~~~~~~~~ + "AndroidOS": "Android", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "BlackBerryOS": "blackberry|\\bBB10\\b|rim tablet os", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PalmOS": "PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "SymbianOS": "Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "WindowsMobileOS": "Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "WindowsPhoneOS": "Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "iOS": "\\biPhone.*Mobile|\\biPod|\\biPad", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MeeGoOS": "MeeGo", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MaemoOS": "Maemo", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "JavaOS": "J2ME\/|\\bMIDP\\b|\\bCLDC\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "webOS": "webOS|hpwOS", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "badaOS": "\\bBada\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "BREWOS": "BREW" + ~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~ + "uas": { + ~~~~~~~~~~~~ + "Vivaldi": "Vivaldi", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Chrome": "\\bCrMo\\b|CriOS|Android.*Chrome\/[.0-9]* (Mobile)?", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Dolfin": "\\bDolfin\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Opera": "Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\/[0-9.]+|Coast\/[0-9.]+", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Skyfire": "Skyfire", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Edge": "Mobile Safari\/[.0-9]* Edge", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "IE": "IEMobile|MSIEMobile", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Firefox": "fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Bolt": "bolt", + ~~~~~~~~~~~~~~~~~~~~~~~ + "TeaShark": "teashark", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Blazer": "Blazer", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Safari": "Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Tizen": "Tizen", + ~~~~~~~~~~~~~~~~~~~~~~~~~ + "UCBrowser": "UC.*Browser|UCWEB", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "baiduboxapp": "baiduboxapp", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "baidubrowser": "baidubrowser", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "DiigoBrowser": "DiigoBrowser", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Puffin": "Puffin", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Mercury": "\\bMercury\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "ObigoBrowser": "Obigo", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "NetFront": "NF-Browser", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "GenericBrowser": "NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PaleMoon": "Android.*PaleMoon|Mobile.*PaleMoon" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~ + "props": { + ~~~~~~~~~~~~~~ + "Mobile": "Mobile\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Build": "Build\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Version": "Version\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "VendorID": "VendorID\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "iPad": "iPad.*CPU[a-z ]+[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "iPhone": "iPhone.*CPU[a-z ]+[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "iPod": "iPod.*CPU[a-z ]+[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Kindle": "Kindle\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Chrome": [ + ~~~~~~~~~~~~~~~~~~~ + "Chrome\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "CriOS\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "CrMo\/[VER]" + ~~~~~~~~~~~~~~~~~~~~~~~~~ + ], + ~~~~~~~~~~ + "Coast": [ + ~~~~~~~~~~~~~~~~~~ + "Coast\/[VER]" + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ], + ~~~~~~~~~~ + "Dolfin": "Dolfin\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Firefox": "Firefox\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Fennec": "Fennec\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Edge": "Edge\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "IE": [ + ~~~~~~~~~~~~~~~ + "IEMobile\/[VER];", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "IEMobile [VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MSIE [VER];", + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Trident\/[0-9.]+;.*rv:[VER]" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ], + ~~~~~~~~~~ + "NetFront": "NetFront\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "NokiaBrowser": "NokiaBrowser\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Opera": [ + ~~~~~~~~~~~~~~~~~~ + " OPR\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Opera Mini\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Version\/[VER]" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ], + ~~~~~~~~~~ + "Opera Mini": "Opera Mini\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Opera Mobi": "Version\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "UC Browser": "UC Browser[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MQQBrowser": "MQQBrowser\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MicroMessenger": "MicroMessenger\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "baiduboxapp": "baiduboxapp\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "baidubrowser": "baidubrowser\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Iron": "Iron\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Safari": [ + ~~~~~~~~~~~~~~~~~~~ + "Version\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Safari\/[VER]" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ], + ~~~~~~~~~~ + "Skyfire": "Skyfire\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Tizen": "Tizen\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Webkit": "webkit[ \/][VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "PaleMoon": "PaleMoon\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Gecko": "Gecko\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Trident": "Trident\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Presto": "Presto\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Goanna": "Goanna\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "iOS": " \\bi?OS\\b [VER][ ;]{1}", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Android": "Android [VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "BlackBerry": [ + ~~~~~~~~~~~~~~~~~~~~~~~ + "BlackBerry[\\w]+\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "BlackBerry.*Version\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Version\/[VER]" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ], + ~~~~~~~~~~ + "BREW": "BREW [VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Java": "Java\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Windows Phone OS": [ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Windows Phone OS [VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Windows Phone [VER]" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ], + ~~~~~~~~~~ + "Windows Phone": "Windows Phone [VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Windows CE": "Windows CE\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Windows NT": "Windows NT [VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Symbian": [ + ~~~~~~~~~~~~~~~~~~~~ + "SymbianOS\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Symbian\/[VER]" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ], + ~~~~~~~~~~ + "webOS": [ + ~~~~~~~~~~~~~~~~~~ + "webOS\/[VER]", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "hpwOS\/[VER];" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ] + ~~~~~~~~~ + }, + ~~~~~~ + "utils": { + ~~~~~~~~~~~~~~ + "Bot": "Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "MobileBot": "Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker\/M1A1-R2D2", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "DesktopMode": "WPDesktop", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "TV": "SonyDTV|HbbTV", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "WebKit": "(webkit)[ \/]([\\w.]+)", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Console": "\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\\b", + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + "Watch": "SM-V700" + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + }; + ~~ + + + // following patterns come from http://detectmobilebrowsers.com/ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + impl.detectMobileBrowsers = { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'. + fullPattern: /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + shortPattern: /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tabletPattern: /android|ipad|playbook|silk/i + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }; + ~~~~~~ + + + var hasOwnProp = Object.prototype.hasOwnProperty, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + isArray; + ~~~~~~~~~~~~~~~~ + + + impl.FALLBACK_PHONE = 'UnknownPhone'; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~ +!!! error TS2339: Property 'FALLBACK_PHONE' does not exist on type '{}'. + impl.FALLBACK_TABLET = 'UnknownTablet'; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'FALLBACK_TABLET' does not exist on type '{}'. + impl.FALLBACK_MOBILE = 'UnknownMobile'; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'FALLBACK_MOBILE' does not exist on type '{}'. + + + isArray = ('isArray' in Array) ? + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Array.isArray : function (value) { return Object.prototype.toString.call(value) === '[object Array]'; }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + function equalIC(a, b) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return a != null && b != null && a.toLowerCase() === b.toLowerCase(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + + + function containsIC(array, value) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var valueLC, i, len = array.length; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (!len || !value) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return false; + ~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + valueLC = value.toLowerCase(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + for (i = 0; i < len; ++i) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (valueLC === array[i].toLowerCase()) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return true; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + } + ~~~~~~~~~ + return false; + ~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + + + function convertPropsToRegExp(object) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + for (var key in object) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (hasOwnProp.call(object, key)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + object[key] = new RegExp(object[key], 'i'); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + } + ~~~~~~~~~ + } + ~~~~~ + + + (function init() { + ~~~~~~~~~~~~~~~~~~~~~~ + var key, values, value, i, len, verPos, mobileDetectRules = impl.mobileDetectRules; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + for (key in mobileDetectRules.props) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (hasOwnProp.call(mobileDetectRules.props, key)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + values = mobileDetectRules.props[key]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (!isArray(values)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + values = [values]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~~~~~ + len = values.length; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + for (i = 0; i < len; ++i) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + value = values[i]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + verPos = value.indexOf('[VER]'); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (verPos >= 0) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + value = value.substring(0, verPos) + '([\\w._\\+]+)' + value.substring(verPos + 5); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~~~~~~~~~ + values[i] = new RegExp(value, 'i'); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~~~~~ + mobileDetectRules.props[key] = values; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + } + ~~~~~~~~~ + convertPropsToRegExp(mobileDetectRules.oss); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + convertPropsToRegExp(mobileDetectRules.phones); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + convertPropsToRegExp(mobileDetectRules.tablets); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + convertPropsToRegExp(mobileDetectRules.uas); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + convertPropsToRegExp(mobileDetectRules.utils); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // copy some patterns to oss0 which are tested first (see issue#15) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + mobileDetectRules.oss0 = { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + WindowsPhoneOS: mobileDetectRules.oss.WindowsPhoneOS, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + WindowsMobileOS: mobileDetectRules.oss.WindowsMobileOS + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }; + ~~~~~~~~~~ + }()); + ~~~~~~~~~ + + + /** + ~~~~~~~ + * Test userAgent string against a set of rules and find the first matched key. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @param {Object} rules (key is String, value is RegExp) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent'). + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @returns {String|null} the matched key if found, otherwise null + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @private + ~~~~~~~~~~~~~~~ + */ + ~~~~~~~ + impl.findMatch = function(rules, userAgent) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ +!!! error TS2339: Property 'findMatch' does not exist on type '{}'. + for (var key in rules) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (hasOwnProp.call(rules, key)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (rules[key].test(userAgent)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return key; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + } + ~~~~~~~~~ + return null; + ~~~~~~~~~~~~~~~~~~~~ + }; + ~~~~~~ + + + /** + ~~~~~~~ + * Test userAgent string against a set of rules and return an array of matched keys. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @param {Object} rules (key is String, value is RegExp) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent'). + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @returns {Array} an array of matched keys, may be empty when there is no match, but not null + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @private + ~~~~~~~~~~~~~~~ + */ + ~~~~~~~ + impl.findMatches = function(rules, userAgent) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ +!!! error TS2339: Property 'findMatches' does not exist on type '{}'. + var result = []; + ~~~~~~~~~~~~~~~~~~~~~~~~ + for (var key in rules) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (hasOwnProp.call(rules, key)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (rules[key].test(userAgent)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + result.push(key); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + } + ~~~~~~~~~ + return result; + ~~~~~~~~~~~~~~~~~~~~~~ + }; + ~~~~~~ + + + /** + ~~~~~~~ + * Check the version of the given property in the User-Agent. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~ + * @param {String} propertyName + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @param {String} userAgent + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @return {String} version or null if version not found + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @private + ~~~~~~~~~~~~~~~ + */ + ~~~~~~~ + impl.getVersionStr = function (propertyName, userAgent) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ +!!! error TS2339: Property 'getVersionStr' does not exist on type '{}'. + var props = impl.mobileDetectRules.props, patterns, i, len, match; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + if (hasOwnProp.call(props, propertyName)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + patterns = props[propertyName]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + len = patterns.length; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + for (i = 0; i < len; ++i) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + match = patterns[i].exec(userAgent); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (match !== null) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return match[1]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + } + ~~~~~~~~~ + return null; + ~~~~~~~~~~~~~~~~~~~~ + }; + ~~~~~~ + + + /** + ~~~~~~~ + * Check the version of the given property in the User-Agent. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~ + * @param {String} propertyName + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @param {String} userAgent + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @return {Number} version or NaN if version not found + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @private + ~~~~~~~~~~~~~~~ + */ + ~~~~~~~ + impl.getVersion = function (propertyName, userAgent) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~ +!!! error TS2339: Property 'getVersion' does not exist on type '{}'. + var version = impl.getVersionStr(propertyName, userAgent); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ +!!! error TS2339: Property 'getVersionStr' does not exist on type '{}'. + return version ? impl.prepareVersionNo(version) : NaN; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'prepareVersionNo' does not exist on type '{}'. + }; + ~~~~~~ + + + /** + ~~~~~~~ + * Prepare the version number. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~ + * @param {String} version + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @return {Number} the version number as a floating number + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @private + ~~~~~~~~~~~~~~~ + */ + ~~~~~~~ + impl.prepareVersionNo = function (version) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'prepareVersionNo' does not exist on type '{}'. + var numbers; + ~~~~~~~~~~~~~~~~~~~~ + + + numbers = version.split(/[a-z._ \/\-]/i); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (numbers.length === 1) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + version = numbers[0]; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + if (numbers.length > 1) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + version = numbers[0] + '.'; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + numbers.shift(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + version += numbers.join(''); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + return Number(version); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }; + ~~~~~~ + + + impl.isMobileFallback = function (userAgent) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'isMobileFallback' does not exist on type '{}'. + return impl.detectMobileBrowsers.fullPattern.test(userAgent) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'. + impl.detectMobileBrowsers.shortPattern.test(userAgent.substr(0,4)); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'. + }; + ~~~~~~ + + + impl.isTabletFallback = function (userAgent) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'isTabletFallback' does not exist on type '{}'. + return impl.detectMobileBrowsers.tabletPattern.test(userAgent); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'detectMobileBrowsers' does not exist on type '{}'. + }; + ~~~~~~ + + + impl.prepareDetectionCache = function (cache, userAgent, maxPhoneWidth) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. + if (cache.mobile !== undefined) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return; + ~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + var phone, tablet, phoneSized; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // first check for stronger tablet rules, then phone (see issue#5) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tablet = impl.findMatch(impl.mobileDetectRules.tablets, userAgent); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ +!!! error TS2339: Property 'findMatch' does not exist on type '{}'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + if (tablet) { + ~~~~~~~~~~~~~~~~~~~~~ + cache.mobile = cache.tablet = tablet; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cache.phone = null; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return; // unambiguously identified as tablet + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + + + phone = impl.findMatch(impl.mobileDetectRules.phones, userAgent); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ +!!! error TS2339: Property 'findMatch' does not exist on type '{}'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + if (phone) { + ~~~~~~~~~~~~~~~~~~~~ + cache.mobile = cache.phone = phone; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cache.tablet = null; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return; // unambiguously identified as phone + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + + + // our rules haven't found a match -> try more general fallback rules + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (impl.isMobileFallback(userAgent)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'isMobileFallback' does not exist on type '{}'. + phoneSized = MobileDetect.isPhoneSized(maxPhoneWidth); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ +!!! error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. + if (phoneSized === undefined) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cache.mobile = impl.FALLBACK_MOBILE; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'FALLBACK_MOBILE' does not exist on type '{}'. + cache.tablet = cache.phone = null; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } else if (phoneSized) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cache.mobile = cache.phone = impl.FALLBACK_PHONE; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~ +!!! error TS2339: Property 'FALLBACK_PHONE' does not exist on type '{}'. + cache.tablet = null; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } else { + ~~~~~~~~~~~~~~~~~~~~ + cache.mobile = cache.tablet = impl.FALLBACK_TABLET; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'FALLBACK_TABLET' does not exist on type '{}'. + cache.phone = null; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + } else if (impl.isTabletFallback(userAgent)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'isTabletFallback' does not exist on type '{}'. + cache.mobile = cache.tablet = impl.FALLBACK_TABLET; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'FALLBACK_TABLET' does not exist on type '{}'. + cache.phone = null; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } else { + ~~~~~~~~~~~~~~~~ + // not mobile at all! + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cache.mobile = cache.tablet = cache.phone = null; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + }; + ~~~~~~ + + + // t is a reference to a MobileDetect instance + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + impl.mobileGrade = function (t) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ +!!! error TS2339: Property 'mobileGrade' does not exist on type '{}'. + // impl note: + ~~~~~~~~~~~~~~~~~~~~~ + // To keep in sync w/ Mobile_Detect.php easily, the following code is tightly aligned to the PHP version. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // When changes are made in Mobile_Detect.php, copy this method and replace: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // $this-> / t. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // self::MOBILE_GRADE_(.) / '$1' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // , self::VERSION_TYPE_FLOAT / (nothing) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // isIOS() / os('iOS') + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // [reg] / (nothing) <-- jsdelivr complaining about unescaped unicode character U+00AE + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var $isMobile = t.mobile() !== null; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + if ( + ~~~~~~~~~~~~ + // Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.os('iOS') && t.version('iPad')>=4.3 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.os('iOS') && t.version('iPhone')>=3.1 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.os('iOS') && t.version('iPod')>=3.1 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ( t.version('Android')>2.1 && t.is('Webkit') ) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.version('Windows Phone OS')>=7.0 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Blackberry 7 - Tested on BlackBerry Torch 9810 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Blackberry 6.0 - Tested on the Torch 9800 and Style 9670 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.is('BlackBerry') && t.version('BlackBerry')>=6.0 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Blackberry Playbook (1.0-2.0) - Tested on PlayBook + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.match('Playbook.*Tablet') || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ( t.version('webOS')>=1.4 && t.match('Palm|Pre|Pixi') ) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Palm WebOS 3.0 - Tested on HP TouchPad + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.match('hp.*TouchPad') || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Firefox Mobile (12 Beta) - Tested on Android 2.3 device + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ( t.is('Firefox') && t.version('Firefox')>=12 ) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Chrome for Android - Tested on Android 4.0, 4.1 device + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ( t.is('Chrome') && t.is('AndroidOS') && t.version('Android')>=4.0 ) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Skyfire 4.1 - Tested on Android 2.3 device + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ( t.is('Skyfire') && t.version('Skyfire')>=4.1 && t.is('AndroidOS') && t.version('Android')>=2.3 ) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Opera Mobile 11.5-12: Tested on Android 2.3 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ( t.is('Opera') && t.version('Opera Mobi')>11 && t.is('AndroidOS') ) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Meego 1.2 - Tested on Nokia 950 and N9 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.is('MeeGoOS') || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Tizen (pre-release) - Tested on early hardware + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.is('Tizen') || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // @todo: more tests here! + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.is('Dolfin') && t.version('Bada')>=2.0 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // UC Browser - Tested on Android 2.3 device + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ( (t.is('UC Browser') || t.is('Dolfin')) && t.version('Android')>=2.3 ) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Kindle 3 and Fire - Tested on the built-in WebKit browser for each + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ( t.match('Kindle Fire') || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.is('Kindle') && t.version('Kindle')>=3.0 ) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.is('AndroidOS') && t.is('NookTablet') || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.version('Chrome')>=11 && !$isMobile || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.version('Safari')>=5.0 && !$isMobile || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.version('Firefox')>=4.0 && !$isMobile || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.version('MSIE')>=7.0 && !$isMobile || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // @reference: http://my.opera.com/community/openweb/idopera/ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.version('Opera')>=10 && !$isMobile + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + ){ + ~~~~~~~~~~~~~~ + return 'A'; + ~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + + + if ( + ~~~~~~~~~~~~ + t.os('iOS') && t.version('iPad')<4.3 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.os('iOS') && t.version('iPhone')<3.1 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.os('iOS') && t.version('iPod')<3.1 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.is('Blackberry') && t.version('BlackBerry')>=5 && t.version('BlackBerry')<6 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ( t.version('Opera Mini')>=5.0 && t.version('Opera Mini')<=6.5 && + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + (t.version('Android')>=2.3 || t.is('iOS')) ) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // @todo: report this (tested on Nokia N71) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.version('Opera Mobi')>=11 && t.is('SymbianOS') + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ){ + ~~~~~~~~~~~~~~ + return 'B'; + ~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + + + if ( + ~~~~~~~~~~~~ + // Blackberry 4.x - Tested on the Curve 8330 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.version('BlackBerry')<5.0 || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + t.match('MSIEMobile|Windows CE.*Mobile') || t.version('Windows Mobile')<=5.2 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + ){ + ~~~~~~~~~~~~~~ + return 'C'; + ~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + + + //All older smartphone platforms and featurephones - Any device that doesn't support media queries + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + //will receive the basic, C grade experience. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return 'C'; + ~~~~~~~~~~~~~~~~~~~ + }; + ~~~~~~ + + + impl.detectOS = function (ua) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ +!!! error TS2339: Property 'detectOS' does not exist on type '{}'. + return impl.findMatch(impl.mobileDetectRules.oss0, ua) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ +!!! error TS2339: Property 'findMatch' does not exist on type '{}'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + impl.findMatch(impl.mobileDetectRules.oss, ua); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ +!!! error TS2339: Property 'findMatch' does not exist on type '{}'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + }; + ~~~~~~ + + + impl.getDeviceSmallerSide = function () { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'. + return window.screen.width < window.screen.height ? + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS2304: Cannot find name 'window'. + ~~~~~~ +!!! error TS2304: Cannot find name 'window'. + window.screen.width : + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS2304: Cannot find name 'window'. + window.screen.height; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS2304: Cannot find name 'window'. + }; + ~~~~~~ + + + /** + ~~~~~~~ + * Constructor for MobileDetect object. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~ + * Such an object will keep a reference to the given user-agent string and cache most of the detect queries.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Find information how to download and install: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * github.com/hgoebl/mobile-detect.js/ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~ + * + ~~~~~~ + * @example
+    ~~~~~~~~~~~~~~~~~~~~~
+         *     var md = new MobileDetect(window.navigator.userAgent);
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         *     if (md.mobile()) {
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         *         location.href = (md.mobileGrade() === 'A') ? '/mobile/' : '/lynx/';
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         *     }
+    ~~~~~~~~~~~~
+         * 
+ ~~~~~~~~~~~~~ + * + ~~~~~~ + * @param {string} userAgent typically taken from window.navigator.userAgent or http_header['User-Agent'] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @param {number} [maxPhoneWidth=600] only for browsers specify a value for the maximum + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * width of smallest device side (in logical "CSS" pixels) until a device detected as mobile will be handled + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * as phone. + ~~~~~~~~~~~~~~~~~~~~~~~ + * This is only used in cases where the device cannot be classified as phone or tablet.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * See Declaring Tablet Layouts + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * for Android.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * If you provide a value < 0, then this "fuzzy" check is disabled. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @constructor + ~~~~~~~~~~~~~~~~~~~ + * @global + ~~~~~~~~~~~~~~ + */ + ~~~~~~~ + function MobileDetect(userAgent, maxPhoneWidth) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + this.ua = userAgent || ''; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + this._cache = {}; + ~~~~~~~~~~~~~~~~~~~~~~~~~ + //600dp is typical 7" tablet minimum width + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + this.maxPhoneWidth = maxPhoneWidth || 600; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + + + MobileDetect.prototype = { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + constructor: MobileDetect, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Returns the detected phone or tablet type or null if it is not a mobile device. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * the patterns of detectmobilebrowsers.com. If this test + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * is positive, a value of UnknownPhone, UnknownTablet or + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * UnknownMobile is returned.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * and UnknownMobile, so you will get UnknownMobile here.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * In most cases you will use the return value just as a boolean. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @returns {String} the key for the phone family or tablet family, e.g. "Nexus". + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @function MobileDetect#mobile + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + mobile: function () { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. + return this._cache.mobile; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Returns the detected phone type/family string or null. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * The returned tablet (family or producer) is one of following keys:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
iPhone, BlackBerry, HTC, Nexus, Dell, Motorola, Samsung, LG, Sony, Asus, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * NokiaLumia, Micromax, Palm, Vertu, Pantech, Fly, Wiko, iMobile, SimValley, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Wolfgang, Alcatel, Nintendo, Amoi, INQ, GenericPhone
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * the patterns of detectmobilebrowsers.com. If this test + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * is positive, a value of UnknownPhone or UnknownMobile is returned.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * and UnknownMobile, so you will get null here, while {@link MobileDetect#mobile} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * will return UnknownMobile.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * In most cases you will use the return value just as a boolean. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @returns {String} the key of the phone family or producer, e.g. "iPhone" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @function MobileDetect#phone + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + phone: function () { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. + return this._cache.phone; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Returns the detected tablet type/family string or null. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * The returned tablet (family or producer) is one of following keys:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
iPad, NexusTablet, SamsungTablet, Kindle, SurfaceTablet, HPTablet, AsusTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * BlackBerryTablet, HTCtablet, MotorolaTablet, NookTablet, AcerTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * ToshibaTablet, LGTablet, FujitsuTablet, PrestigioTablet, LenovoTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * DellTablet, YarvikTablet, MedionTablet, ArnovaTablet, IntensoTablet, IRUTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * MegafonTablet, EbodaTablet, AllViewTablet, ArchosTablet, AinolTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * NokiaLumiaTablet, SonyTablet, PhilipsTablet, CubeTablet, CobyTablet, MIDTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * MSITablet, SMiTTablet, RockChipTablet, FlyTablet, bqTablet, HuaweiTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * NecTablet, PantechTablet, BronchoTablet, VersusTablet, ZyncTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * PositivoTablet, NabiTablet, KoboTablet, DanewTablet, TexetTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * PlaystationTablet, TrekstorTablet, PyleAudioTablet, AdvanTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * DanyTechTablet, GalapadTablet, MicromaxTablet, KarbonnTablet, AllFineTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * PROSCANTablet, YONESTablet, ChangJiaTablet, GUTablet, PointOfViewTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * OvermaxTablet, HCLTablet, DPSTablet, VistureTablet, CrestaTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * MediatekTablet, ConcordeTablet, GoCleverTablet, ModecomTablet, VoninoTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * ECSTablet, StorexTablet, VodafoneTablet, EssentielBTablet, RossMoorTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * iMobileTablet, TolinoTablet, AudioSonicTablet, AMPETablet, SkkTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * TecnoTablet, JXDTablet, iJoyTablet, FX2Tablet, XoroTablet, ViewsonicTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * OdysTablet, CaptivaTablet, IconbitTablet, TeclastTablet, OndaTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * JaytechTablet, BlaupunktTablet, DigmaTablet, EvolioTablet, LavaTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * AocTablet, MpmanTablet, CelkonTablet, WolderTablet, MiTablet, NibiruTablet, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * NexoTablet, LeaderTablet, UbislateTablet, PocketBookTablet, KocasoTablet, Hudl, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * TelstraTablet, GenericTablet
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * the patterns of detectmobilebrowsers.com. If this test + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * is positive, a value of UnknownTablet or UnknownMobile is returned.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * and UnknownMobile, so you will get null here, while {@link MobileDetect#mobile} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * will return UnknownMobile.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * In most cases you will use the return value just as a boolean. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @returns {String} the key of the tablet family or producer, e.g. "SamsungTablet" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @function MobileDetect#tablet + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + tablet: function () { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. + return this._cache.tablet; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Returns the (first) detected user-agent string or null. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * The returned user-agent is one of following keys:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
Vivaldi, Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Blazer, Safari, Tizen, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Puffin, Mercury, ObigoBrowser, NetFront, GenericBrowser, PaleMoon
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * cases where a mobile device pretends to be more than one particular browser. You can get the + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * list of all matches with {@link MobileDetect#userAgents} or check for a particular value by + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * providing one of the defined keys as first argument to {@link MobileDetect#is}. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @returns {String} the key for the detected user-agent or null + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @function MobileDetect#userAgent + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + userAgent: function () { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (this._cache.userAgent === undefined) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + this._cache.userAgent = impl.findMatch(impl.mobileDetectRules.uas, this.ua); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ +!!! error TS2339: Property 'findMatch' does not exist on type '{}'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + } + ~~~~~~~~~~~~~ + return this._cache.userAgent; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Returns all detected user-agent strings. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * The array is empty or contains one or more of following keys:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
Vivaldi, Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Blazer, Safari, Tizen, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Puffin, Mercury, ObigoBrowser, NetFront, GenericBrowser, PaleMoon
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * cases where a mobile device pretends to be more than one particular browser. You can get the + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * list of all matches with {@link MobileDetect#userAgents} or check for a particular value by + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * providing one of the defined keys as first argument to {@link MobileDetect#is}. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @returns {Array} the array of detected user-agent keys or [] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @function MobileDetect#userAgents + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + userAgents: function () { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (this._cache.userAgents === undefined) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + this._cache.userAgents = impl.findMatches(impl.mobileDetectRules.uas, this.ua); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ +!!! error TS2339: Property 'findMatches' does not exist on type '{}'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + } + ~~~~~~~~~~~~~ + return this._cache.userAgents; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Returns the detected operating system string or null. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * The operating system is one of following keys:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
AndroidOS, BlackBerryOS, PalmOS, SymbianOS, WindowsMobileOS, WindowsPhoneOS, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * iOS, MeeGoOS, MaemoOS, JavaOS, webOS, badaOS, BREWOS
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @returns {String} the key for the detected operating system. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @function MobileDetect#os + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + os: function () { + ~~~~~~~~~~~~~~~~~~~~~~~~~ + if (this._cache.os === undefined) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + this._cache.os = impl.detectOS(this.ua); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~ +!!! error TS2339: Property 'detectOS' does not exist on type '{}'. + } + ~~~~~~~~~~~~~ + return this._cache.os; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Get the version (as Number) of the given property in the User-Agent. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @param {String} key a key defining a thing which has a version.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * You can use one of following keys:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Opera Mobi, UC Browser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon, Gecko, Trident, Presto, Goanna, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * iOS, Android, BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * CE, Windows NT, Symbian, webOS
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @returns {Number} the version as float or NaN if User-Agent doesn't contain this version. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Be careful when comparing this value with '==' operator! + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @function MobileDetect#version + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + version: function (key) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return impl.getVersion(key, this.ua); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~ +!!! error TS2339: Property 'getVersion' does not exist on type '{}'. + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Get the version (as String) of the given property in the User-Agent. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @param {String} key a key defining a thing which has a version.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * You can use one of following keys:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Opera Mobi, UC Browser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon, Gecko, Trident, Presto, Goanna, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * iOS, Android, BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * CE, Windows NT, Symbian, webOS
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @returns {String} the "raw" version as String or null if User-Agent doesn't contain this version. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @function MobileDetect#versionStr + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + versionStr: function (key) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return impl.getVersionStr(key, this.ua); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ +!!! error TS2339: Property 'getVersionStr' does not exist on type '{}'. + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Global test key against userAgent, os, phone, tablet and some other properties of userAgent string. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @param {String} key the key (case-insensitive) of a userAgent, an operating system, phone or + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * tablet family.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * For a complete list of possible values, see {@link MobileDetect#userAgent}, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * {@link MobileDetect#os}, {@link MobileDetect#phone}, {@link MobileDetect#tablet}.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Additionally you have following keys:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
Bot, MobileBot, DesktopMode, TV, WebKit, Console, Watch
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @returns {boolean} true when the given key is one of the defined keys of userAgent, os, phone, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * tablet or one of the listed additional keys, otherwise false + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @function MobileDetect#is + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + is: function (key) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return containsIC(this.userAgents(), key) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + equalIC(key, this.os()) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + equalIC(key, this.phone()) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + equalIC(key, this.tablet()) || + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + containsIC(impl.findMatches(impl.mobileDetectRules.utils, this.ua), key); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ +!!! error TS2339: Property 'findMatches' does not exist on type '{}'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Do a quick test against navigator::userAgent. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @param {String|RegExp} pattern the pattern, either as String or RegExp + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * (a string will be converted to a case-insensitive RegExp). + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @returns {boolean} true when the pattern matches, otherwise false + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @function MobileDetect#match + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + match: function (pattern) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (!(pattern instanceof RegExp)) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + pattern = new RegExp(pattern, 'i'); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~~~~~ + return pattern.test(this.ua); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Checks whether the mobile device can be considered as phone regarding screen.width. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *
+ ~~~~~~~~~~~~~~~ + * Obviously this method makes sense in browser environments only (not for Node.js)! + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @param {number} [maxPhoneWidth] the maximum logical pixels (aka. CSS-pixels) to be considered as phone.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * The argument is optional and if not present or falsy, the value of the constructor is taken. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @returns {boolean|undefined} undefined if screen size wasn't detectable, else true + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * when screen.width is less or equal to maxPhoneWidth, otherwise false.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Will always return undefined server-side. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + isPhoneSized: function (maxPhoneWidth) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ +!!! error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. + }, + ~~~~~~~~~~ + + + /** + ~~~~~~~~~~~ + * Returns the mobile grade ('A', 'B', 'C'). + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + ~~~~~~~~~~ + * @returns {String} one of the mobile grades ('A', 'B', 'C'). + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * @function MobileDetect#mobileGrade + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + ~~~~~~~~~~~ + mobileGrade: function () { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (this._cache.grade === undefined) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + this._cache.grade = impl.mobileGrade(this); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ +!!! error TS2339: Property 'mobileGrade' does not exist on type '{}'. + } + ~~~~~~~~~~~~~ + return this._cache.grade; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~~~~~ + }; + ~~~~~~ + + + // environment-dependent + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (typeof window !== 'undefined' && window.screen) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS2304: Cannot find name 'window'. + ~~~~~~ +!!! error TS2304: Cannot find name 'window'. + MobileDetect.isPhoneSized = function (maxPhoneWidth) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ +!!! error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. + return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'. + }; + ~~~~~~~~~~ + } else { + ~~~~~~~~~~~~ + MobileDetect.isPhoneSized = function () {}; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ +!!! error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. + } + ~~~~~ + + + // should not be replaced by a completely new object - just overwrite existing methods + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + MobileDetect._impl = impl; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~ +!!! error TS2339: Property '_impl' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. + + ~~~~ + MobileDetect.version = '1.3.3 2016-07-31'; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~ +!!! error TS2339: Property 'version' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. + + + return MobileDetect; + ~~~~~~~~~~~~~~~~~~~~~~~~ + }); // end of call of define() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + })((function (undefined) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~ + if (typeof module !== 'undefined' && module.exports) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS2304: Cannot find name 'module'. + ~~~~~~ +!!! error TS2304: Cannot find name 'module'. + return function (factory) { module.exports = factory(); }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS2304: Cannot find name 'module'. + } else if (typeof define === 'function' && define.amd) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS2304: Cannot find name 'define'. + ~~~~~~ +!!! error TS2304: Cannot find name 'define'. + return define; + ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS2304: Cannot find name 'define'. + } else if (typeof window !== 'undefined') { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS2304: Cannot find name 'window'. + return function (factory) { window.MobileDetect = factory(); }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ +!!! error TS2304: Cannot find name 'window'. + } else { + ~~~~~~~~~~~~ + ~~~~~~~~~~~~ + // please file a bug if you get this error! + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + throw new Error('unknown environment'); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + ~~~~~ + ~~~~~ + })()); + ~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/fixSignatureCaching.js b/tests/baselines/reference/fixSignatureCaching.js new file mode 100644 index 00000000000..231c1308c55 --- /dev/null +++ b/tests/baselines/reference/fixSignatureCaching.js @@ -0,0 +1,1902 @@ +//// [fixSignatureCaching.ts] +// Repro from #10697 + +(function (define, undefined) { +define(function () { + 'use strict'; + + var impl = {}; + + impl.mobileDetectRules = { + "phones": { + "iPhone": "\\biPhone\\b|\\biPod\\b", + "BlackBerry": "BlackBerry|\\bBB10\\b|rim[0-9]+", + "HTC": "HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m", + "Nexus": "Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6", + "Dell": "Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b", + "Motorola": "Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b", + "Samsung": "Samsung|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F", + "LG": "\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)", + "Sony": "SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533", + "Asus": "Asus.*Galaxy|PadFone.*Mobile", + "NokiaLumia": "Lumia [0-9]{3,4}", + "Micromax": "Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b", + "Palm": "PalmSource|Palm", + "Vertu": "Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature", + "Pantech": "PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790", + "Fly": "IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250", + "Wiko": "KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM", + "iMobile": "i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)", + "SimValley": "\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b", + "Wolfgang": "AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q", + "Alcatel": "Alcatel", + "Nintendo": "Nintendo 3DS", + "Amoi": "Amoi", + "INQ": "INQ", + "GenericPhone": "Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser" + }, + "tablets": { + "iPad": "iPad|iPad.*Mobile", + "NexusTablet": "Android.*Nexus[\\s]+(7|9|10)", + "SamsungTablet": "SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561", + "Kindle": "Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI)\\b", + "SurfaceTablet": "Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)", + "HPTablet": "HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10", + "AsusTablet": "^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K017 |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA", + "BlackBerryTablet": "PlayBook|RIM Tablet", + "HTCtablet": "HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410", + "MotorolaTablet": "xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617", + "NookTablet": "Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2", + "AcerTablet": "Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20", + "ToshibaTablet": "Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO", + "LGTablet": "\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b", + "FujitsuTablet": "Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b", + "PrestigioTablet": "PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002", + "LenovoTablet": "Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)", + "DellTablet": "Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7", + "YarvikTablet": "Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b", + "MedionTablet": "Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB", + "ArnovaTablet": "AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2", + "IntensoTablet": "INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004", + "IRUTablet": "M702pro", + "MegafonTablet": "MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b", + "EbodaTablet": "E-Boda (Supreme|Impresspeed|Izzycomm|Essential)", + "AllViewTablet": "Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)", + "ArchosTablet": "\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b", + "AinolTablet": "NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark", + "NokiaLumiaTablet": "Lumia 2520", + "SonyTablet": "Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612|SOT31", + "PhilipsTablet": "\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b", + "CubeTablet": "Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT", + "CobyTablet": "MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010", + "MIDTablet": "M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10", + "MSITablet": "MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b", + "SMiTTablet": "Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)", + "RockChipTablet": "Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A", + "FlyTablet": "IQ310|Fly Vision", + "bqTablet": "Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris E10)|Maxwell.*Lite|Maxwell.*Plus", + "HuaweiTablet": "MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim", + "NecTablet": "\\bN-06D|\\bN-08D", + "PantechTablet": "Pantech.*P4100", + "BronchoTablet": "Broncho.*(N701|N708|N802|a710)", + "VersusTablet": "TOUCHPAD.*[78910]|\\bTOUCHTAB\\b", + "ZyncTablet": "z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900", + "PositivoTablet": "TB07STA|TB10STA|TB07FTA|TB10FTA", + "NabiTablet": "Android.*\\bNabi", + "KoboTablet": "Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build", + "DanewTablet": "DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b", + "TexetTablet": "NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE", + "PlaystationTablet": "Playstation.*(Portable|Vita)", + "TrekstorTablet": "ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab", + "PyleAudioTablet": "\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b", + "AdvanTablet": "Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ", + "DanyTechTablet": "Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1", + "GalapadTablet": "Android.*\\bG1\\b", + "MicromaxTablet": "Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b", + "KarbonnTablet": "Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b", + "AllFineTablet": "Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide", + "PROSCANTablet": "\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b", + "YONESTablet": "BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026", + "ChangJiaTablet": "TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503", + "GUTablet": "TX-A1301|TX-M9002|Q702|kf026", + "PointOfViewTablet": "TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10", + "OvermaxTablet": "OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)", + "HCLTablet": "HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync", + "DPSTablet": "DPS Dream 9|DPS Dual 7", + "VistureTablet": "V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10", + "CrestaTablet": "CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989", + "MediatekTablet": "\\bMT8125|MT8389|MT8135|MT8377\\b", + "ConcordeTablet": "Concorde([ ]+)?Tab|ConCorde ReadMan", + "GoCleverTablet": "GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042", + "ModecomTablet": "FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003", + "VoninoTablet": "\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b", + "ECSTablet": "V07OT2|TM105A|S10OT1|TR10CS1", + "StorexTablet": "eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab", + "VodafoneTablet": "SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497", + "EssentielBTablet": "Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2", + "RossMoorTablet": "RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711", + "iMobileTablet": "i-mobile i-note", + "TolinoTablet": "tolino tab [0-9.]+|tolino shine", + "AudioSonicTablet": "\\bC-22Q|T7-QC|T-17B|T-17P\\b", + "AMPETablet": "Android.* A78 ", + "SkkTablet": "Android.* (SKYPAD|PHOENIX|CYCLOPS)", + "TecnoTablet": "TECNO P9", + "JXDTablet": "Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b", + "iJoyTablet": "Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)", + "FX2Tablet": "FX2 PAD7|FX2 PAD10", + "XoroTablet": "KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151", + "ViewsonicTablet": "ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a", + "OdysTablet": "LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10", + "CaptivaTablet": "CAPTIVA PAD", + "IconbitTablet": "NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S", + "TeclastTablet": "T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi", + "OndaTablet": "\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+", + "JaytechTablet": "TPC-PA762", + "BlaupunktTablet": "Endeavour 800NG|Endeavour 1010", + "DigmaTablet": "\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b", + "EvolioTablet": "ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b", + "LavaTablet": "QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b", + "AocTablet": "MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712", + "MpmanTablet": "MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010", + "CelkonTablet": "CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b", + "WolderTablet": "miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b", + "MiTablet": "\\bMI PAD\\b|\\bHM NOTE 1W\\b", + "NibiruTablet": "Nibiru M1|Nibiru Jupiter One", + "NexoTablet": "NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI", + "LeaderTablet": "TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100", + "UbislateTablet": "UbiSlate[\\s]?7C", + "PocketBookTablet": "Pocketbook", + "KocasoTablet": "\\b(TB-1207)\\b", + "Hudl": "Hudl HT7S3|Hudl 2", + "TelstraTablet": "T-Hub2", + "GenericTablet": "Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bJolla\\b|\\bTP750\\b" + }, + "oss": { + "AndroidOS": "Android", + "BlackBerryOS": "blackberry|\\bBB10\\b|rim tablet os", + "PalmOS": "PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino", + "SymbianOS": "Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b", + "WindowsMobileOS": "Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;", + "WindowsPhoneOS": "Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;", + "iOS": "\\biPhone.*Mobile|\\biPod|\\biPad", + "MeeGoOS": "MeeGo", + "MaemoOS": "Maemo", + "JavaOS": "J2ME\/|\\bMIDP\\b|\\bCLDC\\b", + "webOS": "webOS|hpwOS", + "badaOS": "\\bBada\\b", + "BREWOS": "BREW" + }, + "uas": { + "Vivaldi": "Vivaldi", + "Chrome": "\\bCrMo\\b|CriOS|Android.*Chrome\/[.0-9]* (Mobile)?", + "Dolfin": "\\bDolfin\\b", + "Opera": "Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\/[0-9.]+|Coast\/[0-9.]+", + "Skyfire": "Skyfire", + "Edge": "Mobile Safari\/[.0-9]* Edge", + "IE": "IEMobile|MSIEMobile", + "Firefox": "fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile", + "Bolt": "bolt", + "TeaShark": "teashark", + "Blazer": "Blazer", + "Safari": "Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari", + "Tizen": "Tizen", + "UCBrowser": "UC.*Browser|UCWEB", + "baiduboxapp": "baiduboxapp", + "baidubrowser": "baidubrowser", + "DiigoBrowser": "DiigoBrowser", + "Puffin": "Puffin", + "Mercury": "\\bMercury\\b", + "ObigoBrowser": "Obigo", + "NetFront": "NF-Browser", + "GenericBrowser": "NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger", + "PaleMoon": "Android.*PaleMoon|Mobile.*PaleMoon" + }, + "props": { + "Mobile": "Mobile\/[VER]", + "Build": "Build\/[VER]", + "Version": "Version\/[VER]", + "VendorID": "VendorID\/[VER]", + "iPad": "iPad.*CPU[a-z ]+[VER]", + "iPhone": "iPhone.*CPU[a-z ]+[VER]", + "iPod": "iPod.*CPU[a-z ]+[VER]", + "Kindle": "Kindle\/[VER]", + "Chrome": [ + "Chrome\/[VER]", + "CriOS\/[VER]", + "CrMo\/[VER]" + ], + "Coast": [ + "Coast\/[VER]" + ], + "Dolfin": "Dolfin\/[VER]", + "Firefox": "Firefox\/[VER]", + "Fennec": "Fennec\/[VER]", + "Edge": "Edge\/[VER]", + "IE": [ + "IEMobile\/[VER];", + "IEMobile [VER]", + "MSIE [VER];", + "Trident\/[0-9.]+;.*rv:[VER]" + ], + "NetFront": "NetFront\/[VER]", + "NokiaBrowser": "NokiaBrowser\/[VER]", + "Opera": [ + " OPR\/[VER]", + "Opera Mini\/[VER]", + "Version\/[VER]" + ], + "Opera Mini": "Opera Mini\/[VER]", + "Opera Mobi": "Version\/[VER]", + "UC Browser": "UC Browser[VER]", + "MQQBrowser": "MQQBrowser\/[VER]", + "MicroMessenger": "MicroMessenger\/[VER]", + "baiduboxapp": "baiduboxapp\/[VER]", + "baidubrowser": "baidubrowser\/[VER]", + "Iron": "Iron\/[VER]", + "Safari": [ + "Version\/[VER]", + "Safari\/[VER]" + ], + "Skyfire": "Skyfire\/[VER]", + "Tizen": "Tizen\/[VER]", + "Webkit": "webkit[ \/][VER]", + "PaleMoon": "PaleMoon\/[VER]", + "Gecko": "Gecko\/[VER]", + "Trident": "Trident\/[VER]", + "Presto": "Presto\/[VER]", + "Goanna": "Goanna\/[VER]", + "iOS": " \\bi?OS\\b [VER][ ;]{1}", + "Android": "Android [VER]", + "BlackBerry": [ + "BlackBerry[\\w]+\/[VER]", + "BlackBerry.*Version\/[VER]", + "Version\/[VER]" + ], + "BREW": "BREW [VER]", + "Java": "Java\/[VER]", + "Windows Phone OS": [ + "Windows Phone OS [VER]", + "Windows Phone [VER]" + ], + "Windows Phone": "Windows Phone [VER]", + "Windows CE": "Windows CE\/[VER]", + "Windows NT": "Windows NT [VER]", + "Symbian": [ + "SymbianOS\/[VER]", + "Symbian\/[VER]" + ], + "webOS": [ + "webOS\/[VER]", + "hpwOS\/[VER];" + ] + }, + "utils": { + "Bot": "Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom", + "MobileBot": "Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker\/M1A1-R2D2", + "DesktopMode": "WPDesktop", + "TV": "SonyDTV|HbbTV", + "WebKit": "(webkit)[ \/]([\\w.]+)", + "Console": "\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\\b", + "Watch": "SM-V700" + } +}; + + // following patterns come from http://detectmobilebrowsers.com/ + impl.detectMobileBrowsers = { + fullPattern: /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i, + shortPattern: /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i, + tabletPattern: /android|ipad|playbook|silk/i + }; + + var hasOwnProp = Object.prototype.hasOwnProperty, + isArray; + + impl.FALLBACK_PHONE = 'UnknownPhone'; + impl.FALLBACK_TABLET = 'UnknownTablet'; + impl.FALLBACK_MOBILE = 'UnknownMobile'; + + isArray = ('isArray' in Array) ? + Array.isArray : function (value) { return Object.prototype.toString.call(value) === '[object Array]'; }; + + function equalIC(a, b) { + return a != null && b != null && a.toLowerCase() === b.toLowerCase(); + } + + function containsIC(array, value) { + var valueLC, i, len = array.length; + if (!len || !value) { + return false; + } + valueLC = value.toLowerCase(); + for (i = 0; i < len; ++i) { + if (valueLC === array[i].toLowerCase()) { + return true; + } + } + return false; + } + + function convertPropsToRegExp(object) { + for (var key in object) { + if (hasOwnProp.call(object, key)) { + object[key] = new RegExp(object[key], 'i'); + } + } + } + + (function init() { + var key, values, value, i, len, verPos, mobileDetectRules = impl.mobileDetectRules; + for (key in mobileDetectRules.props) { + if (hasOwnProp.call(mobileDetectRules.props, key)) { + values = mobileDetectRules.props[key]; + if (!isArray(values)) { + values = [values]; + } + len = values.length; + for (i = 0; i < len; ++i) { + value = values[i]; + verPos = value.indexOf('[VER]'); + if (verPos >= 0) { + value = value.substring(0, verPos) + '([\\w._\\+]+)' + value.substring(verPos + 5); + } + values[i] = new RegExp(value, 'i'); + } + mobileDetectRules.props[key] = values; + } + } + convertPropsToRegExp(mobileDetectRules.oss); + convertPropsToRegExp(mobileDetectRules.phones); + convertPropsToRegExp(mobileDetectRules.tablets); + convertPropsToRegExp(mobileDetectRules.uas); + convertPropsToRegExp(mobileDetectRules.utils); + + // copy some patterns to oss0 which are tested first (see issue#15) + mobileDetectRules.oss0 = { + WindowsPhoneOS: mobileDetectRules.oss.WindowsPhoneOS, + WindowsMobileOS: mobileDetectRules.oss.WindowsMobileOS + }; + }()); + + /** + * Test userAgent string against a set of rules and find the first matched key. + * @param {Object} rules (key is String, value is RegExp) + * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent'). + * @returns {String|null} the matched key if found, otherwise null + * @private + */ + impl.findMatch = function(rules, userAgent) { + for (var key in rules) { + if (hasOwnProp.call(rules, key)) { + if (rules[key].test(userAgent)) { + return key; + } + } + } + return null; + }; + + /** + * Test userAgent string against a set of rules and return an array of matched keys. + * @param {Object} rules (key is String, value is RegExp) + * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent'). + * @returns {Array} an array of matched keys, may be empty when there is no match, but not null + * @private + */ + impl.findMatches = function(rules, userAgent) { + var result = []; + for (var key in rules) { + if (hasOwnProp.call(rules, key)) { + if (rules[key].test(userAgent)) { + result.push(key); + } + } + } + return result; + }; + + /** + * Check the version of the given property in the User-Agent. + * + * @param {String} propertyName + * @param {String} userAgent + * @return {String} version or null if version not found + * @private + */ + impl.getVersionStr = function (propertyName, userAgent) { + var props = impl.mobileDetectRules.props, patterns, i, len, match; + if (hasOwnProp.call(props, propertyName)) { + patterns = props[propertyName]; + len = patterns.length; + for (i = 0; i < len; ++i) { + match = patterns[i].exec(userAgent); + if (match !== null) { + return match[1]; + } + } + } + return null; + }; + + /** + * Check the version of the given property in the User-Agent. + * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) + * + * @param {String} propertyName + * @param {String} userAgent + * @return {Number} version or NaN if version not found + * @private + */ + impl.getVersion = function (propertyName, userAgent) { + var version = impl.getVersionStr(propertyName, userAgent); + return version ? impl.prepareVersionNo(version) : NaN; + }; + + /** + * Prepare the version number. + * + * @param {String} version + * @return {Number} the version number as a floating number + * @private + */ + impl.prepareVersionNo = function (version) { + var numbers; + + numbers = version.split(/[a-z._ \/\-]/i); + if (numbers.length === 1) { + version = numbers[0]; + } + if (numbers.length > 1) { + version = numbers[0] + '.'; + numbers.shift(); + version += numbers.join(''); + } + return Number(version); + }; + + impl.isMobileFallback = function (userAgent) { + return impl.detectMobileBrowsers.fullPattern.test(userAgent) || + impl.detectMobileBrowsers.shortPattern.test(userAgent.substr(0,4)); + }; + + impl.isTabletFallback = function (userAgent) { + return impl.detectMobileBrowsers.tabletPattern.test(userAgent); + }; + + impl.prepareDetectionCache = function (cache, userAgent, maxPhoneWidth) { + if (cache.mobile !== undefined) { + return; + } + var phone, tablet, phoneSized; + + // first check for stronger tablet rules, then phone (see issue#5) + tablet = impl.findMatch(impl.mobileDetectRules.tablets, userAgent); + if (tablet) { + cache.mobile = cache.tablet = tablet; + cache.phone = null; + return; // unambiguously identified as tablet + } + + phone = impl.findMatch(impl.mobileDetectRules.phones, userAgent); + if (phone) { + cache.mobile = cache.phone = phone; + cache.tablet = null; + return; // unambiguously identified as phone + } + + // our rules haven't found a match -> try more general fallback rules + if (impl.isMobileFallback(userAgent)) { + phoneSized = MobileDetect.isPhoneSized(maxPhoneWidth); + if (phoneSized === undefined) { + cache.mobile = impl.FALLBACK_MOBILE; + cache.tablet = cache.phone = null; + } else if (phoneSized) { + cache.mobile = cache.phone = impl.FALLBACK_PHONE; + cache.tablet = null; + } else { + cache.mobile = cache.tablet = impl.FALLBACK_TABLET; + cache.phone = null; + } + } else if (impl.isTabletFallback(userAgent)) { + cache.mobile = cache.tablet = impl.FALLBACK_TABLET; + cache.phone = null; + } else { + // not mobile at all! + cache.mobile = cache.tablet = cache.phone = null; + } + }; + + // t is a reference to a MobileDetect instance + impl.mobileGrade = function (t) { + // impl note: + // To keep in sync w/ Mobile_Detect.php easily, the following code is tightly aligned to the PHP version. + // When changes are made in Mobile_Detect.php, copy this method and replace: + // $this-> / t. + // self::MOBILE_GRADE_(.) / '$1' + // , self::VERSION_TYPE_FLOAT / (nothing) + // isIOS() / os('iOS') + // [reg] / (nothing) <-- jsdelivr complaining about unescaped unicode character U+00AE + var $isMobile = t.mobile() !== null; + + if ( + // Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1) + t.os('iOS') && t.version('iPad')>=4.3 || + t.os('iOS') && t.version('iPhone')>=3.1 || + t.os('iOS') && t.version('iPod')>=3.1 || + + // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) + // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM + // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices + // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 + ( t.version('Android')>2.1 && t.is('Webkit') ) || + + // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800 + t.version('Windows Phone OS')>=7.0 || + + // Blackberry 7 - Tested on BlackBerry Torch 9810 + // Blackberry 6.0 - Tested on the Torch 9800 and Style 9670 + t.is('BlackBerry') && t.version('BlackBerry')>=6.0 || + // Blackberry Playbook (1.0-2.0) - Tested on PlayBook + t.match('Playbook.*Tablet') || + + // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0) + ( t.version('webOS')>=1.4 && t.match('Palm|Pre|Pixi') ) || + // Palm WebOS 3.0 - Tested on HP TouchPad + t.match('hp.*TouchPad') || + + // Firefox Mobile (12 Beta) - Tested on Android 2.3 device + ( t.is('Firefox') && t.version('Firefox')>=12 ) || + + // Chrome for Android - Tested on Android 4.0, 4.1 device + ( t.is('Chrome') && t.is('AndroidOS') && t.version('Android')>=4.0 ) || + + // Skyfire 4.1 - Tested on Android 2.3 device + ( t.is('Skyfire') && t.version('Skyfire')>=4.1 && t.is('AndroidOS') && t.version('Android')>=2.3 ) || + + // Opera Mobile 11.5-12: Tested on Android 2.3 + ( t.is('Opera') && t.version('Opera Mobi')>11 && t.is('AndroidOS') ) || + + // Meego 1.2 - Tested on Nokia 950 and N9 + t.is('MeeGoOS') || + + // Tizen (pre-release) - Tested on early hardware + t.is('Tizen') || + + // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser + // @todo: more tests here! + t.is('Dolfin') && t.version('Bada')>=2.0 || + + // UC Browser - Tested on Android 2.3 device + ( (t.is('UC Browser') || t.is('Dolfin')) && t.version('Android')>=2.3 ) || + + // Kindle 3 and Fire - Tested on the built-in WebKit browser for each + ( t.match('Kindle Fire') || + t.is('Kindle') && t.version('Kindle')>=3.0 ) || + + // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet + t.is('AndroidOS') && t.is('NookTablet') || + + // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7 + t.version('Chrome')>=11 && !$isMobile || + + // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7 + t.version('Safari')>=5.0 && !$isMobile || + + // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7 + t.version('Firefox')>=4.0 && !$isMobile || + + // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 + t.version('MSIE')>=7.0 && !$isMobile || + + // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 + // @reference: http://my.opera.com/community/openweb/idopera/ + t.version('Opera')>=10 && !$isMobile + + ){ + return 'A'; + } + + if ( + t.os('iOS') && t.version('iPad')<4.3 || + t.os('iOS') && t.version('iPhone')<3.1 || + t.os('iOS') && t.version('iPod')<3.1 || + + // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 + t.is('Blackberry') && t.version('BlackBerry')>=5 && t.version('BlackBerry')<6 || + + //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 + ( t.version('Opera Mini')>=5.0 && t.version('Opera Mini')<=6.5 && + (t.version('Android')>=2.3 || t.is('iOS')) ) || + + // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) + t.match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || + + // @todo: report this (tested on Nokia N71) + t.version('Opera Mobi')>=11 && t.is('SymbianOS') + ){ + return 'B'; + } + + if ( + // Blackberry 4.x - Tested on the Curve 8330 + t.version('BlackBerry')<5.0 || + // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) + t.match('MSIEMobile|Windows CE.*Mobile') || t.version('Windows Mobile')<=5.2 + + ){ + return 'C'; + } + + //All older smartphone platforms and featurephones - Any device that doesn't support media queries + //will receive the basic, C grade experience. + return 'C'; + }; + + impl.detectOS = function (ua) { + return impl.findMatch(impl.mobileDetectRules.oss0, ua) || + impl.findMatch(impl.mobileDetectRules.oss, ua); + }; + + impl.getDeviceSmallerSide = function () { + return window.screen.width < window.screen.height ? + window.screen.width : + window.screen.height; + }; + + /** + * Constructor for MobileDetect object. + *
+ * Such an object will keep a reference to the given user-agent string and cache most of the detect queries.
+ *
+ * Find information how to download and install: + * github.com/hgoebl/mobile-detect.js/ + *
+ * + * @example
+     *     var md = new MobileDetect(window.navigator.userAgent);
+     *     if (md.mobile()) {
+     *         location.href = (md.mobileGrade() === 'A') ? '/mobile/' : '/lynx/';
+     *     }
+     * 
+ * + * @param {string} userAgent typically taken from window.navigator.userAgent or http_header['User-Agent'] + * @param {number} [maxPhoneWidth=600] only for browsers specify a value for the maximum + * width of smallest device side (in logical "CSS" pixels) until a device detected as mobile will be handled + * as phone. + * This is only used in cases where the device cannot be classified as phone or tablet.
+ * See Declaring Tablet Layouts + * for Android.
+ * If you provide a value < 0, then this "fuzzy" check is disabled. + * @constructor + * @global + */ + function MobileDetect(userAgent, maxPhoneWidth) { + this.ua = userAgent || ''; + this._cache = {}; + //600dp is typical 7" tablet minimum width + this.maxPhoneWidth = maxPhoneWidth || 600; + } + + MobileDetect.prototype = { + constructor: MobileDetect, + + /** + * Returns the detected phone or tablet type or null if it is not a mobile device. + *
+ * For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.
+ *
+ * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + * the patterns of detectmobilebrowsers.com. If this test + * is positive, a value of UnknownPhone, UnknownTablet or + * UnknownMobile is returned.
+ * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ *
+ * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + * and UnknownMobile, so you will get UnknownMobile here.
+ * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + *
+ * In most cases you will use the return value just as a boolean. + * + * @returns {String} the key for the phone family or tablet family, e.g. "Nexus". + * @function MobileDetect#mobile + */ + mobile: function () { + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + return this._cache.mobile; + }, + + /** + * Returns the detected phone type/family string or null. + *
+ * The returned tablet (family or producer) is one of following keys:
+ *
iPhone, BlackBerry, HTC, Nexus, Dell, Motorola, Samsung, LG, Sony, Asus, + * NokiaLumia, Micromax, Palm, Vertu, Pantech, Fly, Wiko, iMobile, SimValley, + * Wolfgang, Alcatel, Nintendo, Amoi, INQ, GenericPhone
+ *
+ * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + * the patterns of detectmobilebrowsers.com. If this test + * is positive, a value of UnknownPhone or UnknownMobile is returned.
+ * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ *
+ * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + * and UnknownMobile, so you will get null here, while {@link MobileDetect#mobile} + * will return UnknownMobile.
+ * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + *
+ * In most cases you will use the return value just as a boolean. + * + * @returns {String} the key of the phone family or producer, e.g. "iPhone" + * @function MobileDetect#phone + */ + phone: function () { + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + return this._cache.phone; + }, + + /** + * Returns the detected tablet type/family string or null. + *
+ * The returned tablet (family or producer) is one of following keys:
+ *
iPad, NexusTablet, SamsungTablet, Kindle, SurfaceTablet, HPTablet, AsusTablet, + * BlackBerryTablet, HTCtablet, MotorolaTablet, NookTablet, AcerTablet, + * ToshibaTablet, LGTablet, FujitsuTablet, PrestigioTablet, LenovoTablet, + * DellTablet, YarvikTablet, MedionTablet, ArnovaTablet, IntensoTablet, IRUTablet, + * MegafonTablet, EbodaTablet, AllViewTablet, ArchosTablet, AinolTablet, + * NokiaLumiaTablet, SonyTablet, PhilipsTablet, CubeTablet, CobyTablet, MIDTablet, + * MSITablet, SMiTTablet, RockChipTablet, FlyTablet, bqTablet, HuaweiTablet, + * NecTablet, PantechTablet, BronchoTablet, VersusTablet, ZyncTablet, + * PositivoTablet, NabiTablet, KoboTablet, DanewTablet, TexetTablet, + * PlaystationTablet, TrekstorTablet, PyleAudioTablet, AdvanTablet, + * DanyTechTablet, GalapadTablet, MicromaxTablet, KarbonnTablet, AllFineTablet, + * PROSCANTablet, YONESTablet, ChangJiaTablet, GUTablet, PointOfViewTablet, + * OvermaxTablet, HCLTablet, DPSTablet, VistureTablet, CrestaTablet, + * MediatekTablet, ConcordeTablet, GoCleverTablet, ModecomTablet, VoninoTablet, + * ECSTablet, StorexTablet, VodafoneTablet, EssentielBTablet, RossMoorTablet, + * iMobileTablet, TolinoTablet, AudioSonicTablet, AMPETablet, SkkTablet, + * TecnoTablet, JXDTablet, iJoyTablet, FX2Tablet, XoroTablet, ViewsonicTablet, + * OdysTablet, CaptivaTablet, IconbitTablet, TeclastTablet, OndaTablet, + * JaytechTablet, BlaupunktTablet, DigmaTablet, EvolioTablet, LavaTablet, + * AocTablet, MpmanTablet, CelkonTablet, WolderTablet, MiTablet, NibiruTablet, + * NexoTablet, LeaderTablet, UbislateTablet, PocketBookTablet, KocasoTablet, Hudl, + * TelstraTablet, GenericTablet
+ *
+ * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + * the patterns of detectmobilebrowsers.com. If this test + * is positive, a value of UnknownTablet or UnknownMobile is returned.
+ * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ *
+ * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + * and UnknownMobile, so you will get null here, while {@link MobileDetect#mobile} + * will return UnknownMobile.
+ * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + *
+ * In most cases you will use the return value just as a boolean. + * + * @returns {String} the key of the tablet family or producer, e.g. "SamsungTablet" + * @function MobileDetect#tablet + */ + tablet: function () { + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + return this._cache.tablet; + }, + + /** + * Returns the (first) detected user-agent string or null. + *
+ * The returned user-agent is one of following keys:
+ *
Vivaldi, Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, + * Blazer, Safari, Tizen, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, + * Puffin, Mercury, ObigoBrowser, NetFront, GenericBrowser, PaleMoon
+ *
+ * In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare + * cases where a mobile device pretends to be more than one particular browser. You can get the + * list of all matches with {@link MobileDetect#userAgents} or check for a particular value by + * providing one of the defined keys as first argument to {@link MobileDetect#is}. + * + * @returns {String} the key for the detected user-agent or null + * @function MobileDetect#userAgent + */ + userAgent: function () { + if (this._cache.userAgent === undefined) { + this._cache.userAgent = impl.findMatch(impl.mobileDetectRules.uas, this.ua); + } + return this._cache.userAgent; + }, + + /** + * Returns all detected user-agent strings. + *
+ * The array is empty or contains one or more of following keys:
+ *
Vivaldi, Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, + * Blazer, Safari, Tizen, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, + * Puffin, Mercury, ObigoBrowser, NetFront, GenericBrowser, PaleMoon
+ *
+ * In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare + * cases where a mobile device pretends to be more than one particular browser. You can get the + * list of all matches with {@link MobileDetect#userAgents} or check for a particular value by + * providing one of the defined keys as first argument to {@link MobileDetect#is}. + * + * @returns {Array} the array of detected user-agent keys or [] + * @function MobileDetect#userAgents + */ + userAgents: function () { + if (this._cache.userAgents === undefined) { + this._cache.userAgents = impl.findMatches(impl.mobileDetectRules.uas, this.ua); + } + return this._cache.userAgents; + }, + + /** + * Returns the detected operating system string or null. + *
+ * The operating system is one of following keys:
+ *
AndroidOS, BlackBerryOS, PalmOS, SymbianOS, WindowsMobileOS, WindowsPhoneOS, + * iOS, MeeGoOS, MaemoOS, JavaOS, webOS, badaOS, BREWOS
+ * + * @returns {String} the key for the detected operating system. + * @function MobileDetect#os + */ + os: function () { + if (this._cache.os === undefined) { + this._cache.os = impl.detectOS(this.ua); + } + return this._cache.os; + }, + + /** + * Get the version (as Number) of the given property in the User-Agent. + *
+ * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) + * + * @param {String} key a key defining a thing which has a version.
+ * You can use one of following keys:
+ *
Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast, + * Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini, + * Opera Mobi, UC Browser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser, + * Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon, Gecko, Trident, Presto, Goanna, + * iOS, Android, BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows + * CE, Windows NT, Symbian, webOS
+ * + * @returns {Number} the version as float or NaN if User-Agent doesn't contain this version. + * Be careful when comparing this value with '==' operator! + * @function MobileDetect#version + */ + version: function (key) { + return impl.getVersion(key, this.ua); + }, + + /** + * Get the version (as String) of the given property in the User-Agent. + *
+ * + * @param {String} key a key defining a thing which has a version.
+ * You can use one of following keys:
+ *
Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast, + * Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini, + * Opera Mobi, UC Browser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser, + * Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon, Gecko, Trident, Presto, Goanna, + * iOS, Android, BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows + * CE, Windows NT, Symbian, webOS
+ * + * @returns {String} the "raw" version as String or null if User-Agent doesn't contain this version. + * + * @function MobileDetect#versionStr + */ + versionStr: function (key) { + return impl.getVersionStr(key, this.ua); + }, + + /** + * Global test key against userAgent, os, phone, tablet and some other properties of userAgent string. + * + * @param {String} key the key (case-insensitive) of a userAgent, an operating system, phone or + * tablet family.
+ * For a complete list of possible values, see {@link MobileDetect#userAgent}, + * {@link MobileDetect#os}, {@link MobileDetect#phone}, {@link MobileDetect#tablet}.
+ * Additionally you have following keys:
+ *
Bot, MobileBot, DesktopMode, TV, WebKit, Console, Watch
+ * + * @returns {boolean} true when the given key is one of the defined keys of userAgent, os, phone, + * tablet or one of the listed additional keys, otherwise false + * @function MobileDetect#is + */ + is: function (key) { + return containsIC(this.userAgents(), key) || + equalIC(key, this.os()) || + equalIC(key, this.phone()) || + equalIC(key, this.tablet()) || + containsIC(impl.findMatches(impl.mobileDetectRules.utils, this.ua), key); + }, + + /** + * Do a quick test against navigator::userAgent. + * + * @param {String|RegExp} pattern the pattern, either as String or RegExp + * (a string will be converted to a case-insensitive RegExp). + * @returns {boolean} true when the pattern matches, otherwise false + * @function MobileDetect#match + */ + match: function (pattern) { + if (!(pattern instanceof RegExp)) { + pattern = new RegExp(pattern, 'i'); + } + return pattern.test(this.ua); + }, + + /** + * Checks whether the mobile device can be considered as phone regarding screen.width. + *
+ * Obviously this method makes sense in browser environments only (not for Node.js)! + * @param {number} [maxPhoneWidth] the maximum logical pixels (aka. CSS-pixels) to be considered as phone.
+ * The argument is optional and if not present or falsy, the value of the constructor is taken. + * @returns {boolean|undefined} undefined if screen size wasn't detectable, else true + * when screen.width is less or equal to maxPhoneWidth, otherwise false.
+ * Will always return undefined server-side. + */ + isPhoneSized: function (maxPhoneWidth) { + return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth); + }, + + /** + * Returns the mobile grade ('A', 'B', 'C'). + * + * @returns {String} one of the mobile grades ('A', 'B', 'C'). + * @function MobileDetect#mobileGrade + */ + mobileGrade: function () { + if (this._cache.grade === undefined) { + this._cache.grade = impl.mobileGrade(this); + } + return this._cache.grade; + } + }; + + // environment-dependent + if (typeof window !== 'undefined' && window.screen) { + MobileDetect.isPhoneSized = function (maxPhoneWidth) { + return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth; + }; + } else { + MobileDetect.isPhoneSized = function () {}; + } + + // should not be replaced by a completely new object - just overwrite existing methods + MobileDetect._impl = impl; + + MobileDetect.version = '1.3.3 2016-07-31'; + + return MobileDetect; +}); // end of call of define() +})((function (undefined) { + if (typeof module !== 'undefined' && module.exports) { + return function (factory) { module.exports = factory(); }; + } else if (typeof define === 'function' && define.amd) { + return define; + } else if (typeof window !== 'undefined') { + return function (factory) { window.MobileDetect = factory(); }; + } else { + // please file a bug if you get this error! + throw new Error('unknown environment'); + } +})()); + +//// [fixSignatureCaching.js] +// Repro from #10697 +(function (define, undefined) { + define(function () { + 'use strict'; + var impl = {}; + impl.mobileDetectRules = { + "phones": { + "iPhone": "\\biPhone\\b|\\biPod\\b", + "BlackBerry": "BlackBerry|\\bBB10\\b|rim[0-9]+", + "HTC": "HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m", + "Nexus": "Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6", + "Dell": "Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b", + "Motorola": "Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b", + "Samsung": "Samsung|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F", + "LG": "\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)", + "Sony": "SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533", + "Asus": "Asus.*Galaxy|PadFone.*Mobile", + "NokiaLumia": "Lumia [0-9]{3,4}", + "Micromax": "Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b", + "Palm": "PalmSource|Palm", + "Vertu": "Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature", + "Pantech": "PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790", + "Fly": "IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250", + "Wiko": "KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM", + "iMobile": "i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)", + "SimValley": "\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b", + "Wolfgang": "AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q", + "Alcatel": "Alcatel", + "Nintendo": "Nintendo 3DS", + "Amoi": "Amoi", + "INQ": "INQ", + "GenericPhone": "Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser" + }, + "tablets": { + "iPad": "iPad|iPad.*Mobile", + "NexusTablet": "Android.*Nexus[\\s]+(7|9|10)", + "SamsungTablet": "SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561", + "Kindle": "Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI)\\b", + "SurfaceTablet": "Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)", + "HPTablet": "HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10", + "AsusTablet": "^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K017 |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA", + "BlackBerryTablet": "PlayBook|RIM Tablet", + "HTCtablet": "HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410", + "MotorolaTablet": "xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617", + "NookTablet": "Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2", + "AcerTablet": "Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20", + "ToshibaTablet": "Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO", + "LGTablet": "\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b", + "FujitsuTablet": "Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b", + "PrestigioTablet": "PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002", + "LenovoTablet": "Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)", + "DellTablet": "Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7", + "YarvikTablet": "Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b", + "MedionTablet": "Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB", + "ArnovaTablet": "AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2", + "IntensoTablet": "INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004", + "IRUTablet": "M702pro", + "MegafonTablet": "MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b", + "EbodaTablet": "E-Boda (Supreme|Impresspeed|Izzycomm|Essential)", + "AllViewTablet": "Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)", + "ArchosTablet": "\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b", + "AinolTablet": "NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark", + "NokiaLumiaTablet": "Lumia 2520", + "SonyTablet": "Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612|SOT31", + "PhilipsTablet": "\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b", + "CubeTablet": "Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT", + "CobyTablet": "MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010", + "MIDTablet": "M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10", + "MSITablet": "MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b", + "SMiTTablet": "Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)", + "RockChipTablet": "Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A", + "FlyTablet": "IQ310|Fly Vision", + "bqTablet": "Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris E10)|Maxwell.*Lite|Maxwell.*Plus", + "HuaweiTablet": "MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim", + "NecTablet": "\\bN-06D|\\bN-08D", + "PantechTablet": "Pantech.*P4100", + "BronchoTablet": "Broncho.*(N701|N708|N802|a710)", + "VersusTablet": "TOUCHPAD.*[78910]|\\bTOUCHTAB\\b", + "ZyncTablet": "z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900", + "PositivoTablet": "TB07STA|TB10STA|TB07FTA|TB10FTA", + "NabiTablet": "Android.*\\bNabi", + "KoboTablet": "Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build", + "DanewTablet": "DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b", + "TexetTablet": "NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE", + "PlaystationTablet": "Playstation.*(Portable|Vita)", + "TrekstorTablet": "ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab", + "PyleAudioTablet": "\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b", + "AdvanTablet": "Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ", + "DanyTechTablet": "Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1", + "GalapadTablet": "Android.*\\bG1\\b", + "MicromaxTablet": "Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b", + "KarbonnTablet": "Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b", + "AllFineTablet": "Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide", + "PROSCANTablet": "\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b", + "YONESTablet": "BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026", + "ChangJiaTablet": "TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503", + "GUTablet": "TX-A1301|TX-M9002|Q702|kf026", + "PointOfViewTablet": "TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10", + "OvermaxTablet": "OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)", + "HCLTablet": "HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync", + "DPSTablet": "DPS Dream 9|DPS Dual 7", + "VistureTablet": "V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10", + "CrestaTablet": "CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989", + "MediatekTablet": "\\bMT8125|MT8389|MT8135|MT8377\\b", + "ConcordeTablet": "Concorde([ ]+)?Tab|ConCorde ReadMan", + "GoCleverTablet": "GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042", + "ModecomTablet": "FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003", + "VoninoTablet": "\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b", + "ECSTablet": "V07OT2|TM105A|S10OT1|TR10CS1", + "StorexTablet": "eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab", + "VodafoneTablet": "SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497", + "EssentielBTablet": "Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2", + "RossMoorTablet": "RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711", + "iMobileTablet": "i-mobile i-note", + "TolinoTablet": "tolino tab [0-9.]+|tolino shine", + "AudioSonicTablet": "\\bC-22Q|T7-QC|T-17B|T-17P\\b", + "AMPETablet": "Android.* A78 ", + "SkkTablet": "Android.* (SKYPAD|PHOENIX|CYCLOPS)", + "TecnoTablet": "TECNO P9", + "JXDTablet": "Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b", + "iJoyTablet": "Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)", + "FX2Tablet": "FX2 PAD7|FX2 PAD10", + "XoroTablet": "KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151", + "ViewsonicTablet": "ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a", + "OdysTablet": "LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10", + "CaptivaTablet": "CAPTIVA PAD", + "IconbitTablet": "NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S", + "TeclastTablet": "T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi", + "OndaTablet": "\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+", + "JaytechTablet": "TPC-PA762", + "BlaupunktTablet": "Endeavour 800NG|Endeavour 1010", + "DigmaTablet": "\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b", + "EvolioTablet": "ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b", + "LavaTablet": "QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b", + "AocTablet": "MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712", + "MpmanTablet": "MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010", + "CelkonTablet": "CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b", + "WolderTablet": "miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b", + "MiTablet": "\\bMI PAD\\b|\\bHM NOTE 1W\\b", + "NibiruTablet": "Nibiru M1|Nibiru Jupiter One", + "NexoTablet": "NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI", + "LeaderTablet": "TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100", + "UbislateTablet": "UbiSlate[\\s]?7C", + "PocketBookTablet": "Pocketbook", + "KocasoTablet": "\\b(TB-1207)\\b", + "Hudl": "Hudl HT7S3|Hudl 2", + "TelstraTablet": "T-Hub2", + "GenericTablet": "Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bJolla\\b|\\bTP750\\b" + }, + "oss": { + "AndroidOS": "Android", + "BlackBerryOS": "blackberry|\\bBB10\\b|rim tablet os", + "PalmOS": "PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino", + "SymbianOS": "Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b", + "WindowsMobileOS": "Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;", + "WindowsPhoneOS": "Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;", + "iOS": "\\biPhone.*Mobile|\\biPod|\\biPad", + "MeeGoOS": "MeeGo", + "MaemoOS": "Maemo", + "JavaOS": "J2ME\/|\\bMIDP\\b|\\bCLDC\\b", + "webOS": "webOS|hpwOS", + "badaOS": "\\bBada\\b", + "BREWOS": "BREW" + }, + "uas": { + "Vivaldi": "Vivaldi", + "Chrome": "\\bCrMo\\b|CriOS|Android.*Chrome\/[.0-9]* (Mobile)?", + "Dolfin": "\\bDolfin\\b", + "Opera": "Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\/[0-9.]+|Coast\/[0-9.]+", + "Skyfire": "Skyfire", + "Edge": "Mobile Safari\/[.0-9]* Edge", + "IE": "IEMobile|MSIEMobile", + "Firefox": "fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile", + "Bolt": "bolt", + "TeaShark": "teashark", + "Blazer": "Blazer", + "Safari": "Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari", + "Tizen": "Tizen", + "UCBrowser": "UC.*Browser|UCWEB", + "baiduboxapp": "baiduboxapp", + "baidubrowser": "baidubrowser", + "DiigoBrowser": "DiigoBrowser", + "Puffin": "Puffin", + "Mercury": "\\bMercury\\b", + "ObigoBrowser": "Obigo", + "NetFront": "NF-Browser", + "GenericBrowser": "NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger", + "PaleMoon": "Android.*PaleMoon|Mobile.*PaleMoon" + }, + "props": { + "Mobile": "Mobile\/[VER]", + "Build": "Build\/[VER]", + "Version": "Version\/[VER]", + "VendorID": "VendorID\/[VER]", + "iPad": "iPad.*CPU[a-z ]+[VER]", + "iPhone": "iPhone.*CPU[a-z ]+[VER]", + "iPod": "iPod.*CPU[a-z ]+[VER]", + "Kindle": "Kindle\/[VER]", + "Chrome": [ + "Chrome\/[VER]", + "CriOS\/[VER]", + "CrMo\/[VER]" + ], + "Coast": [ + "Coast\/[VER]" + ], + "Dolfin": "Dolfin\/[VER]", + "Firefox": "Firefox\/[VER]", + "Fennec": "Fennec\/[VER]", + "Edge": "Edge\/[VER]", + "IE": [ + "IEMobile\/[VER];", + "IEMobile [VER]", + "MSIE [VER];", + "Trident\/[0-9.]+;.*rv:[VER]" + ], + "NetFront": "NetFront\/[VER]", + "NokiaBrowser": "NokiaBrowser\/[VER]", + "Opera": [ + " OPR\/[VER]", + "Opera Mini\/[VER]", + "Version\/[VER]" + ], + "Opera Mini": "Opera Mini\/[VER]", + "Opera Mobi": "Version\/[VER]", + "UC Browser": "UC Browser[VER]", + "MQQBrowser": "MQQBrowser\/[VER]", + "MicroMessenger": "MicroMessenger\/[VER]", + "baiduboxapp": "baiduboxapp\/[VER]", + "baidubrowser": "baidubrowser\/[VER]", + "Iron": "Iron\/[VER]", + "Safari": [ + "Version\/[VER]", + "Safari\/[VER]" + ], + "Skyfire": "Skyfire\/[VER]", + "Tizen": "Tizen\/[VER]", + "Webkit": "webkit[ \/][VER]", + "PaleMoon": "PaleMoon\/[VER]", + "Gecko": "Gecko\/[VER]", + "Trident": "Trident\/[VER]", + "Presto": "Presto\/[VER]", + "Goanna": "Goanna\/[VER]", + "iOS": " \\bi?OS\\b [VER][ ;]{1}", + "Android": "Android [VER]", + "BlackBerry": [ + "BlackBerry[\\w]+\/[VER]", + "BlackBerry.*Version\/[VER]", + "Version\/[VER]" + ], + "BREW": "BREW [VER]", + "Java": "Java\/[VER]", + "Windows Phone OS": [ + "Windows Phone OS [VER]", + "Windows Phone [VER]" + ], + "Windows Phone": "Windows Phone [VER]", + "Windows CE": "Windows CE\/[VER]", + "Windows NT": "Windows NT [VER]", + "Symbian": [ + "SymbianOS\/[VER]", + "Symbian\/[VER]" + ], + "webOS": [ + "webOS\/[VER]", + "hpwOS\/[VER];" + ] + }, + "utils": { + "Bot": "Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom", + "MobileBot": "Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker\/M1A1-R2D2", + "DesktopMode": "WPDesktop", + "TV": "SonyDTV|HbbTV", + "WebKit": "(webkit)[ \/]([\\w.]+)", + "Console": "\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\\b", + "Watch": "SM-V700" + } + }; + // following patterns come from http://detectmobilebrowsers.com/ + impl.detectMobileBrowsers = { + fullPattern: /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i, + shortPattern: /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i, + tabletPattern: /android|ipad|playbook|silk/i + }; + var hasOwnProp = Object.prototype.hasOwnProperty, isArray; + impl.FALLBACK_PHONE = 'UnknownPhone'; + impl.FALLBACK_TABLET = 'UnknownTablet'; + impl.FALLBACK_MOBILE = 'UnknownMobile'; + isArray = ('isArray' in Array) ? + Array.isArray : function (value) { return Object.prototype.toString.call(value) === '[object Array]'; }; + function equalIC(a, b) { + return a != null && b != null && a.toLowerCase() === b.toLowerCase(); + } + function containsIC(array, value) { + var valueLC, i, len = array.length; + if (!len || !value) { + return false; + } + valueLC = value.toLowerCase(); + for (i = 0; i < len; ++i) { + if (valueLC === array[i].toLowerCase()) { + return true; + } + } + return false; + } + function convertPropsToRegExp(object) { + for (var key in object) { + if (hasOwnProp.call(object, key)) { + object[key] = new RegExp(object[key], 'i'); + } + } + } + (function init() { + var key, values, value, i, len, verPos, mobileDetectRules = impl.mobileDetectRules; + for (key in mobileDetectRules.props) { + if (hasOwnProp.call(mobileDetectRules.props, key)) { + values = mobileDetectRules.props[key]; + if (!isArray(values)) { + values = [values]; + } + len = values.length; + for (i = 0; i < len; ++i) { + value = values[i]; + verPos = value.indexOf('[VER]'); + if (verPos >= 0) { + value = value.substring(0, verPos) + '([\\w._\\+]+)' + value.substring(verPos + 5); + } + values[i] = new RegExp(value, 'i'); + } + mobileDetectRules.props[key] = values; + } + } + convertPropsToRegExp(mobileDetectRules.oss); + convertPropsToRegExp(mobileDetectRules.phones); + convertPropsToRegExp(mobileDetectRules.tablets); + convertPropsToRegExp(mobileDetectRules.uas); + convertPropsToRegExp(mobileDetectRules.utils); + // copy some patterns to oss0 which are tested first (see issue#15) + mobileDetectRules.oss0 = { + WindowsPhoneOS: mobileDetectRules.oss.WindowsPhoneOS, + WindowsMobileOS: mobileDetectRules.oss.WindowsMobileOS + }; + }()); + /** + * Test userAgent string against a set of rules and find the first matched key. + * @param {Object} rules (key is String, value is RegExp) + * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent'). + * @returns {String|null} the matched key if found, otherwise null + * @private + */ + impl.findMatch = function (rules, userAgent) { + for (var key in rules) { + if (hasOwnProp.call(rules, key)) { + if (rules[key].test(userAgent)) { + return key; + } + } + } + return null; + }; + /** + * Test userAgent string against a set of rules and return an array of matched keys. + * @param {Object} rules (key is String, value is RegExp) + * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent'). + * @returns {Array} an array of matched keys, may be empty when there is no match, but not null + * @private + */ + impl.findMatches = function (rules, userAgent) { + var result = []; + for (var key in rules) { + if (hasOwnProp.call(rules, key)) { + if (rules[key].test(userAgent)) { + result.push(key); + } + } + } + return result; + }; + /** + * Check the version of the given property in the User-Agent. + * + * @param {String} propertyName + * @param {String} userAgent + * @return {String} version or null if version not found + * @private + */ + impl.getVersionStr = function (propertyName, userAgent) { + var props = impl.mobileDetectRules.props, patterns, i, len, match; + if (hasOwnProp.call(props, propertyName)) { + patterns = props[propertyName]; + len = patterns.length; + for (i = 0; i < len; ++i) { + match = patterns[i].exec(userAgent); + if (match !== null) { + return match[1]; + } + } + } + return null; + }; + /** + * Check the version of the given property in the User-Agent. + * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) + * + * @param {String} propertyName + * @param {String} userAgent + * @return {Number} version or NaN if version not found + * @private + */ + impl.getVersion = function (propertyName, userAgent) { + var version = impl.getVersionStr(propertyName, userAgent); + return version ? impl.prepareVersionNo(version) : NaN; + }; + /** + * Prepare the version number. + * + * @param {String} version + * @return {Number} the version number as a floating number + * @private + */ + impl.prepareVersionNo = function (version) { + var numbers; + numbers = version.split(/[a-z._ \/\-]/i); + if (numbers.length === 1) { + version = numbers[0]; + } + if (numbers.length > 1) { + version = numbers[0] + '.'; + numbers.shift(); + version += numbers.join(''); + } + return Number(version); + }; + impl.isMobileFallback = function (userAgent) { + return impl.detectMobileBrowsers.fullPattern.test(userAgent) || + impl.detectMobileBrowsers.shortPattern.test(userAgent.substr(0, 4)); + }; + impl.isTabletFallback = function (userAgent) { + return impl.detectMobileBrowsers.tabletPattern.test(userAgent); + }; + impl.prepareDetectionCache = function (cache, userAgent, maxPhoneWidth) { + if (cache.mobile !== undefined) { + return; + } + var phone, tablet, phoneSized; + // first check for stronger tablet rules, then phone (see issue#5) + tablet = impl.findMatch(impl.mobileDetectRules.tablets, userAgent); + if (tablet) { + cache.mobile = cache.tablet = tablet; + cache.phone = null; + return; // unambiguously identified as tablet + } + phone = impl.findMatch(impl.mobileDetectRules.phones, userAgent); + if (phone) { + cache.mobile = cache.phone = phone; + cache.tablet = null; + return; // unambiguously identified as phone + } + // our rules haven't found a match -> try more general fallback rules + if (impl.isMobileFallback(userAgent)) { + phoneSized = MobileDetect.isPhoneSized(maxPhoneWidth); + if (phoneSized === undefined) { + cache.mobile = impl.FALLBACK_MOBILE; + cache.tablet = cache.phone = null; + } + else if (phoneSized) { + cache.mobile = cache.phone = impl.FALLBACK_PHONE; + cache.tablet = null; + } + else { + cache.mobile = cache.tablet = impl.FALLBACK_TABLET; + cache.phone = null; + } + } + else if (impl.isTabletFallback(userAgent)) { + cache.mobile = cache.tablet = impl.FALLBACK_TABLET; + cache.phone = null; + } + else { + // not mobile at all! + cache.mobile = cache.tablet = cache.phone = null; + } + }; + // t is a reference to a MobileDetect instance + impl.mobileGrade = function (t) { + // impl note: + // To keep in sync w/ Mobile_Detect.php easily, the following code is tightly aligned to the PHP version. + // When changes are made in Mobile_Detect.php, copy this method and replace: + // $this-> / t. + // self::MOBILE_GRADE_(.) / '$1' + // , self::VERSION_TYPE_FLOAT / (nothing) + // isIOS() / os('iOS') + // [reg] / (nothing) <-- jsdelivr complaining about unescaped unicode character U+00AE + var $isMobile = t.mobile() !== null; + if ( + // Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1) + t.os('iOS') && t.version('iPad') >= 4.3 || + t.os('iOS') && t.version('iPhone') >= 3.1 || + t.os('iOS') && t.version('iPod') >= 3.1 || + // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) + // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM + // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices + // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 + (t.version('Android') > 2.1 && t.is('Webkit')) || + // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800 + t.version('Windows Phone OS') >= 7.0 || + // Blackberry 7 - Tested on BlackBerry Torch 9810 + // Blackberry 6.0 - Tested on the Torch 9800 and Style 9670 + t.is('BlackBerry') && t.version('BlackBerry') >= 6.0 || + // Blackberry Playbook (1.0-2.0) - Tested on PlayBook + t.match('Playbook.*Tablet') || + // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0) + (t.version('webOS') >= 1.4 && t.match('Palm|Pre|Pixi')) || + // Palm WebOS 3.0 - Tested on HP TouchPad + t.match('hp.*TouchPad') || + // Firefox Mobile (12 Beta) - Tested on Android 2.3 device + (t.is('Firefox') && t.version('Firefox') >= 12) || + // Chrome for Android - Tested on Android 4.0, 4.1 device + (t.is('Chrome') && t.is('AndroidOS') && t.version('Android') >= 4.0) || + // Skyfire 4.1 - Tested on Android 2.3 device + (t.is('Skyfire') && t.version('Skyfire') >= 4.1 && t.is('AndroidOS') && t.version('Android') >= 2.3) || + // Opera Mobile 11.5-12: Tested on Android 2.3 + (t.is('Opera') && t.version('Opera Mobi') > 11 && t.is('AndroidOS')) || + // Meego 1.2 - Tested on Nokia 950 and N9 + t.is('MeeGoOS') || + // Tizen (pre-release) - Tested on early hardware + t.is('Tizen') || + // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser + // @todo: more tests here! + t.is('Dolfin') && t.version('Bada') >= 2.0 || + // UC Browser - Tested on Android 2.3 device + ((t.is('UC Browser') || t.is('Dolfin')) && t.version('Android') >= 2.3) || + // Kindle 3 and Fire - Tested on the built-in WebKit browser for each + (t.match('Kindle Fire') || + t.is('Kindle') && t.version('Kindle') >= 3.0) || + // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet + t.is('AndroidOS') && t.is('NookTablet') || + // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7 + t.version('Chrome') >= 11 && !$isMobile || + // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7 + t.version('Safari') >= 5.0 && !$isMobile || + // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7 + t.version('Firefox') >= 4.0 && !$isMobile || + // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 + t.version('MSIE') >= 7.0 && !$isMobile || + // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 + // @reference: http://my.opera.com/community/openweb/idopera/ + t.version('Opera') >= 10 && !$isMobile) { + return 'A'; + } + if (t.os('iOS') && t.version('iPad') < 4.3 || + t.os('iOS') && t.version('iPhone') < 3.1 || + t.os('iOS') && t.version('iPod') < 3.1 || + // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 + t.is('Blackberry') && t.version('BlackBerry') >= 5 && t.version('BlackBerry') < 6 || + //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 + (t.version('Opera Mini') >= 5.0 && t.version('Opera Mini') <= 6.5 && + (t.version('Android') >= 2.3 || t.is('iOS'))) || + // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) + t.match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || + // @todo: report this (tested on Nokia N71) + t.version('Opera Mobi') >= 11 && t.is('SymbianOS')) { + return 'B'; + } + if ( + // Blackberry 4.x - Tested on the Curve 8330 + t.version('BlackBerry') < 5.0 || + // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) + t.match('MSIEMobile|Windows CE.*Mobile') || t.version('Windows Mobile') <= 5.2) { + return 'C'; + } + //All older smartphone platforms and featurephones - Any device that doesn't support media queries + //will receive the basic, C grade experience. + return 'C'; + }; + impl.detectOS = function (ua) { + return impl.findMatch(impl.mobileDetectRules.oss0, ua) || + impl.findMatch(impl.mobileDetectRules.oss, ua); + }; + impl.getDeviceSmallerSide = function () { + return window.screen.width < window.screen.height ? + window.screen.width : + window.screen.height; + }; + /** + * Constructor for MobileDetect object. + *
+ * Such an object will keep a reference to the given user-agent string and cache most of the detect queries.
+ *
+ * Find information how to download and install: + * github.com/hgoebl/mobile-detect.js/ + *
+ * + * @example
+         *     var md = new MobileDetect(window.navigator.userAgent);
+         *     if (md.mobile()) {
+         *         location.href = (md.mobileGrade() === 'A') ? '/mobile/' : '/lynx/';
+         *     }
+         * 
+ * + * @param {string} userAgent typically taken from window.navigator.userAgent or http_header['User-Agent'] + * @param {number} [maxPhoneWidth=600] only for browsers specify a value for the maximum + * width of smallest device side (in logical "CSS" pixels) until a device detected as mobile will be handled + * as phone. + * This is only used in cases where the device cannot be classified as phone or tablet.
+ * See Declaring Tablet Layouts + * for Android.
+ * If you provide a value < 0, then this "fuzzy" check is disabled. + * @constructor + * @global + */ + function MobileDetect(userAgent, maxPhoneWidth) { + this.ua = userAgent || ''; + this._cache = {}; + //600dp is typical 7" tablet minimum width + this.maxPhoneWidth = maxPhoneWidth || 600; + } + MobileDetect.prototype = { + constructor: MobileDetect, + /** + * Returns the detected phone or tablet type or null if it is not a mobile device. + *
+ * For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.
+ *
+ * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + * the patterns of detectmobilebrowsers.com. If this test + * is positive, a value of UnknownPhone, UnknownTablet or + * UnknownMobile is returned.
+ * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ *
+ * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + * and UnknownMobile, so you will get UnknownMobile here.
+ * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + *
+ * In most cases you will use the return value just as a boolean. + * + * @returns {String} the key for the phone family or tablet family, e.g. "Nexus". + * @function MobileDetect#mobile + */ + mobile: function () { + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + return this._cache.mobile; + }, + /** + * Returns the detected phone type/family string or null. + *
+ * The returned tablet (family or producer) is one of following keys:
+ *
iPhone, BlackBerry, HTC, Nexus, Dell, Motorola, Samsung, LG, Sony, Asus, + * NokiaLumia, Micromax, Palm, Vertu, Pantech, Fly, Wiko, iMobile, SimValley, + * Wolfgang, Alcatel, Nintendo, Amoi, INQ, GenericPhone
+ *
+ * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + * the patterns of detectmobilebrowsers.com. If this test + * is positive, a value of UnknownPhone or UnknownMobile is returned.
+ * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ *
+ * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + * and UnknownMobile, so you will get null here, while {@link MobileDetect#mobile} + * will return UnknownMobile.
+ * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + *
+ * In most cases you will use the return value just as a boolean. + * + * @returns {String} the key of the phone family or producer, e.g. "iPhone" + * @function MobileDetect#phone + */ + phone: function () { + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + return this._cache.phone; + }, + /** + * Returns the detected tablet type/family string or null. + *
+ * The returned tablet (family or producer) is one of following keys:
+ *
iPad, NexusTablet, SamsungTablet, Kindle, SurfaceTablet, HPTablet, AsusTablet, + * BlackBerryTablet, HTCtablet, MotorolaTablet, NookTablet, AcerTablet, + * ToshibaTablet, LGTablet, FujitsuTablet, PrestigioTablet, LenovoTablet, + * DellTablet, YarvikTablet, MedionTablet, ArnovaTablet, IntensoTablet, IRUTablet, + * MegafonTablet, EbodaTablet, AllViewTablet, ArchosTablet, AinolTablet, + * NokiaLumiaTablet, SonyTablet, PhilipsTablet, CubeTablet, CobyTablet, MIDTablet, + * MSITablet, SMiTTablet, RockChipTablet, FlyTablet, bqTablet, HuaweiTablet, + * NecTablet, PantechTablet, BronchoTablet, VersusTablet, ZyncTablet, + * PositivoTablet, NabiTablet, KoboTablet, DanewTablet, TexetTablet, + * PlaystationTablet, TrekstorTablet, PyleAudioTablet, AdvanTablet, + * DanyTechTablet, GalapadTablet, MicromaxTablet, KarbonnTablet, AllFineTablet, + * PROSCANTablet, YONESTablet, ChangJiaTablet, GUTablet, PointOfViewTablet, + * OvermaxTablet, HCLTablet, DPSTablet, VistureTablet, CrestaTablet, + * MediatekTablet, ConcordeTablet, GoCleverTablet, ModecomTablet, VoninoTablet, + * ECSTablet, StorexTablet, VodafoneTablet, EssentielBTablet, RossMoorTablet, + * iMobileTablet, TolinoTablet, AudioSonicTablet, AMPETablet, SkkTablet, + * TecnoTablet, JXDTablet, iJoyTablet, FX2Tablet, XoroTablet, ViewsonicTablet, + * OdysTablet, CaptivaTablet, IconbitTablet, TeclastTablet, OndaTablet, + * JaytechTablet, BlaupunktTablet, DigmaTablet, EvolioTablet, LavaTablet, + * AocTablet, MpmanTablet, CelkonTablet, WolderTablet, MiTablet, NibiruTablet, + * NexoTablet, LeaderTablet, UbislateTablet, PocketBookTablet, KocasoTablet, Hudl, + * TelstraTablet, GenericTablet
+ *
+ * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + * the patterns of detectmobilebrowsers.com. If this test + * is positive, a value of UnknownTablet or UnknownMobile is returned.
+ * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ *
+ * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + * and UnknownMobile, so you will get null here, while {@link MobileDetect#mobile} + * will return UnknownMobile.
+ * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + *
+ * In most cases you will use the return value just as a boolean. + * + * @returns {String} the key of the tablet family or producer, e.g. "SamsungTablet" + * @function MobileDetect#tablet + */ + tablet: function () { + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + return this._cache.tablet; + }, + /** + * Returns the (first) detected user-agent string or null. + *
+ * The returned user-agent is one of following keys:
+ *
Vivaldi, Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, + * Blazer, Safari, Tizen, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, + * Puffin, Mercury, ObigoBrowser, NetFront, GenericBrowser, PaleMoon
+ *
+ * In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare + * cases where a mobile device pretends to be more than one particular browser. You can get the + * list of all matches with {@link MobileDetect#userAgents} or check for a particular value by + * providing one of the defined keys as first argument to {@link MobileDetect#is}. + * + * @returns {String} the key for the detected user-agent or null + * @function MobileDetect#userAgent + */ + userAgent: function () { + if (this._cache.userAgent === undefined) { + this._cache.userAgent = impl.findMatch(impl.mobileDetectRules.uas, this.ua); + } + return this._cache.userAgent; + }, + /** + * Returns all detected user-agent strings. + *
+ * The array is empty or contains one or more of following keys:
+ *
Vivaldi, Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, + * Blazer, Safari, Tizen, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, + * Puffin, Mercury, ObigoBrowser, NetFront, GenericBrowser, PaleMoon
+ *
+ * In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare + * cases where a mobile device pretends to be more than one particular browser. You can get the + * list of all matches with {@link MobileDetect#userAgents} or check for a particular value by + * providing one of the defined keys as first argument to {@link MobileDetect#is}. + * + * @returns {Array} the array of detected user-agent keys or [] + * @function MobileDetect#userAgents + */ + userAgents: function () { + if (this._cache.userAgents === undefined) { + this._cache.userAgents = impl.findMatches(impl.mobileDetectRules.uas, this.ua); + } + return this._cache.userAgents; + }, + /** + * Returns the detected operating system string or null. + *
+ * The operating system is one of following keys:
+ *
AndroidOS, BlackBerryOS, PalmOS, SymbianOS, WindowsMobileOS, WindowsPhoneOS, + * iOS, MeeGoOS, MaemoOS, JavaOS, webOS, badaOS, BREWOS
+ * + * @returns {String} the key for the detected operating system. + * @function MobileDetect#os + */ + os: function () { + if (this._cache.os === undefined) { + this._cache.os = impl.detectOS(this.ua); + } + return this._cache.os; + }, + /** + * Get the version (as Number) of the given property in the User-Agent. + *
+ * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) + * + * @param {String} key a key defining a thing which has a version.
+ * You can use one of following keys:
+ *
Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast, + * Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini, + * Opera Mobi, UC Browser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser, + * Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon, Gecko, Trident, Presto, Goanna, + * iOS, Android, BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows + * CE, Windows NT, Symbian, webOS
+ * + * @returns {Number} the version as float or NaN if User-Agent doesn't contain this version. + * Be careful when comparing this value with '==' operator! + * @function MobileDetect#version + */ + version: function (key) { + return impl.getVersion(key, this.ua); + }, + /** + * Get the version (as String) of the given property in the User-Agent. + *
+ * + * @param {String} key a key defining a thing which has a version.
+ * You can use one of following keys:
+ *
Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast, + * Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini, + * Opera Mobi, UC Browser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser, + * Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon, Gecko, Trident, Presto, Goanna, + * iOS, Android, BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows + * CE, Windows NT, Symbian, webOS
+ * + * @returns {String} the "raw" version as String or null if User-Agent doesn't contain this version. + * + * @function MobileDetect#versionStr + */ + versionStr: function (key) { + return impl.getVersionStr(key, this.ua); + }, + /** + * Global test key against userAgent, os, phone, tablet and some other properties of userAgent string. + * + * @param {String} key the key (case-insensitive) of a userAgent, an operating system, phone or + * tablet family.
+ * For a complete list of possible values, see {@link MobileDetect#userAgent}, + * {@link MobileDetect#os}, {@link MobileDetect#phone}, {@link MobileDetect#tablet}.
+ * Additionally you have following keys:
+ *
Bot, MobileBot, DesktopMode, TV, WebKit, Console, Watch
+ * + * @returns {boolean} true when the given key is one of the defined keys of userAgent, os, phone, + * tablet or one of the listed additional keys, otherwise false + * @function MobileDetect#is + */ + is: function (key) { + return containsIC(this.userAgents(), key) || + equalIC(key, this.os()) || + equalIC(key, this.phone()) || + equalIC(key, this.tablet()) || + containsIC(impl.findMatches(impl.mobileDetectRules.utils, this.ua), key); + }, + /** + * Do a quick test against navigator::userAgent. + * + * @param {String|RegExp} pattern the pattern, either as String or RegExp + * (a string will be converted to a case-insensitive RegExp). + * @returns {boolean} true when the pattern matches, otherwise false + * @function MobileDetect#match + */ + match: function (pattern) { + if (!(pattern instanceof RegExp)) { + pattern = new RegExp(pattern, 'i'); + } + return pattern.test(this.ua); + }, + /** + * Checks whether the mobile device can be considered as phone regarding screen.width. + *
+ * Obviously this method makes sense in browser environments only (not for Node.js)! + * @param {number} [maxPhoneWidth] the maximum logical pixels (aka. CSS-pixels) to be considered as phone.
+ * The argument is optional and if not present or falsy, the value of the constructor is taken. + * @returns {boolean|undefined} undefined if screen size wasn't detectable, else true + * when screen.width is less or equal to maxPhoneWidth, otherwise false.
+ * Will always return undefined server-side. + */ + isPhoneSized: function (maxPhoneWidth) { + return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth); + }, + /** + * Returns the mobile grade ('A', 'B', 'C'). + * + * @returns {String} one of the mobile grades ('A', 'B', 'C'). + * @function MobileDetect#mobileGrade + */ + mobileGrade: function () { + if (this._cache.grade === undefined) { + this._cache.grade = impl.mobileGrade(this); + } + return this._cache.grade; + } + }; + // environment-dependent + if (typeof window !== 'undefined' && window.screen) { + MobileDetect.isPhoneSized = function (maxPhoneWidth) { + return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth; + }; + } + else { + MobileDetect.isPhoneSized = function () { }; + } + // should not be replaced by a completely new object - just overwrite existing methods + MobileDetect._impl = impl; + MobileDetect.version = '1.3.3 2016-07-31'; + return MobileDetect; + }); // end of call of define() +})((function (undefined) { + if (typeof module !== 'undefined' && module.exports) { + return function (factory) { module.exports = factory(); }; + } + else if (typeof define === 'function' && define.amd) { + return define; + } + else if (typeof window !== 'undefined') { + return function (factory) { window.MobileDetect = factory(); }; + } + else { + // please file a bug if you get this error! + throw new Error('unknown environment'); + } +})()); diff --git a/tests/cases/conformance/fixSignatureCaching.ts b/tests/cases/conformance/fixSignatureCaching.ts new file mode 100644 index 00000000000..e9f3f3e3be5 --- /dev/null +++ b/tests/cases/conformance/fixSignatureCaching.ts @@ -0,0 +1,985 @@ +// Repro from #10697 + +(function (define, undefined) { +define(function () { + 'use strict'; + + var impl = {}; + + impl.mobileDetectRules = { + "phones": { + "iPhone": "\\biPhone\\b|\\biPod\\b", + "BlackBerry": "BlackBerry|\\bBB10\\b|rim[0-9]+", + "HTC": "HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m", + "Nexus": "Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6", + "Dell": "Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b", + "Motorola": "Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b", + "Samsung": "Samsung|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F", + "LG": "\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)", + "Sony": "SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533", + "Asus": "Asus.*Galaxy|PadFone.*Mobile", + "NokiaLumia": "Lumia [0-9]{3,4}", + "Micromax": "Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b", + "Palm": "PalmSource|Palm", + "Vertu": "Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature", + "Pantech": "PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790", + "Fly": "IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250", + "Wiko": "KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM", + "iMobile": "i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)", + "SimValley": "\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b", + "Wolfgang": "AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q", + "Alcatel": "Alcatel", + "Nintendo": "Nintendo 3DS", + "Amoi": "Amoi", + "INQ": "INQ", + "GenericPhone": "Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser" + }, + "tablets": { + "iPad": "iPad|iPad.*Mobile", + "NexusTablet": "Android.*Nexus[\\s]+(7|9|10)", + "SamsungTablet": "SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561", + "Kindle": "Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI)\\b", + "SurfaceTablet": "Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)", + "HPTablet": "HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10", + "AsusTablet": "^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K017 |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA", + "BlackBerryTablet": "PlayBook|RIM Tablet", + "HTCtablet": "HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410", + "MotorolaTablet": "xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617", + "NookTablet": "Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2", + "AcerTablet": "Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20", + "ToshibaTablet": "Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO", + "LGTablet": "\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b", + "FujitsuTablet": "Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b", + "PrestigioTablet": "PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002", + "LenovoTablet": "Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)", + "DellTablet": "Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7", + "YarvikTablet": "Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b", + "MedionTablet": "Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB", + "ArnovaTablet": "AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2", + "IntensoTablet": "INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004", + "IRUTablet": "M702pro", + "MegafonTablet": "MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b", + "EbodaTablet": "E-Boda (Supreme|Impresspeed|Izzycomm|Essential)", + "AllViewTablet": "Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)", + "ArchosTablet": "\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b", + "AinolTablet": "NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark", + "NokiaLumiaTablet": "Lumia 2520", + "SonyTablet": "Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612|SOT31", + "PhilipsTablet": "\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b", + "CubeTablet": "Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT", + "CobyTablet": "MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010", + "MIDTablet": "M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10", + "MSITablet": "MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b", + "SMiTTablet": "Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)", + "RockChipTablet": "Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A", + "FlyTablet": "IQ310|Fly Vision", + "bqTablet": "Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris E10)|Maxwell.*Lite|Maxwell.*Plus", + "HuaweiTablet": "MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim", + "NecTablet": "\\bN-06D|\\bN-08D", + "PantechTablet": "Pantech.*P4100", + "BronchoTablet": "Broncho.*(N701|N708|N802|a710)", + "VersusTablet": "TOUCHPAD.*[78910]|\\bTOUCHTAB\\b", + "ZyncTablet": "z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900", + "PositivoTablet": "TB07STA|TB10STA|TB07FTA|TB10FTA", + "NabiTablet": "Android.*\\bNabi", + "KoboTablet": "Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build", + "DanewTablet": "DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b", + "TexetTablet": "NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE", + "PlaystationTablet": "Playstation.*(Portable|Vita)", + "TrekstorTablet": "ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab", + "PyleAudioTablet": "\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b", + "AdvanTablet": "Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ", + "DanyTechTablet": "Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1", + "GalapadTablet": "Android.*\\bG1\\b", + "MicromaxTablet": "Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b", + "KarbonnTablet": "Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b", + "AllFineTablet": "Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide", + "PROSCANTablet": "\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b", + "YONESTablet": "BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026", + "ChangJiaTablet": "TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503", + "GUTablet": "TX-A1301|TX-M9002|Q702|kf026", + "PointOfViewTablet": "TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10", + "OvermaxTablet": "OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)", + "HCLTablet": "HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync", + "DPSTablet": "DPS Dream 9|DPS Dual 7", + "VistureTablet": "V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10", + "CrestaTablet": "CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989", + "MediatekTablet": "\\bMT8125|MT8389|MT8135|MT8377\\b", + "ConcordeTablet": "Concorde([ ]+)?Tab|ConCorde ReadMan", + "GoCleverTablet": "GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042", + "ModecomTablet": "FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003", + "VoninoTablet": "\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b", + "ECSTablet": "V07OT2|TM105A|S10OT1|TR10CS1", + "StorexTablet": "eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab", + "VodafoneTablet": "SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497", + "EssentielBTablet": "Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2", + "RossMoorTablet": "RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711", + "iMobileTablet": "i-mobile i-note", + "TolinoTablet": "tolino tab [0-9.]+|tolino shine", + "AudioSonicTablet": "\\bC-22Q|T7-QC|T-17B|T-17P\\b", + "AMPETablet": "Android.* A78 ", + "SkkTablet": "Android.* (SKYPAD|PHOENIX|CYCLOPS)", + "TecnoTablet": "TECNO P9", + "JXDTablet": "Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b", + "iJoyTablet": "Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)", + "FX2Tablet": "FX2 PAD7|FX2 PAD10", + "XoroTablet": "KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151", + "ViewsonicTablet": "ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a", + "OdysTablet": "LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10", + "CaptivaTablet": "CAPTIVA PAD", + "IconbitTablet": "NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S", + "TeclastTablet": "T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi", + "OndaTablet": "\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+", + "JaytechTablet": "TPC-PA762", + "BlaupunktTablet": "Endeavour 800NG|Endeavour 1010", + "DigmaTablet": "\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b", + "EvolioTablet": "ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b", + "LavaTablet": "QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b", + "AocTablet": "MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712", + "MpmanTablet": "MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010", + "CelkonTablet": "CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b", + "WolderTablet": "miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b", + "MiTablet": "\\bMI PAD\\b|\\bHM NOTE 1W\\b", + "NibiruTablet": "Nibiru M1|Nibiru Jupiter One", + "NexoTablet": "NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI", + "LeaderTablet": "TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100", + "UbislateTablet": "UbiSlate[\\s]?7C", + "PocketBookTablet": "Pocketbook", + "KocasoTablet": "\\b(TB-1207)\\b", + "Hudl": "Hudl HT7S3|Hudl 2", + "TelstraTablet": "T-Hub2", + "GenericTablet": "Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bJolla\\b|\\bTP750\\b" + }, + "oss": { + "AndroidOS": "Android", + "BlackBerryOS": "blackberry|\\bBB10\\b|rim tablet os", + "PalmOS": "PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino", + "SymbianOS": "Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b", + "WindowsMobileOS": "Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;", + "WindowsPhoneOS": "Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;", + "iOS": "\\biPhone.*Mobile|\\biPod|\\biPad", + "MeeGoOS": "MeeGo", + "MaemoOS": "Maemo", + "JavaOS": "J2ME\/|\\bMIDP\\b|\\bCLDC\\b", + "webOS": "webOS|hpwOS", + "badaOS": "\\bBada\\b", + "BREWOS": "BREW" + }, + "uas": { + "Vivaldi": "Vivaldi", + "Chrome": "\\bCrMo\\b|CriOS|Android.*Chrome\/[.0-9]* (Mobile)?", + "Dolfin": "\\bDolfin\\b", + "Opera": "Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\/[0-9.]+|Coast\/[0-9.]+", + "Skyfire": "Skyfire", + "Edge": "Mobile Safari\/[.0-9]* Edge", + "IE": "IEMobile|MSIEMobile", + "Firefox": "fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile", + "Bolt": "bolt", + "TeaShark": "teashark", + "Blazer": "Blazer", + "Safari": "Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari", + "Tizen": "Tizen", + "UCBrowser": "UC.*Browser|UCWEB", + "baiduboxapp": "baiduboxapp", + "baidubrowser": "baidubrowser", + "DiigoBrowser": "DiigoBrowser", + "Puffin": "Puffin", + "Mercury": "\\bMercury\\b", + "ObigoBrowser": "Obigo", + "NetFront": "NF-Browser", + "GenericBrowser": "NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger", + "PaleMoon": "Android.*PaleMoon|Mobile.*PaleMoon" + }, + "props": { + "Mobile": "Mobile\/[VER]", + "Build": "Build\/[VER]", + "Version": "Version\/[VER]", + "VendorID": "VendorID\/[VER]", + "iPad": "iPad.*CPU[a-z ]+[VER]", + "iPhone": "iPhone.*CPU[a-z ]+[VER]", + "iPod": "iPod.*CPU[a-z ]+[VER]", + "Kindle": "Kindle\/[VER]", + "Chrome": [ + "Chrome\/[VER]", + "CriOS\/[VER]", + "CrMo\/[VER]" + ], + "Coast": [ + "Coast\/[VER]" + ], + "Dolfin": "Dolfin\/[VER]", + "Firefox": "Firefox\/[VER]", + "Fennec": "Fennec\/[VER]", + "Edge": "Edge\/[VER]", + "IE": [ + "IEMobile\/[VER];", + "IEMobile [VER]", + "MSIE [VER];", + "Trident\/[0-9.]+;.*rv:[VER]" + ], + "NetFront": "NetFront\/[VER]", + "NokiaBrowser": "NokiaBrowser\/[VER]", + "Opera": [ + " OPR\/[VER]", + "Opera Mini\/[VER]", + "Version\/[VER]" + ], + "Opera Mini": "Opera Mini\/[VER]", + "Opera Mobi": "Version\/[VER]", + "UC Browser": "UC Browser[VER]", + "MQQBrowser": "MQQBrowser\/[VER]", + "MicroMessenger": "MicroMessenger\/[VER]", + "baiduboxapp": "baiduboxapp\/[VER]", + "baidubrowser": "baidubrowser\/[VER]", + "Iron": "Iron\/[VER]", + "Safari": [ + "Version\/[VER]", + "Safari\/[VER]" + ], + "Skyfire": "Skyfire\/[VER]", + "Tizen": "Tizen\/[VER]", + "Webkit": "webkit[ \/][VER]", + "PaleMoon": "PaleMoon\/[VER]", + "Gecko": "Gecko\/[VER]", + "Trident": "Trident\/[VER]", + "Presto": "Presto\/[VER]", + "Goanna": "Goanna\/[VER]", + "iOS": " \\bi?OS\\b [VER][ ;]{1}", + "Android": "Android [VER]", + "BlackBerry": [ + "BlackBerry[\\w]+\/[VER]", + "BlackBerry.*Version\/[VER]", + "Version\/[VER]" + ], + "BREW": "BREW [VER]", + "Java": "Java\/[VER]", + "Windows Phone OS": [ + "Windows Phone OS [VER]", + "Windows Phone [VER]" + ], + "Windows Phone": "Windows Phone [VER]", + "Windows CE": "Windows CE\/[VER]", + "Windows NT": "Windows NT [VER]", + "Symbian": [ + "SymbianOS\/[VER]", + "Symbian\/[VER]" + ], + "webOS": [ + "webOS\/[VER]", + "hpwOS\/[VER];" + ] + }, + "utils": { + "Bot": "Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom", + "MobileBot": "Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker\/M1A1-R2D2", + "DesktopMode": "WPDesktop", + "TV": "SonyDTV|HbbTV", + "WebKit": "(webkit)[ \/]([\\w.]+)", + "Console": "\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\\b", + "Watch": "SM-V700" + } +}; + + // following patterns come from http://detectmobilebrowsers.com/ + impl.detectMobileBrowsers = { + fullPattern: /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i, + shortPattern: /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i, + tabletPattern: /android|ipad|playbook|silk/i + }; + + var hasOwnProp = Object.prototype.hasOwnProperty, + isArray; + + impl.FALLBACK_PHONE = 'UnknownPhone'; + impl.FALLBACK_TABLET = 'UnknownTablet'; + impl.FALLBACK_MOBILE = 'UnknownMobile'; + + isArray = ('isArray' in Array) ? + Array.isArray : function (value) { return Object.prototype.toString.call(value) === '[object Array]'; }; + + function equalIC(a, b) { + return a != null && b != null && a.toLowerCase() === b.toLowerCase(); + } + + function containsIC(array, value) { + var valueLC, i, len = array.length; + if (!len || !value) { + return false; + } + valueLC = value.toLowerCase(); + for (i = 0; i < len; ++i) { + if (valueLC === array[i].toLowerCase()) { + return true; + } + } + return false; + } + + function convertPropsToRegExp(object) { + for (var key in object) { + if (hasOwnProp.call(object, key)) { + object[key] = new RegExp(object[key], 'i'); + } + } + } + + (function init() { + var key, values, value, i, len, verPos, mobileDetectRules = impl.mobileDetectRules; + for (key in mobileDetectRules.props) { + if (hasOwnProp.call(mobileDetectRules.props, key)) { + values = mobileDetectRules.props[key]; + if (!isArray(values)) { + values = [values]; + } + len = values.length; + for (i = 0; i < len; ++i) { + value = values[i]; + verPos = value.indexOf('[VER]'); + if (verPos >= 0) { + value = value.substring(0, verPos) + '([\\w._\\+]+)' + value.substring(verPos + 5); + } + values[i] = new RegExp(value, 'i'); + } + mobileDetectRules.props[key] = values; + } + } + convertPropsToRegExp(mobileDetectRules.oss); + convertPropsToRegExp(mobileDetectRules.phones); + convertPropsToRegExp(mobileDetectRules.tablets); + convertPropsToRegExp(mobileDetectRules.uas); + convertPropsToRegExp(mobileDetectRules.utils); + + // copy some patterns to oss0 which are tested first (see issue#15) + mobileDetectRules.oss0 = { + WindowsPhoneOS: mobileDetectRules.oss.WindowsPhoneOS, + WindowsMobileOS: mobileDetectRules.oss.WindowsMobileOS + }; + }()); + + /** + * Test userAgent string against a set of rules and find the first matched key. + * @param {Object} rules (key is String, value is RegExp) + * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent'). + * @returns {String|null} the matched key if found, otherwise null + * @private + */ + impl.findMatch = function(rules, userAgent) { + for (var key in rules) { + if (hasOwnProp.call(rules, key)) { + if (rules[key].test(userAgent)) { + return key; + } + } + } + return null; + }; + + /** + * Test userAgent string against a set of rules and return an array of matched keys. + * @param {Object} rules (key is String, value is RegExp) + * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent'). + * @returns {Array} an array of matched keys, may be empty when there is no match, but not null + * @private + */ + impl.findMatches = function(rules, userAgent) { + var result = []; + for (var key in rules) { + if (hasOwnProp.call(rules, key)) { + if (rules[key].test(userAgent)) { + result.push(key); + } + } + } + return result; + }; + + /** + * Check the version of the given property in the User-Agent. + * + * @param {String} propertyName + * @param {String} userAgent + * @return {String} version or null if version not found + * @private + */ + impl.getVersionStr = function (propertyName, userAgent) { + var props = impl.mobileDetectRules.props, patterns, i, len, match; + if (hasOwnProp.call(props, propertyName)) { + patterns = props[propertyName]; + len = patterns.length; + for (i = 0; i < len; ++i) { + match = patterns[i].exec(userAgent); + if (match !== null) { + return match[1]; + } + } + } + return null; + }; + + /** + * Check the version of the given property in the User-Agent. + * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) + * + * @param {String} propertyName + * @param {String} userAgent + * @return {Number} version or NaN if version not found + * @private + */ + impl.getVersion = function (propertyName, userAgent) { + var version = impl.getVersionStr(propertyName, userAgent); + return version ? impl.prepareVersionNo(version) : NaN; + }; + + /** + * Prepare the version number. + * + * @param {String} version + * @return {Number} the version number as a floating number + * @private + */ + impl.prepareVersionNo = function (version) { + var numbers; + + numbers = version.split(/[a-z._ \/\-]/i); + if (numbers.length === 1) { + version = numbers[0]; + } + if (numbers.length > 1) { + version = numbers[0] + '.'; + numbers.shift(); + version += numbers.join(''); + } + return Number(version); + }; + + impl.isMobileFallback = function (userAgent) { + return impl.detectMobileBrowsers.fullPattern.test(userAgent) || + impl.detectMobileBrowsers.shortPattern.test(userAgent.substr(0,4)); + }; + + impl.isTabletFallback = function (userAgent) { + return impl.detectMobileBrowsers.tabletPattern.test(userAgent); + }; + + impl.prepareDetectionCache = function (cache, userAgent, maxPhoneWidth) { + if (cache.mobile !== undefined) { + return; + } + var phone, tablet, phoneSized; + + // first check for stronger tablet rules, then phone (see issue#5) + tablet = impl.findMatch(impl.mobileDetectRules.tablets, userAgent); + if (tablet) { + cache.mobile = cache.tablet = tablet; + cache.phone = null; + return; // unambiguously identified as tablet + } + + phone = impl.findMatch(impl.mobileDetectRules.phones, userAgent); + if (phone) { + cache.mobile = cache.phone = phone; + cache.tablet = null; + return; // unambiguously identified as phone + } + + // our rules haven't found a match -> try more general fallback rules + if (impl.isMobileFallback(userAgent)) { + phoneSized = MobileDetect.isPhoneSized(maxPhoneWidth); + if (phoneSized === undefined) { + cache.mobile = impl.FALLBACK_MOBILE; + cache.tablet = cache.phone = null; + } else if (phoneSized) { + cache.mobile = cache.phone = impl.FALLBACK_PHONE; + cache.tablet = null; + } else { + cache.mobile = cache.tablet = impl.FALLBACK_TABLET; + cache.phone = null; + } + } else if (impl.isTabletFallback(userAgent)) { + cache.mobile = cache.tablet = impl.FALLBACK_TABLET; + cache.phone = null; + } else { + // not mobile at all! + cache.mobile = cache.tablet = cache.phone = null; + } + }; + + // t is a reference to a MobileDetect instance + impl.mobileGrade = function (t) { + // impl note: + // To keep in sync w/ Mobile_Detect.php easily, the following code is tightly aligned to the PHP version. + // When changes are made in Mobile_Detect.php, copy this method and replace: + // $this-> / t. + // self::MOBILE_GRADE_(.) / '$1' + // , self::VERSION_TYPE_FLOAT / (nothing) + // isIOS() / os('iOS') + // [reg] / (nothing) <-- jsdelivr complaining about unescaped unicode character U+00AE + var $isMobile = t.mobile() !== null; + + if ( + // Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1) + t.os('iOS') && t.version('iPad')>=4.3 || + t.os('iOS') && t.version('iPhone')>=3.1 || + t.os('iOS') && t.version('iPod')>=3.1 || + + // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) + // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM + // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices + // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 + ( t.version('Android')>2.1 && t.is('Webkit') ) || + + // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800 + t.version('Windows Phone OS')>=7.0 || + + // Blackberry 7 - Tested on BlackBerry Torch 9810 + // Blackberry 6.0 - Tested on the Torch 9800 and Style 9670 + t.is('BlackBerry') && t.version('BlackBerry')>=6.0 || + // Blackberry Playbook (1.0-2.0) - Tested on PlayBook + t.match('Playbook.*Tablet') || + + // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0) + ( t.version('webOS')>=1.4 && t.match('Palm|Pre|Pixi') ) || + // Palm WebOS 3.0 - Tested on HP TouchPad + t.match('hp.*TouchPad') || + + // Firefox Mobile (12 Beta) - Tested on Android 2.3 device + ( t.is('Firefox') && t.version('Firefox')>=12 ) || + + // Chrome for Android - Tested on Android 4.0, 4.1 device + ( t.is('Chrome') && t.is('AndroidOS') && t.version('Android')>=4.0 ) || + + // Skyfire 4.1 - Tested on Android 2.3 device + ( t.is('Skyfire') && t.version('Skyfire')>=4.1 && t.is('AndroidOS') && t.version('Android')>=2.3 ) || + + // Opera Mobile 11.5-12: Tested on Android 2.3 + ( t.is('Opera') && t.version('Opera Mobi')>11 && t.is('AndroidOS') ) || + + // Meego 1.2 - Tested on Nokia 950 and N9 + t.is('MeeGoOS') || + + // Tizen (pre-release) - Tested on early hardware + t.is('Tizen') || + + // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser + // @todo: more tests here! + t.is('Dolfin') && t.version('Bada')>=2.0 || + + // UC Browser - Tested on Android 2.3 device + ( (t.is('UC Browser') || t.is('Dolfin')) && t.version('Android')>=2.3 ) || + + // Kindle 3 and Fire - Tested on the built-in WebKit browser for each + ( t.match('Kindle Fire') || + t.is('Kindle') && t.version('Kindle')>=3.0 ) || + + // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet + t.is('AndroidOS') && t.is('NookTablet') || + + // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7 + t.version('Chrome')>=11 && !$isMobile || + + // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7 + t.version('Safari')>=5.0 && !$isMobile || + + // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7 + t.version('Firefox')>=4.0 && !$isMobile || + + // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 + t.version('MSIE')>=7.0 && !$isMobile || + + // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 + // @reference: http://my.opera.com/community/openweb/idopera/ + t.version('Opera')>=10 && !$isMobile + + ){ + return 'A'; + } + + if ( + t.os('iOS') && t.version('iPad')<4.3 || + t.os('iOS') && t.version('iPhone')<3.1 || + t.os('iOS') && t.version('iPod')<3.1 || + + // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 + t.is('Blackberry') && t.version('BlackBerry')>=5 && t.version('BlackBerry')<6 || + + //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 + ( t.version('Opera Mini')>=5.0 && t.version('Opera Mini')<=6.5 && + (t.version('Android')>=2.3 || t.is('iOS')) ) || + + // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) + t.match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || + + // @todo: report this (tested on Nokia N71) + t.version('Opera Mobi')>=11 && t.is('SymbianOS') + ){ + return 'B'; + } + + if ( + // Blackberry 4.x - Tested on the Curve 8330 + t.version('BlackBerry')<5.0 || + // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) + t.match('MSIEMobile|Windows CE.*Mobile') || t.version('Windows Mobile')<=5.2 + + ){ + return 'C'; + } + + //All older smartphone platforms and featurephones - Any device that doesn't support media queries + //will receive the basic, C grade experience. + return 'C'; + }; + + impl.detectOS = function (ua) { + return impl.findMatch(impl.mobileDetectRules.oss0, ua) || + impl.findMatch(impl.mobileDetectRules.oss, ua); + }; + + impl.getDeviceSmallerSide = function () { + return window.screen.width < window.screen.height ? + window.screen.width : + window.screen.height; + }; + + /** + * Constructor for MobileDetect object. + *
+ * Such an object will keep a reference to the given user-agent string and cache most of the detect queries.
+ *
+ * Find information how to download and install: + * github.com/hgoebl/mobile-detect.js/ + *
+ * + * @example
+     *     var md = new MobileDetect(window.navigator.userAgent);
+     *     if (md.mobile()) {
+     *         location.href = (md.mobileGrade() === 'A') ? '/mobile/' : '/lynx/';
+     *     }
+     * 
+ * + * @param {string} userAgent typically taken from window.navigator.userAgent or http_header['User-Agent'] + * @param {number} [maxPhoneWidth=600] only for browsers specify a value for the maximum + * width of smallest device side (in logical "CSS" pixels) until a device detected as mobile will be handled + * as phone. + * This is only used in cases where the device cannot be classified as phone or tablet.
+ * See Declaring Tablet Layouts + * for Android.
+ * If you provide a value < 0, then this "fuzzy" check is disabled. + * @constructor + * @global + */ + function MobileDetect(userAgent, maxPhoneWidth) { + this.ua = userAgent || ''; + this._cache = {}; + //600dp is typical 7" tablet minimum width + this.maxPhoneWidth = maxPhoneWidth || 600; + } + + MobileDetect.prototype = { + constructor: MobileDetect, + + /** + * Returns the detected phone or tablet type or null if it is not a mobile device. + *
+ * For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.
+ *
+ * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + * the patterns of detectmobilebrowsers.com. If this test + * is positive, a value of UnknownPhone, UnknownTablet or + * UnknownMobile is returned.
+ * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ *
+ * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + * and UnknownMobile, so you will get UnknownMobile here.
+ * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + *
+ * In most cases you will use the return value just as a boolean. + * + * @returns {String} the key for the phone family or tablet family, e.g. "Nexus". + * @function MobileDetect#mobile + */ + mobile: function () { + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + return this._cache.mobile; + }, + + /** + * Returns the detected phone type/family string or null. + *
+ * The returned tablet (family or producer) is one of following keys:
+ *
iPhone, BlackBerry, HTC, Nexus, Dell, Motorola, Samsung, LG, Sony, Asus, + * NokiaLumia, Micromax, Palm, Vertu, Pantech, Fly, Wiko, iMobile, SimValley, + * Wolfgang, Alcatel, Nintendo, Amoi, INQ, GenericPhone
+ *
+ * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + * the patterns of detectmobilebrowsers.com. If this test + * is positive, a value of UnknownPhone or UnknownMobile is returned.
+ * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ *
+ * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + * and UnknownMobile, so you will get null here, while {@link MobileDetect#mobile} + * will return UnknownMobile.
+ * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + *
+ * In most cases you will use the return value just as a boolean. + * + * @returns {String} the key of the phone family or producer, e.g. "iPhone" + * @function MobileDetect#phone + */ + phone: function () { + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + return this._cache.phone; + }, + + /** + * Returns the detected tablet type/family string or null. + *
+ * The returned tablet (family or producer) is one of following keys:
+ *
iPad, NexusTablet, SamsungTablet, Kindle, SurfaceTablet, HPTablet, AsusTablet, + * BlackBerryTablet, HTCtablet, MotorolaTablet, NookTablet, AcerTablet, + * ToshibaTablet, LGTablet, FujitsuTablet, PrestigioTablet, LenovoTablet, + * DellTablet, YarvikTablet, MedionTablet, ArnovaTablet, IntensoTablet, IRUTablet, + * MegafonTablet, EbodaTablet, AllViewTablet, ArchosTablet, AinolTablet, + * NokiaLumiaTablet, SonyTablet, PhilipsTablet, CubeTablet, CobyTablet, MIDTablet, + * MSITablet, SMiTTablet, RockChipTablet, FlyTablet, bqTablet, HuaweiTablet, + * NecTablet, PantechTablet, BronchoTablet, VersusTablet, ZyncTablet, + * PositivoTablet, NabiTablet, KoboTablet, DanewTablet, TexetTablet, + * PlaystationTablet, TrekstorTablet, PyleAudioTablet, AdvanTablet, + * DanyTechTablet, GalapadTablet, MicromaxTablet, KarbonnTablet, AllFineTablet, + * PROSCANTablet, YONESTablet, ChangJiaTablet, GUTablet, PointOfViewTablet, + * OvermaxTablet, HCLTablet, DPSTablet, VistureTablet, CrestaTablet, + * MediatekTablet, ConcordeTablet, GoCleverTablet, ModecomTablet, VoninoTablet, + * ECSTablet, StorexTablet, VodafoneTablet, EssentielBTablet, RossMoorTablet, + * iMobileTablet, TolinoTablet, AudioSonicTablet, AMPETablet, SkkTablet, + * TecnoTablet, JXDTablet, iJoyTablet, FX2Tablet, XoroTablet, ViewsonicTablet, + * OdysTablet, CaptivaTablet, IconbitTablet, TeclastTablet, OndaTablet, + * JaytechTablet, BlaupunktTablet, DigmaTablet, EvolioTablet, LavaTablet, + * AocTablet, MpmanTablet, CelkonTablet, WolderTablet, MiTablet, NibiruTablet, + * NexoTablet, LeaderTablet, UbislateTablet, PocketBookTablet, KocasoTablet, Hudl, + * TelstraTablet, GenericTablet
+ *
+ * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against + * the patterns of detectmobilebrowsers.com. If this test + * is positive, a value of UnknownTablet or UnknownMobile is returned.
+ * When used in browser, the decision whether phone or tablet is made based on screen.width/height.
+ *
+ * When used server-side (node.js), there is no way to tell the difference between UnknownTablet + * and UnknownMobile, so you will get null here, while {@link MobileDetect#mobile} + * will return UnknownMobile.
+ * Be aware that since v1.0.0 in this special case you will get UnknownMobile only for: + * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. + * In versions before v1.0.0 all 3 methods returned UnknownMobile which was tedious to use. + *
+ * In most cases you will use the return value just as a boolean. + * + * @returns {String} the key of the tablet family or producer, e.g. "SamsungTablet" + * @function MobileDetect#tablet + */ + tablet: function () { + impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth); + return this._cache.tablet; + }, + + /** + * Returns the (first) detected user-agent string or null. + *
+ * The returned user-agent is one of following keys:
+ *
Vivaldi, Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, + * Blazer, Safari, Tizen, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, + * Puffin, Mercury, ObigoBrowser, NetFront, GenericBrowser, PaleMoon
+ *
+ * In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare + * cases where a mobile device pretends to be more than one particular browser. You can get the + * list of all matches with {@link MobileDetect#userAgents} or check for a particular value by + * providing one of the defined keys as first argument to {@link MobileDetect#is}. + * + * @returns {String} the key for the detected user-agent or null + * @function MobileDetect#userAgent + */ + userAgent: function () { + if (this._cache.userAgent === undefined) { + this._cache.userAgent = impl.findMatch(impl.mobileDetectRules.uas, this.ua); + } + return this._cache.userAgent; + }, + + /** + * Returns all detected user-agent strings. + *
+ * The array is empty or contains one or more of following keys:
+ *
Vivaldi, Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, + * Blazer, Safari, Tizen, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, + * Puffin, Mercury, ObigoBrowser, NetFront, GenericBrowser, PaleMoon
+ *
+ * In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare + * cases where a mobile device pretends to be more than one particular browser. You can get the + * list of all matches with {@link MobileDetect#userAgents} or check for a particular value by + * providing one of the defined keys as first argument to {@link MobileDetect#is}. + * + * @returns {Array} the array of detected user-agent keys or [] + * @function MobileDetect#userAgents + */ + userAgents: function () { + if (this._cache.userAgents === undefined) { + this._cache.userAgents = impl.findMatches(impl.mobileDetectRules.uas, this.ua); + } + return this._cache.userAgents; + }, + + /** + * Returns the detected operating system string or null. + *
+ * The operating system is one of following keys:
+ *
AndroidOS, BlackBerryOS, PalmOS, SymbianOS, WindowsMobileOS, WindowsPhoneOS, + * iOS, MeeGoOS, MaemoOS, JavaOS, webOS, badaOS, BREWOS
+ * + * @returns {String} the key for the detected operating system. + * @function MobileDetect#os + */ + os: function () { + if (this._cache.os === undefined) { + this._cache.os = impl.detectOS(this.ua); + } + return this._cache.os; + }, + + /** + * Get the version (as Number) of the given property in the User-Agent. + *
+ * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) + * + * @param {String} key a key defining a thing which has a version.
+ * You can use one of following keys:
+ *
Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast, + * Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini, + * Opera Mobi, UC Browser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser, + * Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon, Gecko, Trident, Presto, Goanna, + * iOS, Android, BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows + * CE, Windows NT, Symbian, webOS
+ * + * @returns {Number} the version as float or NaN if User-Agent doesn't contain this version. + * Be careful when comparing this value with '==' operator! + * @function MobileDetect#version + */ + version: function (key) { + return impl.getVersion(key, this.ua); + }, + + /** + * Get the version (as String) of the given property in the User-Agent. + *
+ * + * @param {String} key a key defining a thing which has a version.
+ * You can use one of following keys:
+ *
Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast, + * Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini, + * Opera Mobi, UC Browser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser, + * Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon, Gecko, Trident, Presto, Goanna, + * iOS, Android, BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows + * CE, Windows NT, Symbian, webOS
+ * + * @returns {String} the "raw" version as String or null if User-Agent doesn't contain this version. + * + * @function MobileDetect#versionStr + */ + versionStr: function (key) { + return impl.getVersionStr(key, this.ua); + }, + + /** + * Global test key against userAgent, os, phone, tablet and some other properties of userAgent string. + * + * @param {String} key the key (case-insensitive) of a userAgent, an operating system, phone or + * tablet family.
+ * For a complete list of possible values, see {@link MobileDetect#userAgent}, + * {@link MobileDetect#os}, {@link MobileDetect#phone}, {@link MobileDetect#tablet}.
+ * Additionally you have following keys:
+ *
Bot, MobileBot, DesktopMode, TV, WebKit, Console, Watch
+ * + * @returns {boolean} true when the given key is one of the defined keys of userAgent, os, phone, + * tablet or one of the listed additional keys, otherwise false + * @function MobileDetect#is + */ + is: function (key) { + return containsIC(this.userAgents(), key) || + equalIC(key, this.os()) || + equalIC(key, this.phone()) || + equalIC(key, this.tablet()) || + containsIC(impl.findMatches(impl.mobileDetectRules.utils, this.ua), key); + }, + + /** + * Do a quick test against navigator::userAgent. + * + * @param {String|RegExp} pattern the pattern, either as String or RegExp + * (a string will be converted to a case-insensitive RegExp). + * @returns {boolean} true when the pattern matches, otherwise false + * @function MobileDetect#match + */ + match: function (pattern) { + if (!(pattern instanceof RegExp)) { + pattern = new RegExp(pattern, 'i'); + } + return pattern.test(this.ua); + }, + + /** + * Checks whether the mobile device can be considered as phone regarding screen.width. + *
+ * Obviously this method makes sense in browser environments only (not for Node.js)! + * @param {number} [maxPhoneWidth] the maximum logical pixels (aka. CSS-pixels) to be considered as phone.
+ * The argument is optional and if not present or falsy, the value of the constructor is taken. + * @returns {boolean|undefined} undefined if screen size wasn't detectable, else true + * when screen.width is less or equal to maxPhoneWidth, otherwise false.
+ * Will always return undefined server-side. + */ + isPhoneSized: function (maxPhoneWidth) { + return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth); + }, + + /** + * Returns the mobile grade ('A', 'B', 'C'). + * + * @returns {String} one of the mobile grades ('A', 'B', 'C'). + * @function MobileDetect#mobileGrade + */ + mobileGrade: function () { + if (this._cache.grade === undefined) { + this._cache.grade = impl.mobileGrade(this); + } + return this._cache.grade; + } + }; + + // environment-dependent + if (typeof window !== 'undefined' && window.screen) { + MobileDetect.isPhoneSized = function (maxPhoneWidth) { + return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth; + }; + } else { + MobileDetect.isPhoneSized = function () {}; + } + + // should not be replaced by a completely new object - just overwrite existing methods + MobileDetect._impl = impl; + + MobileDetect.version = '1.3.3 2016-07-31'; + + return MobileDetect; +}); // end of call of define() +})((function (undefined) { + if (typeof module !== 'undefined' && module.exports) { + return function (factory) { module.exports = factory(); }; + } else if (typeof define === 'function' && define.amd) { + return define; + } else if (typeof window !== 'undefined') { + return function (factory) { window.MobileDetect = factory(); }; + } else { + // please file a bug if you get this error! + throw new Error('unknown environment'); + } +})()); \ No newline at end of file From 11e9f507225d9ba7edbb95d9ccac3680062d7b0c Mon Sep 17 00:00:00 2001 From: zhengbli Date: Tue, 6 Sep 2016 13:04:29 -0700 Subject: [PATCH 04/44] Port #10728: Fix #6500 --- src/lib/es2015.collection.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/es2015.collection.d.ts b/src/lib/es2015.collection.d.ts index a3207175c48..bde1c6d5811 100644 --- a/src/lib/es2015.collection.d.ts +++ b/src/lib/es2015.collection.d.ts @@ -16,7 +16,6 @@ interface MapConstructor { declare var Map: MapConstructor; interface WeakMap { - clear(): void; delete(key: K): boolean; get(key: K): V | undefined; has(key: K): boolean; @@ -48,7 +47,6 @@ declare var Set: SetConstructor; interface WeakSet { add(value: T): this; - clear(): void; delete(value: T): boolean; has(value: T): boolean; } From 545d7e5e89bced6afdbea04fb09d14e6918d91cb Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Fri, 9 Sep 2016 08:11:47 -0700 Subject: [PATCH 05/44] A shorthand ambient module should be considered as possibly exporting a value --- src/compiler/checker.ts | 10 +++++----- src/compiler/utilities.ts | 6 +++++- tests/baselines/reference/ambientShorthand_reExport.js | 4 ++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0d3c69f6b68..c383e7c6678 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1039,7 +1039,7 @@ namespace ts { const moduleSymbol = resolveExternalModuleName(node, (node.parent).moduleSpecifier); if (moduleSymbol) { - const exportDefaultSymbol = isShorthandAmbientModule(moduleSymbol.valueDeclaration) ? + const exportDefaultSymbol = isShorthandAmbientModuleSymbol(moduleSymbol) ? moduleSymbol : moduleSymbol.exports["export="] ? getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : @@ -1115,7 +1115,7 @@ namespace ts { if (targetSymbol) { const name = specifier.propertyName || specifier.name; if (name.text) { - if (isShorthandAmbientModule(moduleSymbol.valueDeclaration)) { + if (isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } @@ -3369,7 +3369,7 @@ namespace ts { function getTypeOfFuncClassEnumModule(symbol: Symbol): Type { const links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && isShorthandAmbientModule(symbol.valueDeclaration)) { + if (symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && isShorthandAmbientModuleSymbol(symbol)) { links.type = anyType; } else { @@ -18292,8 +18292,8 @@ namespace ts { function moduleExportsSomeValue(moduleReferenceExpression: Expression): boolean { let moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); - if (!moduleSymbol) { - // module not found - be conservative + if (!moduleSymbol || isShorthandAmbientModuleSymbol(moduleSymbol)) { + // If the module is not found or is shorthand, assume that it may export a value. return true; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 0c026fc6b6d..1df6ed80ac2 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -360,7 +360,11 @@ namespace ts { ((node).name.kind === SyntaxKind.StringLiteral || isGlobalScopeAugmentation(node)); } - export function isShorthandAmbientModule(node: Node): boolean { + export function isShorthandAmbientModuleSymbol(moduleSymbol: Symbol): boolean { + return isShorthandAmbientModule(moduleSymbol.valueDeclaration); + } + + function isShorthandAmbientModule(node: Node): boolean { // The only kind of module that can be missing a body is a shorthand ambient module. return node.kind === SyntaxKind.ModuleDeclaration && (!(node).body); } diff --git a/tests/baselines/reference/ambientShorthand_reExport.js b/tests/baselines/reference/ambientShorthand_reExport.js index d0433e5d478..bdfc0ee0821 100644 --- a/tests/baselines/reference/ambientShorthand_reExport.js +++ b/tests/baselines/reference/ambientShorthand_reExport.js @@ -22,6 +22,10 @@ var jquery_1 = require("jquery"); exports.x = jquery_1.x; //// [reExportAll.js] "use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +__export(require("jquery")); //// [reExportUser.js] "use strict"; var reExportX_1 = require("./reExportX"); From 98ab0de8c047aee9a5113497a9139ea3a8170f9e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 9 Sep 2016 10:05:06 -0700 Subject: [PATCH 06/44] Assume outer variables are always initialized in control flow analysis --- src/compiler/checker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0d3c69f6b68..d63f85de71e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8881,6 +8881,7 @@ namespace ts { const isParameter = getRootDeclaration(declaration).kind === SyntaxKind.Parameter; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); + const isOuterVariable = flowContainer !== declarationContainer; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. @@ -8893,7 +8894,7 @@ namespace ts { // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). const assumeInitialized = !strictNullChecks || (type.flags & TypeFlags.Any) !== 0 || isParameter || - flowContainer !== declarationContainer || isInAmbientContext(declaration); + isOuterVariable || isInAmbientContext(declaration); const flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); // A variable is considered uninitialized when it is possible to analyze the entire control flow graph // from declaration to use, and when the variable's declared type doesn't include undefined but the From f4c621bb8e1a86aa04595e9f0159ea40902fe7a3 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 9 Sep 2016 10:05:49 -0700 Subject: [PATCH 07/44] Add regression tests --- .../reference/controlFlowOuterVariable.js | 26 ++++++++++++ .../controlFlowOuterVariable.symbols | 34 +++++++++++++++ .../reference/controlFlowOuterVariable.types | 42 +++++++++++++++++++ .../compiler/controlFlowOuterVariable.ts | 14 +++++++ 4 files changed, 116 insertions(+) create mode 100644 tests/baselines/reference/controlFlowOuterVariable.js create mode 100644 tests/baselines/reference/controlFlowOuterVariable.symbols create mode 100644 tests/baselines/reference/controlFlowOuterVariable.types create mode 100644 tests/cases/compiler/controlFlowOuterVariable.ts diff --git a/tests/baselines/reference/controlFlowOuterVariable.js b/tests/baselines/reference/controlFlowOuterVariable.js new file mode 100644 index 00000000000..1925d75eb31 --- /dev/null +++ b/tests/baselines/reference/controlFlowOuterVariable.js @@ -0,0 +1,26 @@ +//// [controlFlowOuterVariable.ts] + +// Repros from #10641 + +const CONFIG = { + foo: '', + setFoo: function(foo: string) { + CONFIG.foo = foo; + } +}; + +const helper = function(t: T[]) { + helper(t.slice(1)); +} + +//// [controlFlowOuterVariable.js] +// Repros from #10641 +var CONFIG = { + foo: '', + setFoo: function (foo) { + CONFIG.foo = foo; + } +}; +var helper = function (t) { + helper(t.slice(1)); +}; diff --git a/tests/baselines/reference/controlFlowOuterVariable.symbols b/tests/baselines/reference/controlFlowOuterVariable.symbols new file mode 100644 index 00000000000..35974f28a86 --- /dev/null +++ b/tests/baselines/reference/controlFlowOuterVariable.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/controlFlowOuterVariable.ts === + +// Repros from #10641 + +const CONFIG = { +>CONFIG : Symbol(CONFIG, Decl(controlFlowOuterVariable.ts, 3, 5)) + + foo: '', +>foo : Symbol(foo, Decl(controlFlowOuterVariable.ts, 3, 16)) + + setFoo: function(foo: string) { +>setFoo : Symbol(setFoo, Decl(controlFlowOuterVariable.ts, 4, 12)) +>foo : Symbol(foo, Decl(controlFlowOuterVariable.ts, 5, 21)) + + CONFIG.foo = foo; +>CONFIG.foo : Symbol(foo, Decl(controlFlowOuterVariable.ts, 3, 16)) +>CONFIG : Symbol(CONFIG, Decl(controlFlowOuterVariable.ts, 3, 5)) +>foo : Symbol(foo, Decl(controlFlowOuterVariable.ts, 3, 16)) +>foo : Symbol(foo, Decl(controlFlowOuterVariable.ts, 5, 21)) + } +}; + +const helper = function(t: T[]) { +>helper : Symbol(helper, Decl(controlFlowOuterVariable.ts, 10, 5)) +>T : Symbol(T, Decl(controlFlowOuterVariable.ts, 10, 24)) +>t : Symbol(t, Decl(controlFlowOuterVariable.ts, 10, 27)) +>T : Symbol(T, Decl(controlFlowOuterVariable.ts, 10, 24)) + + helper(t.slice(1)); +>helper : Symbol(helper, Decl(controlFlowOuterVariable.ts, 10, 5)) +>t.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>t : Symbol(t, Decl(controlFlowOuterVariable.ts, 10, 27)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +} diff --git a/tests/baselines/reference/controlFlowOuterVariable.types b/tests/baselines/reference/controlFlowOuterVariable.types new file mode 100644 index 00000000000..602776dd54d --- /dev/null +++ b/tests/baselines/reference/controlFlowOuterVariable.types @@ -0,0 +1,42 @@ +=== tests/cases/compiler/controlFlowOuterVariable.ts === + +// Repros from #10641 + +const CONFIG = { +>CONFIG : { foo: string; setFoo: (foo: string) => void; } +>{ foo: '', setFoo: function(foo: string) { CONFIG.foo = foo; }} : { foo: string; setFoo: (foo: string) => void; } + + foo: '', +>foo : string +>'' : string + + setFoo: function(foo: string) { +>setFoo : (foo: string) => void +>function(foo: string) { CONFIG.foo = foo; } : (foo: string) => void +>foo : string + + CONFIG.foo = foo; +>CONFIG.foo = foo : string +>CONFIG.foo : string +>CONFIG : { foo: string; setFoo: (foo: string) => void; } +>foo : string +>foo : string + } +}; + +const helper = function(t: T[]) { +>helper : (t: T[]) => void +>function(t: T[]) { helper(t.slice(1));} : (t: T[]) => void +>T : T +>t : T[] +>T : T + + helper(t.slice(1)); +>helper(t.slice(1)) : void +>helper : (t: T[]) => void +>t.slice(1) : T[] +>t.slice : (start?: number | undefined, end?: number | undefined) => T[] +>t : T[] +>slice : (start?: number | undefined, end?: number | undefined) => T[] +>1 : number +} diff --git a/tests/cases/compiler/controlFlowOuterVariable.ts b/tests/cases/compiler/controlFlowOuterVariable.ts new file mode 100644 index 00000000000..3a33f3b25e0 --- /dev/null +++ b/tests/cases/compiler/controlFlowOuterVariable.ts @@ -0,0 +1,14 @@ +// @strictNullChecks: true + +// Repros from #10641 + +const CONFIG = { + foo: '', + setFoo: function(foo: string) { + CONFIG.foo = foo; + } +}; + +const helper = function(t: T[]) { + helper(t.slice(1)); +} \ No newline at end of file From 88fd3d54b2158e9c1d62cf8441c0f090adecf385 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 27 Aug 2016 09:40:49 -0700 Subject: [PATCH 08/44] Use union type when binding element has initializer --- src/compiler/checker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d63f85de71e..7ad58f4717b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2975,7 +2975,9 @@ namespace ts { if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & TypeFlags.Undefined)) { type = getTypeWithFacts(type, TypeFacts.NEUndefined); } - return type; + return declaration.initializer ? + getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : + type; } function getTypeForVariableLikeDeclarationFromJSDocComment(declaration: VariableLikeDeclaration) { From aee1bf6429ace2c1d180316f9eca596a88cce369 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 27 Aug 2016 09:41:39 -0700 Subject: [PATCH 09/44] Accept new baselines --- ...TypedBindingInitializerNegative.errors.txt | 67 ------------ ...llyTypedBindingInitializerNegative.symbols | 88 +++++++++++++++ ...uallyTypedBindingInitializerNegative.types | 100 ++++++++++++++++++ .../declarationsAndAssignments.errors.txt | 6 +- ...rayBindingPatternAndAssignment2.errors.txt | 5 +- ...destructuringVariableDeclaration1ES5.types | 6 +- ...destructuringVariableDeclaration1ES6.types | 6 +- ...structuringVariableDeclaration2.errors.txt | 16 +-- tests/baselines/reference/for-of43.errors.txt | 11 -- tests/baselines/reference/for-of43.symbols | 19 ++++ tests/baselines/reference/for-of43.types | 25 +++++ ...licitAnyDestructuringVarDeclaration2.types | 12 +-- 12 files changed, 250 insertions(+), 111 deletions(-) delete mode 100644 tests/baselines/reference/contextuallyTypedBindingInitializerNegative.errors.txt create mode 100644 tests/baselines/reference/contextuallyTypedBindingInitializerNegative.symbols create mode 100644 tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types delete mode 100644 tests/baselines/reference/for-of43.errors.txt create mode 100644 tests/baselines/reference/for-of43.symbols create mode 100644 tests/baselines/reference/for-of43.types diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.errors.txt b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.errors.txt deleted file mode 100644 index 447ccec5ddf..00000000000 --- a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.errors.txt +++ /dev/null @@ -1,67 +0,0 @@ -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(4,20): error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(5,23): error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(6,25): error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(11,23): error TS2322: Type '{ show: (v: number) => number; }' is not assignable to type 'Show'. - Types of property 'show' are incompatible. - Type '(v: number) => number' is not assignable to type '(x: number) => string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(16,23): error TS2322: Type '(arg: string) => number' is not assignable to type '(s: string) => string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(21,14): error TS2322: Type '[number, number]' is not assignable to type '[string, number]'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(26,14): error TS2322: Type '"baz"' is not assignable to type '"foo" | "bar"'. - - -==== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts (7 errors) ==== - interface Show { - show: (x: number) => string; - } - function f({ show: showRename = v => v }: Show) {} - ~~~~~~~~~~ -!!! error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - function f2({ "show": showRename = v => v }: Show) {} - ~~~~~~~~~~ -!!! error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - function f3({ ["show"]: showRename = v => v }: Show) {} - ~~~~~~~~~~ -!!! error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - - interface Nested { - nested: Show - } - function ff({ nested: nestedRename = { show: v => v } }: Nested) {} - ~~~~~~~~~~~~ -!!! error TS2322: Type '{ show: (v: number) => number; }' is not assignable to type 'Show'. -!!! error TS2322: Types of property 'show' are incompatible. -!!! error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - - interface StringIdentity { - stringIdentity(s: string): string; - } - let { stringIdentity: id = arg => arg.length }: StringIdentity = { stringIdentity: x => x}; - ~~ -!!! error TS2322: Type '(arg: string) => number' is not assignable to type '(s: string) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - - interface Tuples { - prop: [string, number]; - } - function g({ prop = [101, 1234] }: Tuples) {} - ~~~~ -!!! error TS2322: Type '[number, number]' is not assignable to type '[string, number]'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - - interface StringUnion { - prop: "foo" | "bar"; - } - function h({ prop = "baz" }: StringUnion) {} - ~~~~ -!!! error TS2322: Type '"baz"' is not assignable to type '"foo" | "bar"'. - \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.symbols b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.symbols new file mode 100644 index 00000000000..a9013e7f98e --- /dev/null +++ b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.symbols @@ -0,0 +1,88 @@ +=== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts === +interface Show { +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) + + show: (x: number) => string; +>show : Symbol(Show.show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 16)) +>x : Symbol(x, Decl(contextuallyTypedBindingInitializerNegative.ts, 1, 11)) +} +function f({ show: showRename = v => v }: Show) {} +>f : Symbol(f, Decl(contextuallyTypedBindingInitializerNegative.ts, 2, 1)) +>show : Symbol(Show.show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 16)) +>showRename : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 12)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 31)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 31)) +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) + +function f2({ "show": showRename = v => v }: Show) {} +>f2 : Symbol(f2, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 50)) +>showRename : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 13)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 34)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 34)) +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) + +function f3({ ["show"]: showRename = v => v }: Show) {} +>f3 : Symbol(f3, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 53)) +>"show" : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 13)) +>showRename : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 13)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 36)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 36)) +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) + +interface Nested { +>Nested : Symbol(Nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 55)) + + nested: Show +>nested : Symbol(Nested.nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 7, 18)) +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) +} +function ff({ nested: nestedRename = { show: v => v } }: Nested) {} +>ff : Symbol(ff, Decl(contextuallyTypedBindingInitializerNegative.ts, 9, 1)) +>nested : Symbol(Nested.nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 7, 18)) +>nestedRename : Symbol(nestedRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 13)) +>show : Symbol(show, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 38)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 44)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 44)) +>Nested : Symbol(Nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 55)) + +interface StringIdentity { +>StringIdentity : Symbol(StringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 67)) + + stringIdentity(s: string): string; +>stringIdentity : Symbol(StringIdentity.stringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 12, 26)) +>s : Symbol(s, Decl(contextuallyTypedBindingInitializerNegative.ts, 13, 19)) +} +let { stringIdentity: id = arg => arg.length }: StringIdentity = { stringIdentity: x => x}; +>stringIdentity : Symbol(StringIdentity.stringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 12, 26)) +>id : Symbol(id, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 5)) +>arg : Symbol(arg, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 26)) +>arg.length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>arg : Symbol(arg, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 26)) +>length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>StringIdentity : Symbol(StringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 67)) +>stringIdentity : Symbol(stringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 66)) +>x : Symbol(x, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 82)) +>x : Symbol(x, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 82)) + +interface Tuples { +>Tuples : Symbol(Tuples, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 91)) + + prop: [string, number]; +>prop : Symbol(Tuples.prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 17, 18)) +} +function g({ prop = [101, 1234] }: Tuples) {} +>g : Symbol(g, Decl(contextuallyTypedBindingInitializerNegative.ts, 19, 1)) +>prop : Symbol(prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 20, 12)) +>Tuples : Symbol(Tuples, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 91)) + +interface StringUnion { +>StringUnion : Symbol(StringUnion, Decl(contextuallyTypedBindingInitializerNegative.ts, 20, 45)) + + prop: "foo" | "bar"; +>prop : Symbol(StringUnion.prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 22, 23)) +} +function h({ prop = "baz" }: StringUnion) {} +>h : Symbol(h, Decl(contextuallyTypedBindingInitializerNegative.ts, 24, 1)) +>prop : Symbol(prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 25, 12)) +>StringUnion : Symbol(StringUnion, Decl(contextuallyTypedBindingInitializerNegative.ts, 20, 45)) + diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types new file mode 100644 index 00000000000..7e922332055 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types @@ -0,0 +1,100 @@ +=== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts === +interface Show { +>Show : Show + + show: (x: number) => string; +>show : (x: number) => string +>x : number +} +function f({ show: showRename = v => v }: Show) {} +>f : ({show: showRename}: Show) => void +>show : any +>showRename : ((x: number) => string) | ((v: number) => number) +>v => v : (v: number) => number +>v : number +>v : number +>Show : Show + +function f2({ "show": showRename = v => v }: Show) {} +>f2 : ({"show": showRename}: Show) => void +>showRename : ((x: number) => string) | ((v: number) => number) +>v => v : (v: number) => number +>v : number +>v : number +>Show : Show + +function f3({ ["show"]: showRename = v => v }: Show) {} +>f3 : ({["show"]: showRename}: Show) => void +>"show" : string +>showRename : ((x: number) => string) | ((v: number) => number) +>v => v : (v: number) => number +>v : number +>v : number +>Show : Show + +interface Nested { +>Nested : Nested + + nested: Show +>nested : Show +>Show : Show +} +function ff({ nested: nestedRename = { show: v => v } }: Nested) {} +>ff : ({nested: nestedRename}: Nested) => void +>nested : any +>nestedRename : Show | { show: (v: number) => number; } +>{ show: v => v } : { show: (v: number) => number; } +>show : (v: number) => number +>v => v : (v: number) => number +>v : number +>v : number +>Nested : Nested + +interface StringIdentity { +>StringIdentity : StringIdentity + + stringIdentity(s: string): string; +>stringIdentity : (s: string) => string +>s : string +} +let { stringIdentity: id = arg => arg.length }: StringIdentity = { stringIdentity: x => x}; +>stringIdentity : any +>id : ((s: string) => string) | ((arg: string) => number) +>arg => arg.length : (arg: string) => number +>arg : string +>arg.length : number +>arg : string +>length : number +>StringIdentity : StringIdentity +>{ stringIdentity: x => x} : { stringIdentity: (x: string) => string; } +>stringIdentity : (x: string) => string +>x => x : (x: string) => string +>x : string +>x : string + +interface Tuples { +>Tuples : Tuples + + prop: [string, number]; +>prop : [string, number] +} +function g({ prop = [101, 1234] }: Tuples) {} +>g : ({prop}: Tuples) => void +>prop : [string, number] | [number, number] +>[101, 1234] : [number, number] +>101 : number +>1234 : number +>Tuples : Tuples + +interface StringUnion { +>StringUnion : StringUnion + + prop: "foo" | "bar"; +>prop : "foo" | "bar" +} +function h({ prop = "baz" }: StringUnion) {} +>h : ({prop}: StringUnion) => void +>prop : "foo" | "bar" | "baz" +>"baz" : "baz" +>StringUnion : StringUnion + diff --git a/tests/baselines/reference/declarationsAndAssignments.errors.txt b/tests/baselines/reference/declarationsAndAssignments.errors.txt index 3ed9e241c39..33c2db0a550 100644 --- a/tests/baselines/reference/declarationsAndAssignments.errors.txt +++ b/tests/baselines/reference/declarationsAndAssignments.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(23,25): tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(24,19): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(28,28): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: any; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(29,22): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(56,17): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | number', but here has type 'string'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,10): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,13): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. @@ -96,10 +96,10 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): function f7() { var [x = 0, y = 1] = [1, "hello"]; // Error, initializer for y must be string - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. var x: number; var y: string; + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | number', but here has type 'string'. } function f8() { diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt index e22b23122d3..610167a1bc0 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -3,7 +3,6 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(4,5): error TS2461: Type 'undefined' is not an array type. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,5): error TS2322: Type '[number, number, string]' is not assignable to type '[number, boolean, string]'. Type 'number' is not assignable to type 'boolean'. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(17,6): error TS2322: Type 'string' is not assignable to type 'Number'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(22,5): error TS2322: Type 'number[]' is not assignable to type '[number, number]'. Property '0' is missing in type 'number[]'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(23,5): error TS2322: Type 'number[]' is not assignable to type '[string, string]'. @@ -11,7 +10,7 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(34,5): error TS2461: Type 'F' is not an array type. -==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts (8 errors) ==== +==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts (7 errors) ==== // V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, // S is the type Any, or var [[a0], [[a1]]] = [] // Error @@ -38,8 +37,6 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss return <[number, number, number]>[1, 2, 3]; } var [b3 = "string", b4, b5] = bar(); // Error - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'Number'. // V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, // S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types index c4693fac23f..35eb23c9e6a 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types @@ -62,11 +62,11 @@ var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >"hello" : string var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : any +>b5 : number >3 : number ->b6 : any +>b6 : boolean >true : boolean ->b7 : any +>b7 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } >[undefined, undefined, undefined] : [undefined, undefined, undefined] >undefined : undefined diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types index 847831ccc84..f124e203e1f 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types @@ -62,11 +62,11 @@ var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >"hello" : string var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : any +>b5 : number >3 : number ->b6 : any +>b6 : boolean >true : boolean ->b7 : any +>b7 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } >[undefined, undefined, undefined] : [undefined, undefined, undefined] >undefined : undefined diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt index bdbda6f9a96..7658de962d9 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt @@ -5,16 +5,11 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4 Type '[[boolean]]' is not assignable to type '[[string]]'. Type '[boolean]' is not assignable to type '[string]'. Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(9,25): error TS2322: Type '{ t1: boolean; t2: string; }' is not assignable to type '{ t1: boolean; t2: number; }'. - Types of property 't2' are incompatible. - Type 'string' is not assignable to type 'number'. tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(14,16): error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c3' and no string index signature. tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(14,24): error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c5' and no string index signature. -tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(19,10): error TS2322: Type 'string[]' is not assignable to type 'number[]'. - Type 'string' is not assignable to type 'number'. -==== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts (6 errors) ==== +==== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts (4 errors) ==== // The type T associated with a destructuring variable declaration is determined as follows: // If the declaration includes a type annotation, T is that type. var {a1, a2}: { a1: number, a2: string } = { a1: true, a2: 1 } // Error @@ -33,10 +28,6 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(1 // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. var temp = { t1: true, t2: "false" }; var [b0 = 3, b1 = true, b2 = temp] = [3, false, { t1: false, t2: 5}]; // Error - ~~ -!!! error TS2322: Type '{ t1: boolean; t2: string; }' is not assignable to type '{ t1: boolean; t2: number; }'. -!!! error TS2322: Types of property 't2' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. // The type T associated with a binding element is determined as follows: // If the binding element is a rest element, T is an array type with @@ -50,7 +41,4 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(1 // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable // to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. - var {d: {d1 = ["string", null]}}: { d: { d1: number[] } } = { d: { d1: [1, 2] } }; // Error - ~~ -!!! error TS2322: Type 'string[]' is not assignable to type 'number[]'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file + var {d: {d1 = ["string", null]}}: { d: { d1: number[] } } = { d: { d1: [1, 2] } }; // Error \ No newline at end of file diff --git a/tests/baselines/reference/for-of43.errors.txt b/tests/baselines/reference/for-of43.errors.txt deleted file mode 100644 index c5790278e53..00000000000 --- a/tests/baselines/reference/for-of43.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/es6/for-ofStatements/for-of43.ts(2,25): error TS2322: Type 'boolean' is not assignable to type 'number'. - - -==== tests/cases/conformance/es6/for-ofStatements/for-of43.ts (1 errors) ==== - var array = [{ x: "", y: 0 }] - for (var {x: a = "", y: b = true} of array) { - ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. - a; - b; - } \ No newline at end of file diff --git a/tests/baselines/reference/for-of43.symbols b/tests/baselines/reference/for-of43.symbols new file mode 100644 index 00000000000..4add17ad547 --- /dev/null +++ b/tests/baselines/reference/for-of43.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of43.ts === +var array = [{ x: "", y: 0 }] +>array : Symbol(array, Decl(for-of43.ts, 0, 3)) +>x : Symbol(x, Decl(for-of43.ts, 0, 14)) +>y : Symbol(y, Decl(for-of43.ts, 0, 21)) + +for (var {x: a = "", y: b = true} of array) { +>x : Symbol(x, Decl(for-of43.ts, 0, 14)) +>a : Symbol(a, Decl(for-of43.ts, 1, 10)) +>y : Symbol(y, Decl(for-of43.ts, 0, 21)) +>b : Symbol(b, Decl(for-of43.ts, 1, 20)) +>array : Symbol(array, Decl(for-of43.ts, 0, 3)) + + a; +>a : Symbol(a, Decl(for-of43.ts, 1, 10)) + + b; +>b : Symbol(b, Decl(for-of43.ts, 1, 20)) +} diff --git a/tests/baselines/reference/for-of43.types b/tests/baselines/reference/for-of43.types new file mode 100644 index 00000000000..a11cd47182c --- /dev/null +++ b/tests/baselines/reference/for-of43.types @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of43.ts === +var array = [{ x: "", y: 0 }] +>array : { x: string; y: number; }[] +>[{ x: "", y: 0 }] : { x: string; y: number; }[] +>{ x: "", y: 0 } : { x: string; y: number; } +>x : string +>"" : string +>y : number +>0 : number + +for (var {x: a = "", y: b = true} of array) { +>x : any +>a : string +>"" : string +>y : any +>b : number | boolean +>true : boolean +>array : { x: string; y: number; }[] + + a; +>a : string + + b; +>b : number | boolean +} diff --git a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types index ef0a3f2c25b..9d07a26558d 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types +++ b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types @@ -33,13 +33,13 @@ let [a2 = undefined, b2 = undefined, c2 = undefined] = [1, 2, 3]; // no error >3 : number let [a3 = undefined, b3 = null, c3 = undefined] = [1, 2, 3]; // no error ->a3 : number +>a3 : any >undefined : any >undefined : undefined ->b3 : number +>b3 : any >null : any >null : null ->c3 : number +>c3 : any >undefined : any >undefined : undefined >[1, 2, 3] : [number, number, number] @@ -106,13 +106,13 @@ let {x2 = undefined, y2 = undefined, z2 = undefined} = { x2: 1, y2: 2, z2: 3 }; >3 : number let {x3 = undefined, y3 = null, z3 = undefined} = { x3: 1, y3: 2, z3: 3 }; // no error ->x3 : number +>x3 : any >undefined : any >undefined : undefined ->y3 : number +>y3 : any >null : any >null : null ->z3 : number +>z3 : any >undefined : any >undefined : undefined >{ x3: 1, y3: 2, z3: 3 } : { x3?: number; y3?: number; z3?: number; } From 5c11d4c3493ec67e4c99a77f4a90911e80369715 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 27 Aug 2016 09:50:23 -0700 Subject: [PATCH 10/44] Use 'true' and 'false' types when contextual type is 'boolean' --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7ad58f4717b..0cc4125bb5c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13467,7 +13467,7 @@ namespace ts { return maybeTypeOfKind(contextualType, (TypeFlags.NumberLiteral | TypeFlags.EnumLiteral)); } if (type.flags & TypeFlags.Boolean) { - return maybeTypeOfKind(contextualType, TypeFlags.BooleanLiteral) && !isTypeAssignableTo(booleanType, contextualType); + return maybeTypeOfKind(contextualType, TypeFlags.BooleanLiteral); } if (type.flags & TypeFlags.Enum) { return typeContainsLiteralFromEnum(contextualType, type); From 2cd4d20f7bbdf7a9a476ed98a2e5c9f409666419 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 27 Aug 2016 09:50:43 -0700 Subject: [PATCH 11/44] Accept new baselines --- .../amdImportNotAsPrimaryExpression.types | 2 +- .../reference/arrayBestCommonTypes.types | 28 ++++++------- .../reference/assignmentTypeNarrowing.types | 32 +++++++------- .../reference/asyncFunctionReturnType.types | 4 +- .../reference/bestCommonTypeOfTuple.types | 2 +- .../bitwiseNotOperatorWithBooleanType.types | 2 +- tests/baselines/reference/castTest.types | 2 +- .../checkSuperCallBeforeThisAccessing3.types | 4 +- ...OperatorWithSecondOperandBooleanType.types | 42 +++++++++---------- ...aOperatorWithSecondOperandNumberType.types | 8 ++-- ...commonJSImportNotAsPrimaryExpression.types | 2 +- ...onAssignmentWithInvalidOperands.errors.txt | 4 +- ...utedPropertyNamesContextualType6_ES5.types | 4 +- ...utedPropertyNamesContextualType6_ES6.types | 4 +- ...tionalOperatorConditionIsBooleanType.types | 4 +- .../reference/constEnumPropertyAccess1.types | 4 +- .../reference/contextuallyTypedIife.types | 2 +- .../controlFlowAssignmentExpression.types | 4 +- .../reference/controlFlowCommaOperator.types | 8 ++-- .../controlFlowDoWhileStatement.types | 10 ++--- .../reference/controlFlowForInStatement.types | 6 +-- .../reference/controlFlowForOfStatement.types | 6 +-- .../reference/controlFlowForStatement.types | 10 ++--- .../reference/controlFlowIfStatement.types | 10 ++--- .../reference/controlFlowWhileStatement.types | 10 ++--- .../reference/declFileFunctions.types | 8 ++-- .../declFileTypeAnnotationBuiltInType.types | 2 +- .../declarationsAndAssignments.errors.txt | 16 +++---- .../deleteOperatorWithBooleanType.types | 2 +- ...bjectBindingPatternAndAssignment1ES5.types | 8 ++-- ...bjectBindingPatternAndAssignment1ES6.types | 8 ++-- ...destructuringVariableDeclaration1ES5.types | 14 +++---- ...destructuringVariableDeclaration1ES6.types | 14 +++---- ...structuringVariableDeclaration2.errors.txt | 4 +- .../reference/emitArrowFunction.types | 8 ++-- .../reference/emitArrowFunctionES6.types | 8 ++-- .../emitArrowFunctionThisCapturing.types | 4 +- .../emitArrowFunctionThisCapturingES6.types | 4 +- .../emitClassDeclarationWithMethodInES6.types | 2 +- ...clarationWithPropertyAssignmentInES6.types | 4 +- .../reference/escapedIdentifiers.types | 10 ++--- tests/baselines/reference/for-of36.types | 4 +- tests/baselines/reference/for-of37.types | 6 +-- tests/baselines/reference/for-of38.types | 6 +-- tests/baselines/reference/for-of40.types | 6 +-- tests/baselines/reference/for-of44.types | 6 +-- tests/baselines/reference/for-of45.types | 12 +++--- tests/baselines/reference/for-of50.types | 6 +-- .../reference/functionOverloads39.types | 8 ++-- ...nericArgumentCallSigAssignmentCompat.types | 8 ++-- .../genericCallTypeArgumentInference.types | 12 +++--- .../genericClassWithStaticFactory.types | 16 +++---- .../genericTypeArgumentInference1.types | 8 ++-- ...CallSignatureReturningSpecialization.types | 2 +- .../reference/getterSetterNonAccessor.types | 8 ++-- .../reference/indexerWithTuple.types | 4 +- .../reference/interfaceContextualType.types | 20 ++++----- .../interfaceWithPropertyOfEveryType.types | 6 +-- .../reference/iterableArrayPattern30.types | 10 ++--- .../logicalNotOperatorWithBooleanType.types | 2 +- .../memberVariableDeclarations1.types | 4 +- .../moduleMemberWithoutTypeAnnotation1.types | 2 +- .../negateOperatorWithBooleanType.types | 2 +- .../reference/noImplicitReturnsInAsync1.types | 2 +- .../plusOperatorWithBooleanType.types | 2 +- ...ivacyCheckAnonymousFunctionParameter.types | 4 +- .../reference/returnStatements.types | 2 +- ...ymousTypeNotReferencingTypeParameter.types | 10 ++--- .../stringLiteralTypesOverloads01.types | 2 +- .../reference/symbolProperty18.types | 4 +- .../reference/symbolProperty21.errors.txt | 4 +- .../baselines/reference/targetTypeArgs.types | 16 +++---- ...rgedInterfacesWithDifferingOverloads.types | 2 +- ...gedInterfacesWithDifferingOverloads2.types | 6 +-- tests/baselines/reference/typeAliases.types | 4 +- .../reference/typeGuardFunction.types | 6 +-- .../typeGuardFunctionOfFormThis.types | 8 ++-- .../reference/typeGuardNesting.types | 8 ++-- .../reference/typeGuardOfFormIsType.types | 6 +-- .../typeGuardOfFormIsTypeOnInterfaces.types | 6 +-- .../reference/typeGuardsInDoStatement.types | 12 +++--- .../reference/typeGuardsOnClassProperty.types | 6 +-- ...sTypeParameterConstraintTransitively.types | 12 +++--- ...TypeParameterConstraintTransitively2.types | 12 +++--- .../typeofOperatorWithBooleanType.types | 2 +- .../baselines/reference/underscoreTest1.types | 20 ++++----- .../reference/unionTypeCallSignatures2.types | 12 +++--- .../reference/unionTypeInference.types | 4 +- .../voidOperatorWithBooleanType.types | 2 +- 89 files changed, 331 insertions(+), 331 deletions(-) diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types index 5d90a8dadc2..9d9faf05af8 100644 --- a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types @@ -28,7 +28,7 @@ var y: typeof foo.C1.s1 = false; >foo : typeof foo >C1 : typeof foo.C1 >s1 : boolean ->false : boolean +>false : false var z: foo.M1.I2; >z : f.I2 diff --git a/tests/baselines/reference/arrayBestCommonTypes.types b/tests/baselines/reference/arrayBestCommonTypes.types index 2e87dc2ca15..0b4a871cd40 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.types +++ b/tests/baselines/reference/arrayBestCommonTypes.types @@ -255,16 +255,16 @@ module EmptyTypes { >x : boolean >y : base >base : base ->[{ x: true, y: new derived() }, { x: false, y: new base() }] : { x: boolean; y: derived; }[] ->{ x: true, y: new derived() } : { x: boolean; y: derived; } ->x : boolean ->true : boolean +>[{ x: true, y: new derived() }, { x: false, y: new base() }] : ({ x: true; y: derived; } | { x: false; y: base; })[] +>{ x: true, y: new derived() } : { x: true; y: derived; } +>x : true +>true : true >y : derived >new derived() : derived >derived : typeof derived ->{ x: false, y: new base() } : { x: boolean; y: base; } ->x : boolean ->false : boolean +>{ x: false, y: new base() } : { x: false; y: base; } +>x : false +>false : false >y : base >new base() : base >base : typeof base @@ -658,16 +658,16 @@ module NonEmptyTypes { >x : boolean >y : base >base : base ->[{ x: true, y: new derived() }, { x: false, y: new base() }] : { x: boolean; y: base; }[] ->{ x: true, y: new derived() } : { x: boolean; y: derived; } ->x : boolean ->true : boolean +>[{ x: true, y: new derived() }, { x: false, y: new base() }] : ({ x: true; y: derived; } | { x: false; y: base; })[] +>{ x: true, y: new derived() } : { x: true; y: derived; } +>x : true +>true : true >y : derived >new derived() : derived >derived : typeof derived ->{ x: false, y: new base() } : { x: boolean; y: base; } ->x : boolean ->false : boolean +>{ x: false, y: new base() } : { x: false; y: base; } +>x : false +>false : false >y : base >new base() : base >base : typeof base diff --git a/tests/baselines/reference/assignmentTypeNarrowing.types b/tests/baselines/reference/assignmentTypeNarrowing.types index be99a31501d..f46b2a16c3b 100644 --- a/tests/baselines/reference/assignmentTypeNarrowing.types +++ b/tests/baselines/reference/assignmentTypeNarrowing.types @@ -12,14 +12,14 @@ x; // string >x : string [x] = [true]; ->[x] = [true] : [boolean] +>[x] = [true] : [true] >[x] : [string | number | boolean | RegExp] >x : string | number | boolean | RegExp ->[true] : [boolean] ->true : boolean +>[true] : [true] +>true : true x; // boolean ->x : boolean +>x : true [x = ""] = [1]; >[x = ""] = [1] : [number] @@ -34,16 +34,16 @@ x; // string | number >x : string | number ({x} = {x: true}); ->({x} = {x: true}) : { x: boolean; } ->{x} = {x: true} : { x: boolean; } +>({x} = {x: true}) : { x: true; } +>{x} = {x: true} : { x: true; } >{x} : { x: string | number | boolean | RegExp; } >x : string | number | boolean | RegExp ->{x: true} : { x: boolean; } ->x : boolean ->true : boolean +>{x: true} : { x: true; } +>x : true +>true : true x; // boolean ->x : boolean +>x : true ({y: x} = {y: 1}); >({y: x} = {y: 1}) : { y: number; } @@ -59,16 +59,16 @@ x; // number >x : number ({x = ""} = {x: true}); ->({x = ""} = {x: true}) : { x?: boolean; } ->{x = ""} = {x: true} : { x?: boolean; } +>({x = ""} = {x: true}) : { x?: true; } +>{x = ""} = {x: true} : { x?: true; } >{x = ""} : { x?: string | number | boolean | RegExp; } >x : string | number | boolean | RegExp ->{x: true} : { x?: boolean; } ->x : boolean ->true : boolean +>{x: true} : { x?: true; } +>x : true +>true : true x; // string | boolean ->x : string | boolean +>x : string | true ({y: x = /a/} = {y: 1}); >({y: x = /a/} = {y: 1}) : { y?: number; } diff --git a/tests/baselines/reference/asyncFunctionReturnType.types b/tests/baselines/reference/asyncFunctionReturnType.types index c6289ab012d..f848f7e1546 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.types +++ b/tests/baselines/reference/asyncFunctionReturnType.types @@ -15,8 +15,8 @@ async function fAsyncExplicit(): Promise<[number, boolean]> { // This is contextually typed as a tuple. return [1, true]; ->[1, true] : [number, boolean] +>[1, true] : [number, true] >1 : number ->true : boolean +>true : true } diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.types b/tests/baselines/reference/bestCommonTypeOfTuple.types index 6aa84f37eba..02c504b6ec3 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple.types @@ -12,7 +12,7 @@ function f2(x: number): number { return 10; } function f3(x: number): boolean { return true; } >f3 : (x: number) => boolean >x : number ->true : boolean +>true : true enum E1 { one } >E1 : E1 diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types index 234c01e2241..34e2b31a7e8 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types @@ -5,7 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A diff --git a/tests/baselines/reference/castTest.types b/tests/baselines/reference/castTest.types index 35698219fd4..03e119d17ed 100644 --- a/tests/baselines/reference/castTest.types +++ b/tests/baselines/reference/castTest.types @@ -23,7 +23,7 @@ var a = 0; var b = true; >b : boolean >true : boolean ->true : boolean +>true : true var s = ""; >s : string diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types index c4e9e15ed8e..a26ca2a6d79 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types @@ -18,11 +18,11 @@ class Derived extends Based { constructor() { this.y = true; ->this.y = true : boolean +>this.y = true : true >this.y : boolean >this : this >y : boolean ->true : boolean +>true : true } } super(); diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types index dba5285d880..b846d2cd56b 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types @@ -111,32 +111,32 @@ ANY = undefined, BOOLEAN; >BOOLEAN : boolean OBJECT = [1, 2, 3], BOOLEAN = false; ->OBJECT = [1, 2, 3], BOOLEAN = false : boolean +>OBJECT = [1, 2, 3], BOOLEAN = false : false >OBJECT = [1, 2, 3] : number[] >OBJECT : Object >[1, 2, 3] : number[] >1 : number >2 : number >3 : number ->BOOLEAN = false : boolean +>BOOLEAN = false : false >BOOLEAN : boolean ->false : boolean +>false : false var resultIsBoolean6 = (null, BOOLEAN); ->resultIsBoolean6 : boolean ->(null, BOOLEAN) : boolean ->null, BOOLEAN : boolean +>resultIsBoolean6 : false +>(null, BOOLEAN) : false +>null, BOOLEAN : false >null : null ->BOOLEAN : boolean +>BOOLEAN : false var resultIsBoolean7 = (ANY = undefined, BOOLEAN); ->resultIsBoolean7 : boolean ->(ANY = undefined, BOOLEAN) : boolean ->ANY = undefined, BOOLEAN : boolean +>resultIsBoolean7 : false +>(ANY = undefined, BOOLEAN) : false +>ANY = undefined, BOOLEAN : false >ANY = undefined : undefined >ANY : any >undefined : undefined ->BOOLEAN : boolean +>BOOLEAN : false var resultIsBoolean8 = (1, true); >resultIsBoolean8 : boolean @@ -154,27 +154,27 @@ var resultIsBoolean9 = (++NUMBER, true); >true : boolean var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); ->resultIsBoolean10 : boolean ->([1, 2, 3], !BOOLEAN) : boolean ->[1, 2, 3], !BOOLEAN : boolean +>resultIsBoolean10 : true +>([1, 2, 3], !BOOLEAN) : true +>[1, 2, 3], !BOOLEAN : true >[1, 2, 3] : number[] >1 : number >2 : number >3 : number ->!BOOLEAN : boolean ->BOOLEAN : boolean +>!BOOLEAN : true +>BOOLEAN : false var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); ->resultIsBoolean11 : boolean ->(OBJECT = [1, 2, 3], BOOLEAN = false) : boolean ->OBJECT = [1, 2, 3], BOOLEAN = false : boolean +>resultIsBoolean11 : false +>(OBJECT = [1, 2, 3], BOOLEAN = false) : false +>OBJECT = [1, 2, 3], BOOLEAN = false : false >OBJECT = [1, 2, 3] : number[] >OBJECT : Object >[1, 2, 3] : number[] >1 : number >2 : number >3 : number ->BOOLEAN = false : boolean +>BOOLEAN = false : false >BOOLEAN : boolean ->false : boolean +>false : false diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types index 13aae51e0cb..7706cc55441 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types @@ -97,9 +97,9 @@ true, 1; BOOLEAN = false, 1; >BOOLEAN = false, 1 : number ->BOOLEAN = false : boolean +>BOOLEAN = false : false >BOOLEAN : boolean ->false : boolean +>false : false >1 : number "", NUMBER = 1; @@ -146,9 +146,9 @@ var resultIsNumber9 = (BOOLEAN = false, 1); >resultIsNumber9 : number >(BOOLEAN = false, 1) : number >BOOLEAN = false, 1 : number ->BOOLEAN = false : boolean +>BOOLEAN = false : false >BOOLEAN : boolean ->false : boolean +>false : false >1 : number var resultIsNumber10 = ("", NUMBER = 1); diff --git a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types index 5d90a8dadc2..9d9faf05af8 100644 --- a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types @@ -28,7 +28,7 @@ var y: typeof foo.C1.s1 = false; >foo : typeof foo >C1 : typeof foo.C1 >s1 : boolean ->false : boolean +>false : false var z: foo.M1.I2; >z : f.I2 diff --git a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt index 45be0c3129f..2bc8a82ed3b 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(6,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'void'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(7,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(7,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'true'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(8,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'number'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(9,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(10,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and '{}'. @@ -38,7 +38,7 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'void'. x1 += true; ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'true'. x1 += 0; ~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'number'. diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types index e5b7440f49e..564689ffdeb 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types @@ -19,7 +19,7 @@ declare function foo(obj: I): T foo({ >foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] >foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } +>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | true | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } p: "", >p : string @@ -32,7 +32,7 @@ foo({ >"hi" + "bye" : string >"hi" : string >"bye" : string ->true : boolean +>true : true [0 + 1]: 0, >0 + 1 : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types index 71498d7f3d4..a771faba97e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types @@ -19,7 +19,7 @@ declare function foo(obj: I): T foo({ >foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] >foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } +>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | true | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } p: "", >p : string @@ -32,7 +32,7 @@ foo({ >"hi" + "bye" : string >"hi" : string >"bye" : string ->true : boolean +>true : true [0 + 1]: 0, >0 + 1 : number diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types index ec3bd526e9e..7733b80f69b 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types @@ -146,7 +146,7 @@ true || false ? exprIsObject1 : exprIsObject2; >true || false ? exprIsObject1 : exprIsObject2 : Object >true || false : boolean >true : boolean ->false : boolean +>false : false >exprIsObject1 : Object >exprIsObject2 : Object @@ -291,7 +291,7 @@ var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; >true || false ? exprIsObject1 : exprIsObject2 : Object >true || false : boolean >true : boolean ->false : boolean +>false : false >exprIsObject1 : Object >exprIsObject2 : Object diff --git a/tests/baselines/reference/constEnumPropertyAccess1.types b/tests/baselines/reference/constEnumPropertyAccess1.types index f0e00fe7717..e32ae5a6449 100644 --- a/tests/baselines/reference/constEnumPropertyAccess1.types +++ b/tests/baselines/reference/constEnumPropertyAccess1.types @@ -35,10 +35,10 @@ var o: { >idx : number } = { ->{ 1: true } : { 1: boolean; } +>{ 1: true } : { 1: true; } 1: true ->true : boolean +>true : true }; diff --git a/tests/baselines/reference/contextuallyTypedIife.types b/tests/baselines/reference/contextuallyTypedIife.types index 8777e3cef3f..2f12e543356 100644 --- a/tests/baselines/reference/contextuallyTypedIife.types +++ b/tests/baselines/reference/contextuallyTypedIife.types @@ -43,7 +43,7 @@ >c : boolean >"foo" : string >101 : number ->false : boolean +>false : false // default parameters ((m = 10) => m + 1)(12); diff --git a/tests/baselines/reference/controlFlowAssignmentExpression.types b/tests/baselines/reference/controlFlowAssignmentExpression.types index 107fb4cb332..94e71b1fd2a 100644 --- a/tests/baselines/reference/controlFlowAssignmentExpression.types +++ b/tests/baselines/reference/controlFlowAssignmentExpression.types @@ -21,9 +21,9 @@ x; // number >x : number x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean ->true : boolean +>true : true (x = "", obj).foo = (x = x.length); >(x = "", obj).foo = (x = x.length) : number diff --git a/tests/baselines/reference/controlFlowCommaOperator.types b/tests/baselines/reference/controlFlowCommaOperator.types index 211fae3655a..8df5b8e7889 100644 --- a/tests/baselines/reference/controlFlowCommaOperator.types +++ b/tests/baselines/reference/controlFlowCommaOperator.types @@ -5,11 +5,11 @@ function f(x: string | number | boolean) { let y: string | number | boolean = false; >y : string | number | boolean ->false : boolean +>false : false let z: string | number | boolean = false; >z : string | number | boolean ->false : boolean +>false : false if (y = "", typeof x === "string") { >y = "", typeof x === "string" : boolean @@ -28,7 +28,7 @@ function f(x: string | number | boolean) { >y : string z; // boolean ->z : boolean +>z : false } else if (z = 1, typeof x === "number") { >z = 1, typeof x === "number" : boolean @@ -66,6 +66,6 @@ function f(x: string | number | boolean) { >y : string z; // number | boolean ->z : number | boolean +>z : number | false } diff --git a/tests/baselines/reference/controlFlowDoWhileStatement.types b/tests/baselines/reference/controlFlowDoWhileStatement.types index 55329cbcea1..d7916f51dfb 100644 --- a/tests/baselines/reference/controlFlowDoWhileStatement.types +++ b/tests/baselines/reference/controlFlowDoWhileStatement.types @@ -155,9 +155,9 @@ function f() { >cond : boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | Function | RegExp ->true : boolean +>true : true continue; } @@ -170,7 +170,7 @@ function f() { >cond : boolean x; // number | boolean | RegExp ->x : number | boolean | RegExp +>x : number | true | RegExp } function g() { >g : () => void @@ -200,9 +200,9 @@ function g() { >cond : boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | Function | RegExp ->true : boolean +>true : true continue; } diff --git a/tests/baselines/reference/controlFlowForInStatement.types b/tests/baselines/reference/controlFlowForInStatement.types index cab3a701602..1930071aeb5 100644 --- a/tests/baselines/reference/controlFlowForInStatement.types +++ b/tests/baselines/reference/controlFlowForInStatement.types @@ -38,13 +38,13 @@ for (let y in obj) { >cond : boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | Function | RegExp ->true : boolean +>true : true break; } } x; // RegExp | string | number | boolean ->x : string | number | boolean | RegExp +>x : string | number | true | RegExp diff --git a/tests/baselines/reference/controlFlowForOfStatement.types b/tests/baselines/reference/controlFlowForOfStatement.types index 41e312347e7..91e0d0a5758 100644 --- a/tests/baselines/reference/controlFlowForOfStatement.types +++ b/tests/baselines/reference/controlFlowForOfStatement.types @@ -10,9 +10,9 @@ function a() { >a : () => void x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | RegExp ->true : boolean +>true : true for (x of obj) { >x : string | number | boolean | RegExp @@ -27,6 +27,6 @@ function a() { >toExponential : (fractionDigits?: number) => string } x; // string | boolean ->x : string | boolean +>x : string | true } diff --git a/tests/baselines/reference/controlFlowForStatement.types b/tests/baselines/reference/controlFlowForStatement.types index d0b0a2e6b8a..c16ee4f45ec 100644 --- a/tests/baselines/reference/controlFlowForStatement.types +++ b/tests/baselines/reference/controlFlowForStatement.types @@ -108,16 +108,16 @@ function e() { >0 : number >typeof x !== "string" : boolean >typeof x : string ->x : string | number | boolean +>x : string | number | true >"string" : "string" ->x = "" || true : string | boolean +>x = "" || true : string | true >x : string | number | boolean | RegExp ->"" || true : string | boolean +>"" || true : string | true >"" : string ->true : boolean +>true : true x; // number | boolean ->x : number | boolean +>x : number | true } } function f() { diff --git a/tests/baselines/reference/controlFlowIfStatement.types b/tests/baselines/reference/controlFlowIfStatement.types index 79985378bf5..fe609d98fb4 100644 --- a/tests/baselines/reference/controlFlowIfStatement.types +++ b/tests/baselines/reference/controlFlowIfStatement.types @@ -12,12 +12,12 @@ x = /a/; >/a/ : RegExp if (x /* RegExp */, (x = true)) { ->x /* RegExp */, (x = true) : boolean +>x /* RegExp */, (x = true) : true >x : RegExp ->(x = true) : boolean ->x = true : boolean +>(x = true) : true +>x = true : true >x : string | number | boolean | RegExp ->true : boolean +>true : true x; // boolean >x : true @@ -29,7 +29,7 @@ if (x /* RegExp */, (x = true)) { } else { x; // boolean ->x : boolean +>x : true x = 42; >x = 42 : number diff --git a/tests/baselines/reference/controlFlowWhileStatement.types b/tests/baselines/reference/controlFlowWhileStatement.types index 8caae2238d2..09a127ab51e 100644 --- a/tests/baselines/reference/controlFlowWhileStatement.types +++ b/tests/baselines/reference/controlFlowWhileStatement.types @@ -161,9 +161,9 @@ function f() { >cond : true x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | Function | RegExp ->true : boolean +>true : true continue; } @@ -173,7 +173,7 @@ function f() { >/a/ : RegExp } x; // string | number | boolean | RegExp ->x : string | number | boolean | RegExp +>x : string | number | true | RegExp } function g() { >g : () => void @@ -205,9 +205,9 @@ function g() { >cond : boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | Function | RegExp ->true : boolean +>true : true continue; } diff --git a/tests/baselines/reference/declFileFunctions.types b/tests/baselines/reference/declFileFunctions.types index 9ad974463b7..87840f39430 100644 --- a/tests/baselines/reference/declFileFunctions.types +++ b/tests/baselines/reference/declFileFunctions.types @@ -66,7 +66,7 @@ export function fooWithTypePredicate(a: any): a is number { >a : any return true; ->true : boolean +>true : true } export function fooWithTypePredicateAndMulitpleParams(a: any, b: any, c: any): a is number { >fooWithTypePredicateAndMulitpleParams : (a: any, b: any, c: any) => a is number @@ -76,7 +76,7 @@ export function fooWithTypePredicateAndMulitpleParams(a: any, b: any, c: any): a >a : any return true; ->true : boolean +>true : true } export function fooWithTypeTypePredicateAndGeneric(a: any): a is T { >fooWithTypeTypePredicateAndGeneric : (a: any) => a is T @@ -86,7 +86,7 @@ export function fooWithTypeTypePredicateAndGeneric(a: any): a is T { >T : T return true; ->true : boolean +>true : true } export function fooWithTypeTypePredicateAndRestParam(a: any, ...rest): a is number { >fooWithTypeTypePredicateAndRestParam : (a: any, ...rest: any[]) => a is number @@ -95,7 +95,7 @@ export function fooWithTypeTypePredicateAndRestParam(a: any, ...rest): a is numb >a : any return true; ->true : boolean +>true : true } /** This comment should appear for nonExportedFoo*/ diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types index a1b2d9edd43..2e187f0ec83 100644 --- a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types @@ -33,7 +33,7 @@ function foo5(): boolean { >foo5 : () => boolean return true; ->true : boolean +>true : true } function foo6() { >foo6 : () => boolean diff --git a/tests/baselines/reference/declarationsAndAssignments.errors.txt b/tests/baselines/reference/declarationsAndAssignments.errors.txt index 33c2db0a550..4aa81dce7ae 100644 --- a/tests/baselines/reference/declarationsAndAssignments.errors.txt +++ b/tests/baselines/reference/declarationsAndAssignments.errors.txt @@ -17,10 +17,10 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,11): tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,14): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(74,11): error TS2459: Type 'undefined[]' has no property 'a' and no string index signature. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(74,14): error TS2459: Type 'undefined[]' has no property 'b' and no string index signature. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(106,5): error TS2345: Argument of type '[number, [string, { y: boolean; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. - Type '[string, { y: boolean; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. - Type '{ y: boolean; }' is not assignable to type '{ x: any; y?: boolean; }'. - Property 'x' is missing in type '{ y: boolean; }'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(106,5): error TS2345: Argument of type '[number, [string, { y: false; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. + Type '[string, { y: false; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. + Type '{ y: false; }' is not assignable to type '{ x: any; y?: boolean; }'. + Property 'x' is missing in type '{ y: false; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,6): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): error TS2322: Type 'number' is not assignable to type 'string'. @@ -171,10 +171,10 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): f14([2, ["abc", { x: 0 }]]); f14([2, ["abc", { y: false }]]); // Error, no x ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, [string, { y: boolean; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. -!!! error TS2345: Type '[string, { y: boolean; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. -!!! error TS2345: Type '{ y: boolean; }' is not assignable to type '{ x: any; y?: boolean; }'. -!!! error TS2345: Property 'x' is missing in type '{ y: boolean; }'. +!!! error TS2345: Argument of type '[number, [string, { y: false; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. +!!! error TS2345: Type '[string, { y: false; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. +!!! error TS2345: Type '{ y: false; }' is not assignable to type '{ x: any; y?: boolean; }'. +!!! error TS2345: Property 'x' is missing in type '{ y: false; }'. module M { export var [a, b] = [1, 2]; diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.types b/tests/baselines/reference/deleteOperatorWithBooleanType.types index 068c67031ef..81c12ad6182 100644 --- a/tests/baselines/reference/deleteOperatorWithBooleanType.types +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.types @@ -5,7 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types index cb6052d93fd..2301902bf64 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types @@ -69,10 +69,10 @@ function foo(): F { >F : F return { ->{ 1: true } : { 1: boolean; } +>{ 1: true } : { 1: true; } 1: true ->true : boolean +>true : true }; } @@ -82,10 +82,10 @@ function bar(): F { >F : F return { ->{ 2: true } : { 2: boolean; } +>{ 2: true } : { 2: true; } 2: true ->true : boolean +>true : true }; } diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types index 2d77c20f65b..48428881290 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types @@ -69,10 +69,10 @@ function foo(): F { >F : F return { ->{ 1: true } : { 1: boolean; } +>{ 1: true } : { 1: true; } 1: true ->true : boolean +>true : true }; } @@ -82,10 +82,10 @@ function bar(): F { >F : F return { ->{ 2: true } : { 2: boolean; } +>{ 2: true } : { 2: true; } 2: true ->true : boolean +>true : true }; } diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types index 35eb23c9e6a..191cdc169b1 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types @@ -16,12 +16,12 @@ var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; >a3 : number >a4 : string >a5 : boolean ->[1, [["hello"]], true] : [number, [[string]], boolean] +>[1, [["hello"]], true] : [number, [[string]], true] >1 : number >[["hello"]] : [[string]] >["hello"] : [string] >"hello" : string ->true : boolean +>true : true // The type T associated with a destructuring variable declaration is determined as follows: // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. @@ -52,12 +52,12 @@ var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >true : boolean >b4 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } ->[3, false, { t1: false, t2: "hello" }] : [number, boolean, { t1: boolean; t2: string; }] +>[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] >3 : number ->false : boolean ->{ t1: false, t2: "hello" } : { t1: boolean; t2: string; } ->t1 : boolean ->false : boolean +>false : false +>{ t1: false, t2: "hello" } : { t1: false; t2: string; } +>t1 : false +>false : false >t2 : string >"hello" : string diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types index f124e203e1f..50f5cfc8a5a 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types @@ -16,12 +16,12 @@ var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; >a3 : number >a4 : string >a5 : boolean ->[1, [["hello"]], true] : [number, [[string]], boolean] +>[1, [["hello"]], true] : [number, [[string]], true] >1 : number >[["hello"]] : [[string]] >["hello"] : [string] >"hello" : string ->true : boolean +>true : true // The type T associated with a destructuring variable declaration is determined as follows: // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. @@ -52,12 +52,12 @@ var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >true : boolean >b4 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } ->[3, false, { t1: false, t2: "hello" }] : [number, boolean, { t1: boolean; t2: string; }] +>[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] >3 : number ->false : boolean ->{ t1: false, t2: "hello" } : { t1: boolean; t2: string; } ->t1 : boolean ->false : boolean +>false : false +>{ t1: false, t2: "hello" } : { t1: false; t2: string; } +>t1 : false +>false : false >t2 : string >"hello" : string diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt index 7658de962d9..c831b10a467 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(3,5): error TS2322: Type '{ a1: boolean; a2: number; }' is not assignable to type '{ a1: number; a2: string; }'. Types of property 'a1' are incompatible. Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4,5): error TS2322: Type '[number, [[boolean]], boolean]' is not assignable to type '[number, [[string]], boolean]'. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4,5): error TS2322: Type '[number, [[boolean]], true]' is not assignable to type '[number, [[string]], boolean]'. Type '[[boolean]]' is not assignable to type '[[string]]'. Type '[boolean]' is not assignable to type '[string]'. Type 'boolean' is not assignable to type 'string'. @@ -19,7 +19,7 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(1 !!! error TS2322: Type 'boolean' is not assignable to type 'number'. var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], true]; // Error ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '[number, [[boolean]], boolean]' is not assignable to type '[number, [[string]], boolean]'. +!!! error TS2322: Type '[number, [[boolean]], true]' is not assignable to type '[number, [[string]], boolean]'. !!! error TS2322: Type '[[boolean]]' is not assignable to type '[[string]]'. !!! error TS2322: Type '[boolean]' is not assignable to type '[string]'. !!! error TS2322: Type 'boolean' is not assignable to type 'string'. diff --git a/tests/baselines/reference/emitArrowFunction.types b/tests/baselines/reference/emitArrowFunction.types index 2ac9ef07af4..a4671ea5a31 100644 --- a/tests/baselines/reference/emitArrowFunction.types +++ b/tests/baselines/reference/emitArrowFunction.types @@ -31,12 +31,12 @@ function foo(func: () => boolean) { } foo(() => true); >foo(() => true) : void >foo : (func: () => boolean) => void ->() => true : () => boolean ->true : boolean +>() => true : () => true +>true : true foo(() => { return false; }); >foo(() => { return false; }) : void >foo : (func: () => boolean) => void ->() => { return false; } : () => boolean ->false : boolean +>() => { return false; } : () => false +>false : false diff --git a/tests/baselines/reference/emitArrowFunctionES6.types b/tests/baselines/reference/emitArrowFunctionES6.types index d37c08f855c..2cadcf2cac9 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.types +++ b/tests/baselines/reference/emitArrowFunctionES6.types @@ -31,14 +31,14 @@ function foo(func: () => boolean) { } foo(() => true); >foo(() => true) : void >foo : (func: () => boolean) => void ->() => true : () => boolean ->true : boolean +>() => true : () => true +>true : true foo(() => { return false; }); >foo(() => { return false; }) : void >foo : (func: () => boolean) => void ->() => { return false; } : () => boolean ->false : boolean +>() => { return false; } : () => false +>false : false // Binding patterns in arrow functions var p1 = ([a]) => { }; diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturing.types b/tests/baselines/reference/emitArrowFunctionThisCapturing.types index 2cfe06579af..81dc5d83f0d 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturing.types +++ b/tests/baselines/reference/emitArrowFunctionThisCapturing.types @@ -32,7 +32,7 @@ function foo(func: () => boolean) { } foo(() => { >foo(() => { this.age = 100; return true;}) : void >foo : (func: () => boolean) => void ->() => { this.age = 100; return true;} : () => boolean +>() => { this.age = 100; return true;} : () => true this.age = 100; >this.age = 100 : number @@ -42,7 +42,7 @@ foo(() => { >100 : number return true; ->true : boolean +>true : true }); diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types index cc5405cebb4..a16b6391f02 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types @@ -32,7 +32,7 @@ function foo(func: () => boolean){ } foo(() => { >foo(() => { this.age = 100; return true;}) : void >foo : (func: () => boolean) => void ->() => { this.age = 100; return true;} : () => boolean +>() => { this.age = 100; return true;} : () => true this.age = 100; >this.age = 100 : number @@ -42,7 +42,7 @@ foo(() => { >100 : number return true; ->true : boolean +>true : true }); diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types index 02a90729486..a42c019cd40 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types @@ -46,7 +46,7 @@ class D { static ["computedname6"](a: string): boolean { return true; } >"computedname6" : string >a : string ->true : boolean +>true : true static staticMethod() { >staticMethod : () => number diff --git a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types index ccf4ca3ca9d..79899e77bee 100644 --- a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types @@ -33,7 +33,7 @@ class E extends D{ z: boolean = true; >z : boolean ->true : boolean +>true : true } class F extends D{ @@ -42,7 +42,7 @@ class F extends D{ z: boolean = true; >z : boolean ->true : boolean +>true : true j: string; >j : string diff --git a/tests/baselines/reference/escapedIdentifiers.types b/tests/baselines/reference/escapedIdentifiers.types index 67713976bd6..151408de308 100644 --- a/tests/baselines/reference/escapedIdentifiers.types +++ b/tests/baselines/reference/escapedIdentifiers.types @@ -238,9 +238,9 @@ class testClass { >'string' : string arg\u0033 = true; ->arg\u0033 = true : boolean +>arg\u0033 = true : true >arg\u0033 : boolean ->true : boolean +>true : true arg4 = 2; >arg4 = 2 : number @@ -266,7 +266,7 @@ var constructorTestObject = new constructorTestClass(1, 'string', true, 2); >constructorTestClass : typeof constructorTestClass >1 : number >'string' : string ->true : boolean +>true : true >2 : number constructorTestObject.arg\u0031 = 1; @@ -284,11 +284,11 @@ constructorTestObject.arg2 = 'string'; >'string' : string constructorTestObject.arg\u0033 = true; ->constructorTestObject.arg\u0033 = true : boolean +>constructorTestObject.arg\u0033 = true : true >constructorTestObject.arg\u0033 : boolean >constructorTestObject : constructorTestClass >arg\u0033 : boolean ->true : boolean +>true : true constructorTestObject.arg4 = 2; >constructorTestObject.arg4 = 2 : number diff --git a/tests/baselines/reference/for-of36.types b/tests/baselines/reference/for-of36.types index e23ea79d0a9..f55b5377acc 100644 --- a/tests/baselines/reference/for-of36.types +++ b/tests/baselines/reference/for-of36.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/for-ofStatements/for-of36.ts === var tuple: [string, boolean] = ["", true]; >tuple : [string, boolean] ->["", true] : [string, boolean] +>["", true] : [string, true] >"" : string ->true : boolean +>true : true for (var v of tuple) { >v : string | boolean diff --git a/tests/baselines/reference/for-of37.types b/tests/baselines/reference/for-of37.types index 89272742f62..986e2678402 100644 --- a/tests/baselines/reference/for-of37.types +++ b/tests/baselines/reference/for-of37.types @@ -3,10 +3,10 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, boolean][] ->["", true] : [string, boolean] +>[["", true]] : [string, true][] +>["", true] : [string, true] >"" : string ->true : boolean +>true : true for (var v of map) { >v : [string, boolean] diff --git a/tests/baselines/reference/for-of38.types b/tests/baselines/reference/for-of38.types index f8b7555781f..78223cfc5be 100644 --- a/tests/baselines/reference/for-of38.types +++ b/tests/baselines/reference/for-of38.types @@ -3,10 +3,10 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, boolean][] ->["", true] : [string, boolean] +>[["", true]] : [string, true][] +>["", true] : [string, true] >"" : string ->true : boolean +>true : true for (var [k, v] of map) { >k : string diff --git a/tests/baselines/reference/for-of40.types b/tests/baselines/reference/for-of40.types index 6693514ec53..9d2207409f3 100644 --- a/tests/baselines/reference/for-of40.types +++ b/tests/baselines/reference/for-of40.types @@ -3,10 +3,10 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, boolean][] ->["", true] : [string, boolean] +>[["", true]] : [string, true][] +>["", true] : [string, true] >"" : string ->true : boolean +>true : true for (var [k = "", v = false] of map) { >k : string diff --git a/tests/baselines/reference/for-of44.types b/tests/baselines/reference/for-of44.types index e6f4e0450b3..152edd6f165 100644 --- a/tests/baselines/reference/for-of44.types +++ b/tests/baselines/reference/for-of44.types @@ -1,13 +1,13 @@ === tests/cases/conformance/es6/for-ofStatements/for-of44.ts === var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symbol()]] >array : [number, string | boolean | symbol][] ->[[0, ""], [0, true], [1, Symbol()]] : ([number, string] | [number, boolean] | [number, symbol])[] +>[[0, ""], [0, true], [1, Symbol()]] : ([number, string] | [number, true] | [number, symbol])[] >[0, ""] : [number, string] >0 : number >"" : string ->[0, true] : [number, boolean] +>[0, true] : [number, true] >0 : number ->true : boolean +>true : true >[1, Symbol()] : [number, symbol] >1 : number >Symbol() : symbol diff --git a/tests/baselines/reference/for-of45.types b/tests/baselines/reference/for-of45.types index 7c853993b0a..a2a70ddfed3 100644 --- a/tests/baselines/reference/for-of45.types +++ b/tests/baselines/reference/for-of45.types @@ -7,19 +7,19 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, boolean][] ->["", true] : [string, boolean] +>[["", true]] : [string, true][] +>["", true] : [string, true] >"" : string ->true : boolean +>true : true for ([k = "", v = false] of map) { ->[k = "", v = false] : [string, boolean] +>[k = "", v = false] : [string, false] >k = "" : string >k : string >"" : string ->v = false : boolean +>v = false : false >v : boolean ->false : boolean +>false : false >map : Map k; diff --git a/tests/baselines/reference/for-of50.types b/tests/baselines/reference/for-of50.types index 5d5dac7abed..87ad29793e8 100644 --- a/tests/baselines/reference/for-of50.types +++ b/tests/baselines/reference/for-of50.types @@ -3,10 +3,10 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, boolean][] ->["", true] : [string, boolean] +>[["", true]] : [string, true][] +>["", true] : [string, true] >"" : string ->true : boolean +>true : true for (const [k, v] of map) { >k : string diff --git a/tests/baselines/reference/functionOverloads39.types b/tests/baselines/reference/functionOverloads39.types index 78c0e78bca1..bf4a6ec5ae9 100644 --- a/tests/baselines/reference/functionOverloads39.types +++ b/tests/baselines/reference/functionOverloads39.types @@ -19,8 +19,8 @@ var x = foo([{a:true}]); >x : number >foo([{a:true}]) : number >foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } ->[{a:true}] : { a: boolean; }[] ->{a:true} : { a: boolean; } ->a : boolean ->true : boolean +>[{a:true}] : { a: true; }[] +>{a:true} : { a: true; } +>a : true +>true : true diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types index c5fd984d327..f7dd10b11dd 100644 --- a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types @@ -49,8 +49,8 @@ _.all([true, 1, null, 'yes'], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean ->[true, 1, null, 'yes'] : (string | number | boolean)[] ->true : boolean +>[true, 1, null, 'yes'] : (string | number | true)[] +>true : true >1 : number >null : null >'yes' : string @@ -64,8 +64,8 @@ _.all([true], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean ->[true] : boolean[] ->true : boolean +>[true] : true[] +>true : true >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.types b/tests/baselines/reference/genericCallTypeArgumentInference.types index 0208ec74f1e..09cd907a5a9 100644 --- a/tests/baselines/reference/genericCallTypeArgumentInference.types +++ b/tests/baselines/reference/genericCallTypeArgumentInference.types @@ -202,7 +202,7 @@ var r6 = c.foo3(true, 1); // boolean >c.foo3 : (t: T, u: number) => T >c : C >foo3 : (t: T, u: number) => T ->true : boolean +>true : true >1 : number var r7 = c.foo4('', true); // string @@ -212,7 +212,7 @@ var r7 = c.foo4('', true); // string >c : C >foo4 : (t: string, u: U) => string >'' : string ->true : boolean +>true : true var r8 = c.foo5(true, 1); // boolean >r8 : boolean @@ -220,7 +220,7 @@ var r8 = c.foo5(true, 1); // boolean >c.foo5 : (t: T, u: U) => T >c : C >foo5 : (t: T, u: U) => T ->true : boolean +>true : true >1 : number var r9 = c.foo6(); // {} @@ -349,7 +349,7 @@ var r6 = i.foo3(true, 1); // boolean >i.foo3 : (t: T, u: number) => T >i : I >foo3 : (t: T, u: number) => T ->true : boolean +>true : true >1 : number var r7 = i.foo4('', true); // string @@ -359,7 +359,7 @@ var r7 = i.foo4('', true); // string >i : I >foo4 : (t: string, u: U) => string >'' : string ->true : boolean +>true : true var r8 = i.foo5(true, 1); // boolean >r8 : boolean @@ -367,7 +367,7 @@ var r8 = i.foo5(true, 1); // boolean >i.foo5 : (t: T, u: U) => T >i : I >foo5 : (t: T, u: U) => T ->true : boolean +>true : true >1 : number var r9 = i.foo6(); // {} diff --git a/tests/baselines/reference/genericClassWithStaticFactory.types b/tests/baselines/reference/genericClassWithStaticFactory.types index 2daad9003eb..c1af646e7fb 100644 --- a/tests/baselines/reference/genericClassWithStaticFactory.types +++ b/tests/baselines/reference/genericClassWithStaticFactory.types @@ -175,11 +175,11 @@ module Editor { >T : T entry.isHead = false; ->entry.isHead = false : boolean +>entry.isHead = false : false >entry.isHead : boolean >entry : List >isHead : boolean ->false : boolean +>false : false entry.next = this.next; >entry.next = this.next : List @@ -237,11 +237,11 @@ module Editor { >data : T entry.isHead = false; ->entry.isHead = false : boolean +>entry.isHead = false : false >entry.isHead : boolean >entry : List >isHead : boolean ->false : boolean +>false : false entry.next = this.next; >entry.next = this.next : List @@ -317,11 +317,11 @@ module Editor { >T : T entry.isHead = false; ->entry.isHead = false : boolean +>entry.isHead = false : false >entry.isHead : boolean >entry : List >isHead : boolean ->false : boolean +>false : false this.prev.next = entry; >this.prev.next = entry : List @@ -501,7 +501,7 @@ module Editor { >new List(true, null) : List >List : typeof List >T : T ->true : boolean +>true : true >null : null entry.prev = entry; @@ -537,7 +537,7 @@ module Editor { >new List(false, data) : List >List : typeof List >T : T ->false : boolean +>false : false >data : T entry.prev = entry; diff --git a/tests/baselines/reference/genericTypeArgumentInference1.types b/tests/baselines/reference/genericTypeArgumentInference1.types index 2d64c8f5c58..e2a570de28f 100644 --- a/tests/baselines/reference/genericTypeArgumentInference1.types +++ b/tests/baselines/reference/genericTypeArgumentInference1.types @@ -47,8 +47,8 @@ var r = _.all([true, 1, null, 'yes'], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T ->[true, 1, null, 'yes'] : (string | number | boolean)[] ->true : boolean +>[true, 1, null, 'yes'] : (string | number | true)[] +>true : true >1 : number >null : null >'yes' : string @@ -62,8 +62,8 @@ var r2 = _.all([true], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T ->[true] : boolean[] ->true : boolean +>[true] : true[] +>true : true >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types index c58d56e3a75..b314839a97e 100644 --- a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types +++ b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types @@ -18,5 +18,5 @@ var x: B; x(true); // was error >x(true) : void >x : B ->true : boolean +>true : true diff --git a/tests/baselines/reference/getterSetterNonAccessor.types b/tests/baselines/reference/getterSetterNonAccessor.types index 48d9f9c85e0..0534ca623e7 100644 --- a/tests/baselines/reference/getterSetterNonAccessor.types +++ b/tests/baselines/reference/getterSetterNonAccessor.types @@ -16,8 +16,8 @@ Object.defineProperty({}, "0", ({ >"0" : string >({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor ->({ get: getFunc, set: setFunc, configurable: true }) : { get: () => any; set: (v: any) => void; configurable: boolean; } ->{ get: getFunc, set: setFunc, configurable: true } : { get: () => any; set: (v: any) => void; configurable: boolean; } +>({ get: getFunc, set: setFunc, configurable: true }) : { get: () => any; set: (v: any) => void; configurable: true; } +>{ get: getFunc, set: setFunc, configurable: true } : { get: () => any; set: (v: any) => void; configurable: true; } get: getFunc, >get : () => any @@ -28,8 +28,8 @@ Object.defineProperty({}, "0", ({ >setFunc : (v: any) => void configurable: true ->configurable : boolean ->true : boolean +>configurable : true +>true : true })); diff --git a/tests/baselines/reference/indexerWithTuple.types b/tests/baselines/reference/indexerWithTuple.types index 4faae2cda29..54ee714f5ef 100644 --- a/tests/baselines/reference/indexerWithTuple.types +++ b/tests/baselines/reference/indexerWithTuple.types @@ -21,8 +21,8 @@ var unionTuple1: [number, string| number] = [10, "foo"]; var unionTuple2: [boolean, string| number] = [true, "foo"]; >unionTuple2 : [boolean, string | number] ->[true, "foo"] : [boolean, string] ->true : boolean +>[true, "foo"] : [true, string] +>true : true >"foo" : string // no error diff --git a/tests/baselines/reference/interfaceContextualType.types b/tests/baselines/reference/interfaceContextualType.types index 0e835a2f1f9..d1ff4021c5d 100644 --- a/tests/baselines/reference/interfaceContextualType.types +++ b/tests/baselines/reference/interfaceContextualType.types @@ -34,31 +34,31 @@ class Bug { >{} : {} this.values['comments'] = { italic: true }; ->this.values['comments'] = { italic: true } : { italic: boolean; } +>this.values['comments'] = { italic: true } : { italic: true; } >this.values['comments'] : IOptions >this.values : IMap >this : this >values : IMap >'comments' : string ->{ italic: true } : { italic: boolean; } ->italic : boolean ->true : boolean +>{ italic: true } : { italic: true; } +>italic : true +>true : true } shouldBeOK() { >shouldBeOK : () => void this.values = { ->this.values = { comments: { italic: true } } : { comments: { italic: boolean; }; } +>this.values = { comments: { italic: true } } : { comments: { italic: true; }; } >this.values : IMap >this : this >values : IMap ->{ comments: { italic: true } } : { comments: { italic: boolean; }; } +>{ comments: { italic: true } } : { comments: { italic: true; }; } comments: { italic: true } ->comments : { italic: boolean; } ->{ italic: true } : { italic: boolean; } ->italic : boolean ->true : boolean +>comments : { italic: true; } +>{ italic: true } : { italic: true; } +>italic : true +>true : true }; } diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types index 7428ee73aa1..0ad754476a2 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types @@ -80,7 +80,7 @@ interface Foo { var a: Foo = { >a : Foo >Foo : Foo ->{ a: 1, b: '', c: true, d: {}, e: null , f: [1], g: {}, h: (x: number) => 1, i: (x: T) => x, j: null, k: new C(), l: f1, m: M, n: {}, o: E.A} : { a: number; b: string; c: boolean; d: {}; e: null; f: number[]; g: {}; h: (x: number) => number; i: (x: T) => T; j: Foo; k: C; l: () => void; m: typeof M; n: {}; o: E; } +>{ a: 1, b: '', c: true, d: {}, e: null , f: [1], g: {}, h: (x: number) => 1, i: (x: T) => x, j: null, k: new C(), l: f1, m: M, n: {}, o: E.A} : { a: number; b: string; c: true; d: {}; e: null; f: number[]; g: {}; h: (x: number) => number; i: (x: T) => T; j: Foo; k: C; l: () => void; m: typeof M; n: {}; o: E; } a: 1, >a : number @@ -91,8 +91,8 @@ var a: Foo = { >'' : string c: true, ->c : boolean ->true : boolean +>c : true +>true : true d: {}, >d : {} diff --git a/tests/baselines/reference/iterableArrayPattern30.types b/tests/baselines/reference/iterableArrayPattern30.types index d27db2e7544..8cfb50c3abb 100644 --- a/tests/baselines/reference/iterableArrayPattern30.types +++ b/tests/baselines/reference/iterableArrayPattern30.types @@ -6,11 +6,11 @@ const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) >v2 : boolean >new Map([["", true], ["hello", true]]) : Map >Map : MapConstructor ->[["", true], ["hello", true]] : [string, boolean][] ->["", true] : [string, boolean] +>[["", true], ["hello", true]] : [string, true][] +>["", true] : [string, true] >"" : string ->true : boolean ->["hello", true] : [string, boolean] +>true : true +>["hello", true] : [string, true] >"hello" : string ->true : boolean +>true : true diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types index b8aa6feac4c..63d5d38edda 100644 --- a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types @@ -5,7 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A diff --git a/tests/baselines/reference/memberVariableDeclarations1.types b/tests/baselines/reference/memberVariableDeclarations1.types index b7ec0fbaba0..6f3a3856e1c 100644 --- a/tests/baselines/reference/memberVariableDeclarations1.types +++ b/tests/baselines/reference/memberVariableDeclarations1.types @@ -47,11 +47,11 @@ class Employee2 { constructor() { this.retired = false; ->this.retired = false : boolean +>this.retired = false : false >this.retired : boolean >this : this >retired : boolean ->false : boolean +>false : false this.manager = null; >this.manager = null : null diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types index c308f535a7a..733eb617c66 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types @@ -64,7 +64,7 @@ module TypeScript { >findToken : (position: number, includeSkippedTokens?: boolean) => PositionedToken >position : number >includeSkippedTokens : boolean ->false : boolean +>false : false >PositionedToken : PositionedToken var positionedToken = this.findTokenInternal(null, position, 0); diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.types b/tests/baselines/reference/negateOperatorWithBooleanType.types index 89f5afc1c2b..bd61a560898 100644 --- a/tests/baselines/reference/negateOperatorWithBooleanType.types +++ b/tests/baselines/reference/negateOperatorWithBooleanType.types @@ -5,7 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A diff --git a/tests/baselines/reference/noImplicitReturnsInAsync1.types b/tests/baselines/reference/noImplicitReturnsInAsync1.types index 1dfc098675c..27746bdec5a 100644 --- a/tests/baselines/reference/noImplicitReturnsInAsync1.types +++ b/tests/baselines/reference/noImplicitReturnsInAsync1.types @@ -3,7 +3,7 @@ async function test(isError: boolean = false) { >test : (isError?: boolean) => Promise >isError : boolean ->false : boolean +>false : false if (isError === true) { >isError === true : boolean diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.types b/tests/baselines/reference/plusOperatorWithBooleanType.types index d2218d3cc95..f688706c2e5 100644 --- a/tests/baselines/reference/plusOperatorWithBooleanType.types +++ b/tests/baselines/reference/plusOperatorWithBooleanType.types @@ -5,7 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types index c8e4d237091..fd5cafc037b 100644 --- a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types @@ -31,11 +31,11 @@ module Query { return fromDoWhile(test => { >fromDoWhile(test => { return true; }) : Iterator<{}> >fromDoWhile : (doWhile: (test: Iterator) => boolean) => Iterator ->test => { return true; } : (test: Iterator<{}>) => boolean +>test => { return true; } : (test: Iterator<{}>) => true >test : Iterator<{}> return true; ->true : boolean +>true : true }); } diff --git a/tests/baselines/reference/returnStatements.types b/tests/baselines/reference/returnStatements.types index e5332b2e6ac..d64e7beb39f 100644 --- a/tests/baselines/reference/returnStatements.types +++ b/tests/baselines/reference/returnStatements.types @@ -17,7 +17,7 @@ function fn4(): void { return; } function fn5(): boolean { return true; } >fn5 : () => boolean ->true : boolean +>true : true function fn6(): Date { return new Date(12); } >fn6 : () => Date diff --git a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types index 69de032ca2e..ba720d78612 100644 --- a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types +++ b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types @@ -471,10 +471,10 @@ class ListWrapper { >1 : number return true; ->true : boolean +>true : true } return false; ->false : boolean +>false : false } static clear(dit: typeof ListWrapper, list: any[]) { list.length = 0; } >clear : (dit: typeof ListWrapper, list: any[]) => void @@ -540,7 +540,7 @@ class ListWrapper { >b.length : number >b : any[] >length : number ->false : boolean +>false : false for (var i = 0; i < a.length; ++i) { >i : number @@ -561,10 +561,10 @@ class ListWrapper { >b[i] : any >b : any[] >i : number ->false : boolean +>false : false } return true; ->true : boolean +>true : true } static slice(dit: typeof ListWrapper, l: T[], from: number = 0, to: number = null): T[] { >slice : (dit: typeof ListWrapper, l: T[], from?: number, to?: number) => T[] diff --git a/tests/baselines/reference/stringLiteralTypesOverloads01.types b/tests/baselines/reference/stringLiteralTypesOverloads01.types index 3b9df5c0066..6a46c7676f7 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads01.types +++ b/tests/baselines/reference/stringLiteralTypesOverloads01.types @@ -58,7 +58,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { >"boolean" : "boolean" return false; ->false : boolean +>false : false } // Should be unreachable. diff --git a/tests/baselines/reference/symbolProperty18.types b/tests/baselines/reference/symbolProperty18.types index 772e6aff2f7..681f86af117 100644 --- a/tests/baselines/reference/symbolProperty18.types +++ b/tests/baselines/reference/symbolProperty18.types @@ -40,11 +40,11 @@ var str = i[Symbol.toStringTag](); >toStringTag : symbol i[Symbol.toPrimitive] = false; ->i[Symbol.toPrimitive] = false : boolean +>i[Symbol.toPrimitive] = false : false >i[Symbol.toPrimitive] : boolean >i : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; } >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->false : boolean +>false : false diff --git a/tests/baselines/reference/symbolProperty21.errors.txt b/tests/baselines/reference/symbolProperty21.errors.txt index fa9cabc9b61..766af0659e8 100644 --- a/tests/baselines/reference/symbolProperty21.errors.txt +++ b/tests/baselines/reference/symbolProperty21.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/Symbols/symbolProperty21.ts(10,5): error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: boolean; }' is not assignable to parameter of type 'I'. +tests/cases/conformance/es6/Symbols/symbolProperty21.ts(10,5): error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I'. Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I'. @@ -14,7 +14,7 @@ tests/cases/conformance/es6/Symbols/symbolProperty21.ts(10,5): error TS2345: Arg [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: boolean; }' is not assignable to parameter of type 'I'. +!!! error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I'. !!! error TS2345: Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I'. [Symbol.unscopables]: true }); \ No newline at end of file diff --git a/tests/baselines/reference/targetTypeArgs.types b/tests/baselines/reference/targetTypeArgs.types index cda814d52c5..48dd35401b4 100644 --- a/tests/baselines/reference/targetTypeArgs.types +++ b/tests/baselines/reference/targetTypeArgs.types @@ -35,11 +35,11 @@ foo(function(x) { x }); >["hello"] : string[] >"hello" : string >every : (callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any) => boolean ->function(v,i,a) {return true;} : (v: string, i: number, a: string[]) => boolean +>function(v,i,a) {return true;} : (v: string, i: number, a: string[]) => true >v : string >i : number >a : string[] ->true : boolean +>true : true [1].every(function(v,i,a) {return true;}); >[1].every(function(v,i,a) {return true;}) : boolean @@ -47,11 +47,11 @@ foo(function(x) { x }); >[1] : number[] >1 : number >every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean ->function(v,i,a) {return true;} : (v: number, i: number, a: number[]) => boolean +>function(v,i,a) {return true;} : (v: number, i: number, a: number[]) => true >v : number >i : number >a : number[] ->true : boolean +>true : true [1].every(function(v,i,a) {return true;}); >[1].every(function(v,i,a) {return true;}) : boolean @@ -59,11 +59,11 @@ foo(function(x) { x }); >[1] : number[] >1 : number >every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean ->function(v,i,a) {return true;} : (v: number, i: number, a: number[]) => boolean +>function(v,i,a) {return true;} : (v: number, i: number, a: number[]) => true >v : number >i : number >a : number[] ->true : boolean +>true : true ["s"].every(function(v,i,a) {return true;}); >["s"].every(function(v,i,a) {return true;}) : boolean @@ -71,11 +71,11 @@ foo(function(x) { x }); >["s"] : string[] >"s" : string >every : (callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any) => boolean ->function(v,i,a) {return true;} : (v: string, i: number, a: string[]) => boolean +>function(v,i,a) {return true;} : (v: string, i: number, a: string[]) => true >v : string >i : number >a : string[] ->true : boolean +>true : true ["s"].forEach(function(v,i,a) { v }); >["s"].forEach(function(v,i,a) { v }) : void diff --git a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types index e9ed0031928..d9702b59954 100644 --- a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types +++ b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types @@ -63,7 +63,7 @@ var r = b.foo(true); // returns Date >b.foo : { (x: boolean): number; (x: string): string; (x: boolean): Date; (x: Date): string; } >b : B >foo : { (x: boolean): number; (x: string): string; (x: boolean): Date; (x: Date): string; } ->true : boolean +>true : true // add generic overload interface C { diff --git a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types index afbafba4920..a796d65cf61 100644 --- a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types +++ b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types @@ -83,13 +83,13 @@ module G { >r2 : boolean >a(true) : boolean >a : A ->true : boolean +>true : true var r3 = a(true, 2); >r3 : boolean >a(true, 2) : boolean >a : A ->true : boolean +>true : true >2 : number var r4 = a(1, true); @@ -97,5 +97,5 @@ module G { >a(1, true) : number >a : A >1 : number ->true : boolean +>true : true } diff --git a/tests/baselines/reference/typeAliases.types b/tests/baselines/reference/typeAliases.types index d6bce143c9b..06dfd402829 100644 --- a/tests/baselines/reference/typeAliases.types +++ b/tests/baselines/reference/typeAliases.types @@ -231,9 +231,9 @@ f16(x); var y: StringAndBoolean = ["1", false]; >y : [string, boolean] >StringAndBoolean : [string, boolean] ->["1", false] : [string, boolean] +>["1", false] : [string, false] >"1" : string ->false : boolean +>false : false y[0].toLowerCase(); >y[0].toLowerCase() : string diff --git a/tests/baselines/reference/typeGuardFunction.types b/tests/baselines/reference/typeGuardFunction.types index 1e2be413a2b..00dfc39f04a 100644 --- a/tests/baselines/reference/typeGuardFunction.types +++ b/tests/baselines/reference/typeGuardFunction.types @@ -151,7 +151,7 @@ class D { >C : C return true; ->true : boolean +>true : true } } @@ -163,7 +163,7 @@ let f1 = (p1: A): p1 is C => false; >A : A >p1 : any >C : C ->false : boolean +>false : false // Function type declare function f2(p1: (p1: A) => p1 is C); @@ -185,7 +185,7 @@ f2(function(p1: A): p1 is C { >C : C return true; ->true : boolean +>true : true }); diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThis.types b/tests/baselines/reference/typeGuardFunctionOfFormThis.types index 66d1a4b5b11..7b4b1fc76c8 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThis.types +++ b/tests/baselines/reference/typeGuardFunctionOfFormThis.types @@ -259,13 +259,13 @@ if (crate.isSundries()) { >isSundries : () => this is Crate crate.contents.broken = true; ->crate.contents.broken = true : boolean +>crate.contents.broken = true : true >crate.contents.broken : boolean >crate.contents : Sundries >crate : Crate >contents : Sundries >broken : boolean ->true : boolean +>true : true } else if (crate.isSupplies()) { >crate.isSupplies() : boolean @@ -274,13 +274,13 @@ else if (crate.isSupplies()) { >isSupplies : () => this is Crate crate.contents.spoiled = true; ->crate.contents.spoiled = true : boolean +>crate.contents.spoiled = true : true >crate.contents.spoiled : boolean >crate.contents : Supplies >crate : Crate >contents : Supplies >spoiled : boolean ->true : boolean +>true : true } // Matching guards should be assignable diff --git a/tests/baselines/reference/typeGuardNesting.types b/tests/baselines/reference/typeGuardNesting.types index 6c2df126df1..2417dbe797c 100644 --- a/tests/baselines/reference/typeGuardNesting.types +++ b/tests/baselines/reference/typeGuardNesting.types @@ -37,7 +37,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >strOrBool : string | boolean >'boolean' : "boolean" >strOrBool : boolean ->false : boolean +>false : false let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; >label2 : string @@ -59,7 +59,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >strOrBool : string | boolean >'string' : "string" >strOrBool : boolean ->false : boolean +>false : false } if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boolean') { @@ -97,7 +97,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >strOrBool : string | boolean >'boolean' : "boolean" >strOrBool : boolean ->false : boolean +>false : false let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; >label2 : string @@ -119,6 +119,6 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >strOrBool : string | boolean >'string' : "string" >strOrBool : boolean ->false : boolean +>false : false } diff --git a/tests/baselines/reference/typeGuardOfFormIsType.types b/tests/baselines/reference/typeGuardOfFormIsType.types index e2059be7b63..53b2fab53f4 100644 --- a/tests/baselines/reference/typeGuardOfFormIsType.types +++ b/tests/baselines/reference/typeGuardOfFormIsType.types @@ -35,7 +35,7 @@ function isC1(x: any): x is C1 { >C1 : C1 return true; ->true : boolean +>true : true } function isC2(x: any): x is C2 { @@ -45,7 +45,7 @@ function isC2(x: any): x is C2 { >C2 : C2 return true; ->true : boolean +>true : true } function isD1(x: any): x is D1 { @@ -55,7 +55,7 @@ function isD1(x: any): x is D1 { >D1 : D1 return true; ->true : boolean +>true : true } var c1Orc2: C1 | C2; diff --git a/tests/baselines/reference/typeGuardOfFormIsTypeOnInterfaces.types b/tests/baselines/reference/typeGuardOfFormIsTypeOnInterfaces.types index ea169e95413..1295d0f6123 100644 --- a/tests/baselines/reference/typeGuardOfFormIsTypeOnInterfaces.types +++ b/tests/baselines/reference/typeGuardOfFormIsTypeOnInterfaces.types @@ -54,7 +54,7 @@ function isC1(x: any): x is C1 { >C1 : C1 return true; ->true : boolean +>true : true } function isC2(x: any): x is C2 { @@ -64,7 +64,7 @@ function isC2(x: any): x is C2 { >C2 : C2 return true; ->true : boolean +>true : true } function isD1(x: any): x is D1 { @@ -74,7 +74,7 @@ function isD1(x: any): x is D1 { >D1 : D1 return true; ->true : boolean +>true : true } var c1: C1; diff --git a/tests/baselines/reference/typeGuardsInDoStatement.types b/tests/baselines/reference/typeGuardsInDoStatement.types index 58b6343a2f5..bc1e56bb1e4 100644 --- a/tests/baselines/reference/typeGuardsInDoStatement.types +++ b/tests/baselines/reference/typeGuardsInDoStatement.types @@ -7,13 +7,13 @@ function a(x: string | number | boolean) { >x : string | number | boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean ->true : boolean +>true : true do { x; // boolean | string ->x : string | boolean +>x : string | true x = undefined; >x = undefined : undefined @@ -34,13 +34,13 @@ function b(x: string | number | boolean) { >x : string | number | boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean ->true : boolean +>true : true do { x; // boolean | string ->x : string | boolean +>x : string | true if (cond) continue; >cond : boolean diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.types b/tests/baselines/reference/typeGuardsOnClassProperty.types index 85af4540fb9..afff0afb03f 100644 --- a/tests/baselines/reference/typeGuardsOnClassProperty.types +++ b/tests/baselines/reference/typeGuardsOnClassProperty.types @@ -67,15 +67,15 @@ var o: { >prop2 : string | boolean } = { ->{ prop1: "string" , prop2: true } : { prop1: string; prop2: boolean; } +>{ prop1: "string" , prop2: true } : { prop1: string; prop2: true; } prop1: "string" , >prop1 : string >"string" : string prop2: true ->prop2 : boolean ->true : boolean +>prop2 : true +>true : true } if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) {} diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types index e2d41c5c136..680e86f5c85 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types @@ -62,13 +62,13 @@ foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: '', z: true }); >1 : number >y : string >'' : string ->{ x: 2, y: '', z: true } : { x: number; y: string; z: boolean; } +>{ x: 2, y: '', z: true } : { x: number; y: string; z: true; } >x : number >2 : number >y : string >'' : string ->z : boolean ->true : boolean +>z : true +>true : true foo(a, b, c); >foo(a, b, c) : C @@ -82,13 +82,13 @@ foo(a, b, { foo: 1, bar: '', hm: true }); >foo : (x: T, y: U, z: V) => V >a : A >b : B ->{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: boolean; } +>{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: true; } >foo : number >1 : number >bar : string >'' : string ->hm : boolean ->true : boolean +>hm : true +>true : true foo((x: number, y) => { }, (x) => { }, () => { }); >foo((x: number, y) => { }, (x) => { }, () => { }) : () => void diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types index 3d51ad80832..145bf081b18 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types @@ -62,13 +62,13 @@ foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: 2, z: true }); >1 : number >y : string >'' : string ->{ x: 2, y: 2, z: true } : { x: number; y: number; z: boolean; } +>{ x: 2, y: 2, z: true } : { x: number; y: number; z: true; } >x : number >2 : number >y : number >2 : number ->z : boolean ->true : boolean +>z : true +>true : true foo(a, b, a); >foo(a, b, a) : A @@ -81,13 +81,13 @@ foo(a, { foo: 1, bar: '', hm: true }, b); >foo(a, { foo: 1, bar: '', hm: true }, b) : B >foo : (x: T, y: U, z: V) => V >a : A ->{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: boolean; } +>{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: true; } >foo : number >1 : number >bar : string >'' : string ->hm : boolean ->true : boolean +>hm : true +>true : true >b : B foo((x: number, y: string) => { }, (x, y: boolean) => { }, () => { }); diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.types b/tests/baselines/reference/typeofOperatorWithBooleanType.types index 043307cfb00..edf3c4e0871 100644 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.types +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.types @@ -6,7 +6,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A diff --git a/tests/baselines/reference/underscoreTest1.types b/tests/baselines/reference/underscoreTest1.types index 5950e50efa1..ac794e1f2f9 100644 --- a/tests/baselines/reference/underscoreTest1.types +++ b/tests/baselines/reference/underscoreTest1.types @@ -235,8 +235,8 @@ _.all([true, 1, null, 'yes'], _.identity); >_.all : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } >_ : Underscore.Static >all : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } ->[true, 1, null, 'yes'] : (string | number | boolean)[] ->true : boolean +>[true, 1, null, 'yes'] : (string | number | true)[] +>true : true >1 : number >null : null >'yes' : string @@ -249,11 +249,11 @@ _.any([null, 0, 'yes', false]); >_.any : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } >_ : Underscore.Static >any : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } ->[null, 0, 'yes', false] : (string | number | boolean)[] +>[null, 0, 'yes', false] : (string | number | false)[] >null : null >0 : number >'yes' : string ->false : boolean +>false : false _.contains([1, 2, 3], 3); >_.contains([1, 2, 3], 3) : boolean @@ -512,10 +512,10 @@ _.compact([0, 1, false, 2, '', 3]); >_.compact : (list: T[]) => T[] >_ : Underscore.Static >compact : (list: T[]) => T[] ->[0, 1, false, 2, '', 3] : (string | number | boolean)[] +>[0, 1, false, 2, '', 3] : (string | number | false)[] >0 : number >1 : number ->false : boolean +>false : false >2 : number >'' : string >3 : number @@ -571,7 +571,7 @@ _.flatten([1, [2], [3, [[4]]]], true); >[[4]] : number[][] >[4] : number[] >4 : number ->true : boolean +>true : true _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); >_.without([1, 2, 1, 0, 3, 1, 4], 0, 1) : number[] @@ -668,9 +668,9 @@ _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); >40 : number >50 : number >[true, false, false] : boolean[] ->true : boolean ->false : boolean ->false : boolean +>true : true +>false : false +>false : false _.object(['moe', 'larry', 'curly'], [30, 40, 50]); >_.object(['moe', 'larry', 'curly'], [30, 40, 50]) : any diff --git a/tests/baselines/reference/unionTypeCallSignatures2.types b/tests/baselines/reference/unionTypeCallSignatures2.types index ce49e9ba1c7..f55875eac44 100644 --- a/tests/baselines/reference/unionTypeCallSignatures2.types +++ b/tests/baselines/reference/unionTypeCallSignatures2.types @@ -81,8 +81,8 @@ var a1 = f1([true, false]); // boolean[] >f1([true, false]) : boolean[] >f1 : A | B | C >[true, false] : boolean[] ->true : boolean ->false : boolean +>true : true +>false : false var f2: C | B | A; >f2 : A | B | C @@ -107,8 +107,8 @@ var a2 = f2([true, false]); // boolean[] >f2([true, false]) : boolean[] >f2 : A | B | C >[true, false] : boolean[] ->true : boolean ->false : boolean +>true : true +>false : false var f3: B | A | C; >f3 : A | B | C @@ -133,7 +133,7 @@ var a3 = f3([true, false]); // boolean[] >f3([true, false]) : boolean[] >f3 : A | B | C >[true, false] : boolean[] ->true : boolean ->false : boolean +>true : true +>false : false diff --git a/tests/baselines/reference/unionTypeInference.types b/tests/baselines/reference/unionTypeInference.types index efc150da918..c1980206cc1 100644 --- a/tests/baselines/reference/unionTypeInference.types +++ b/tests/baselines/reference/unionTypeInference.types @@ -77,9 +77,9 @@ var b1 = g(["string", true]); >b1 : boolean >g(["string", true]) : boolean >g : (value: [string, T]) => T ->["string", true] : [string, boolean] +>["string", true] : [string, true] >"string" : string ->true : boolean +>true : true function h(x: string|boolean|T): T { >h : (x: string | boolean | T) => T diff --git a/tests/baselines/reference/voidOperatorWithBooleanType.types b/tests/baselines/reference/voidOperatorWithBooleanType.types index 060d2d545c6..7a35ad3367f 100644 --- a/tests/baselines/reference/voidOperatorWithBooleanType.types +++ b/tests/baselines/reference/voidOperatorWithBooleanType.types @@ -5,7 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A From 6d6f3b1ae647cf1dbbcf73a305f618727b1f38d3 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 9 Sep 2016 11:23:00 -0700 Subject: [PATCH 12/44] Fix typescript and tslint versions --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b0669aadad6..cb535b17c72 100644 --- a/package.json +++ b/package.json @@ -75,8 +75,8 @@ "through2": "latest", "travis-fold": "latest", "ts-node": "latest", - "tslint": "next", - "typescript": "next" + "tslint": "3.15.1", + "typescript": "2.0.*" }, "scripts": { "pretest": "jake tests", From 8ae5b5fe20dd469df09a75762e16c7b3be030145 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 9 Sep 2016 11:28:48 -0700 Subject: [PATCH 13/44] Update LKG --- lib/lib.es2015.collection.d.ts | 2 - lib/lib.es6.d.ts | 2 - lib/tsc.js | 41 ++++++++--- lib/tsserver.js | 123 +++++++++++++++++-------------- lib/tsserverlibrary.js | 123 +++++++++++++++++-------------- lib/typescript.js | 127 +++++++++++++++++++-------------- lib/typescriptServices.js | 127 +++++++++++++++++++-------------- 7 files changed, 322 insertions(+), 223 deletions(-) diff --git a/lib/lib.es2015.collection.d.ts b/lib/lib.es2015.collection.d.ts index f014185d9e1..0b23972def0 100644 --- a/lib/lib.es2015.collection.d.ts +++ b/lib/lib.es2015.collection.d.ts @@ -32,7 +32,6 @@ interface MapConstructor { declare var Map: MapConstructor; interface WeakMap { - clear(): void; delete(key: K): boolean; get(key: K): V | undefined; has(key: K): boolean; @@ -64,7 +63,6 @@ declare var Set: SetConstructor; interface WeakSet { add(value: T): this; - clear(): void; delete(value: T): boolean; has(value: T): boolean; } diff --git a/lib/lib.es6.d.ts b/lib/lib.es6.d.ts index 084ed4e8a1a..ad2b2443a03 100644 --- a/lib/lib.es6.d.ts +++ b/lib/lib.es6.d.ts @@ -4672,7 +4672,6 @@ interface MapConstructor { declare var Map: MapConstructor; interface WeakMap { - clear(): void; delete(key: K): boolean; get(key: K): V | undefined; has(key: K): boolean; @@ -4704,7 +4703,6 @@ declare var Set: SetConstructor; interface WeakSet { add(value: T): this; - clear(): void; delete(value: T): boolean; has(value: T): boolean; } diff --git a/lib/tsc.js b/lib/tsc.js index 0c05ab54ed7..2be63c051ad 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -13316,6 +13316,7 @@ var ts; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); + var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var enumNumberIndexInfo = createIndexInfo(stringType, true); var globals = ts.createMap(); var patternAmbientModules; @@ -15483,7 +15484,9 @@ var ts; if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 2048)) { type = getTypeWithFacts(type, 131072); } - return type; + return declaration.initializer ? + getUnionType([type, checkExpressionCached(declaration.initializer)], true) : + type; } function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { var jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration); @@ -20336,13 +20339,14 @@ var ts; var isParameter = ts.getRootDeclaration(declaration).kind === 142; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); + var isOuterVariable = flowContainer !== declarationContainer; while (flowContainer !== declarationContainer && (flowContainer.kind === 179 || flowContainer.kind === 180) && (isReadonlySymbol(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } var assumeInitialized = !strictNullChecks || (type.flags & 1) !== 0 || isParameter || - flowContainer !== declarationContainer || ts.isInAmbientContext(declaration); + isOuterVariable || ts.isInAmbientContext(declaration); var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); if (!assumeInitialized && !(getFalsyFlags(type) & 2048) && getFalsyFlags(flowType) & 2048) { error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol)); @@ -22572,16 +22576,16 @@ var ts; function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); var cached = links.resolvedSignature; - if (cached && cached !== anySignature && !candidatesOutArray) { + if (cached && cached !== resolvingSignature && !candidatesOutArray) { return cached; } - links.resolvedSignature = anySignature; + links.resolvedSignature = resolvingSignature; var result = resolveSignature(node, candidatesOutArray); links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached; return result; } function getResolvedOrAnySignature(node) { - return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node); + return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node); } function getInferredClassType(symbol) { var links = getSymbolLinks(symbol); @@ -23533,7 +23537,7 @@ var ts; return maybeTypeOfKind(contextualType, (64 | 256)); } if (type.flags & 8) { - return maybeTypeOfKind(contextualType, 128) && !isTypeAssignableTo(booleanType, contextualType); + return maybeTypeOfKind(contextualType, 128); } if (type.flags & 16) { return typeContainsLiteralFromEnum(contextualType, type); @@ -36535,7 +36539,6 @@ var ts; (function (ts) { ts.version = "2.0.2"; var emptyArray = []; - var defaultTypeRoots = ["node_modules/@types"]; function findConfigFile(searchPath, fileExists) { while (true) { var fileName = ts.combinePaths(searchPath, "tsconfig.json"); @@ -36668,11 +36671,27 @@ var ts; else if (host.getCurrentDirectory) { currentDirectory = host.getCurrentDirectory(); } - if (!currentDirectory) { - return undefined; - } - return ts.map(defaultTypeRoots, function (d) { return ts.combinePaths(currentDirectory, d); }); + return currentDirectory && getDefaultTypeRoots(currentDirectory, host); } + function getDefaultTypeRoots(currentDirectory, host) { + if (!host.directoryExists) { + return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; + } + var typeRoots; + while (true) { + var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes); + if (host.directoryExists(atTypes)) { + (typeRoots || (typeRoots = [])).push(atTypes); + } + var parent_15 = ts.getDirectoryPath(currentDirectory); + if (parent_15 === currentDirectory) { + break; + } + currentDirectory = parent_15; + } + return typeRoots; + } + var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types"); function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host) { var traceEnabled = isTraceEnabled(options, host); var moduleResolutionState = { diff --git a/lib/tsserver.js b/lib/tsserver.js index ac670e4dc26..94b94d71415 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -14312,6 +14312,7 @@ var ts; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); + var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var enumNumberIndexInfo = createIndexInfo(stringType, true); var globals = ts.createMap(); var patternAmbientModules; @@ -16479,7 +16480,9 @@ var ts; if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 2048)) { type = getTypeWithFacts(type, 131072); } - return type; + return declaration.initializer ? + getUnionType([type, checkExpressionCached(declaration.initializer)], true) : + type; } function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { var jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration); @@ -21332,13 +21335,14 @@ var ts; var isParameter = ts.getRootDeclaration(declaration).kind === 142; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); + var isOuterVariable = flowContainer !== declarationContainer; while (flowContainer !== declarationContainer && (flowContainer.kind === 179 || flowContainer.kind === 180) && (isReadonlySymbol(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } var assumeInitialized = !strictNullChecks || (type.flags & 1) !== 0 || isParameter || - flowContainer !== declarationContainer || ts.isInAmbientContext(declaration); + isOuterVariable || ts.isInAmbientContext(declaration); var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); if (!assumeInitialized && !(getFalsyFlags(type) & 2048) && getFalsyFlags(flowType) & 2048) { error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol)); @@ -23568,16 +23572,16 @@ var ts; function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); var cached = links.resolvedSignature; - if (cached && cached !== anySignature && !candidatesOutArray) { + if (cached && cached !== resolvingSignature && !candidatesOutArray) { return cached; } - links.resolvedSignature = anySignature; + links.resolvedSignature = resolvingSignature; var result = resolveSignature(node, candidatesOutArray); links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached; return result; } function getResolvedOrAnySignature(node) { - return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node); + return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node); } function getInferredClassType(symbol) { var links = getSymbolLinks(symbol); @@ -24529,7 +24533,7 @@ var ts; return maybeTypeOfKind(contextualType, (64 | 256)); } if (type.flags & 8) { - return maybeTypeOfKind(contextualType, 128) && !isTypeAssignableTo(booleanType, contextualType); + return maybeTypeOfKind(contextualType, 128); } if (type.flags & 16) { return typeContainsLiteralFromEnum(contextualType, type); @@ -37531,7 +37535,6 @@ var ts; (function (ts) { ts.version = "2.0.2"; var emptyArray = []; - var defaultTypeRoots = ["node_modules/@types"]; function findConfigFile(searchPath, fileExists) { while (true) { var fileName = ts.combinePaths(searchPath, "tsconfig.json"); @@ -37664,11 +37667,27 @@ var ts; else if (host.getCurrentDirectory) { currentDirectory = host.getCurrentDirectory(); } - if (!currentDirectory) { - return undefined; - } - return ts.map(defaultTypeRoots, function (d) { return ts.combinePaths(currentDirectory, d); }); + return currentDirectory && getDefaultTypeRoots(currentDirectory, host); } + function getDefaultTypeRoots(currentDirectory, host) { + if (!host.directoryExists) { + return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; + } + var typeRoots; + while (true) { + var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes); + if (host.directoryExists(atTypes)) { + (typeRoots || (typeRoots = [])).push(atTypes); + } + var parent_15 = ts.getDirectoryPath(currentDirectory); + if (parent_15 === currentDirectory) { + break; + } + currentDirectory = parent_15; + } + return typeRoots; + } + var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types"); function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host) { var traceEnabled = isTraceEnabled(options, host); var moduleResolutionState = { @@ -39877,24 +39896,24 @@ var ts; switch (n.kind) { case 199: if (!ts.isFunctionBlock(n)) { - var parent_15 = n.parent; + var parent_16 = n.parent; var openBrace = ts.findChildOfKind(n, 15, sourceFile); var closeBrace = ts.findChildOfKind(n, 16, sourceFile); - if (parent_15.kind === 204 || - parent_15.kind === 207 || - parent_15.kind === 208 || - parent_15.kind === 206 || - parent_15.kind === 203 || - parent_15.kind === 205 || - parent_15.kind === 212 || - parent_15.kind === 252) { - addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n)); + if (parent_16.kind === 204 || + parent_16.kind === 207 || + parent_16.kind === 208 || + parent_16.kind === 206 || + parent_16.kind === 203 || + parent_16.kind === 205 || + parent_16.kind === 212 || + parent_16.kind === 252) { + addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_15.kind === 216) { - var tryStatement = parent_15; + if (parent_16.kind === 216) { + var tryStatement = parent_16; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -45512,8 +45531,8 @@ var ts; if (declaration.kind !== 218 && declaration.kind !== 220) { return false; } - for (var parent_16 = declaration.parent; !ts.isFunctionBlock(parent_16); parent_16 = parent_16.parent) { - if (parent_16.kind === 256 || parent_16.kind === 226) { + for (var parent_17 = declaration.parent; !ts.isFunctionBlock(parent_17); parent_17 = parent_17.parent) { + if (parent_17.kind === 256 || parent_17.kind === 226) { return false; } } @@ -46642,13 +46661,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent_17 = contextToken.parent, kind = contextToken.kind; + var parent_18 = contextToken.parent, kind = contextToken.kind; if (kind === 21) { - if (parent_17.kind === 172) { + if (parent_18.kind === 172) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent_17.kind === 139) { + else if (parent_18.kind === 139) { node = contextToken.parent.left; isRightOfDot = true; } @@ -46936,9 +46955,9 @@ var ts; switch (contextToken.kind) { case 15: case 24: - var parent_18 = contextToken.parent; - if (parent_18 && (parent_18.kind === 171 || parent_18.kind === 167)) { - return parent_18; + var parent_19 = contextToken.parent; + if (parent_19 && (parent_19.kind === 171 || parent_19.kind === 167)) { + return parent_19; } break; } @@ -46961,34 +46980,34 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent_19 = contextToken.parent; + var parent_20 = contextToken.parent; switch (contextToken.kind) { case 26: case 39: case 69: case 246: case 247: - if (parent_19 && (parent_19.kind === 242 || parent_19.kind === 243)) { - return parent_19; + if (parent_20 && (parent_20.kind === 242 || parent_20.kind === 243)) { + return parent_20; } - else if (parent_19.kind === 246) { - return parent_19.parent; + else if (parent_20.kind === 246) { + return parent_20.parent; } break; case 9: - if (parent_19 && ((parent_19.kind === 246) || (parent_19.kind === 247))) { - return parent_19.parent; + if (parent_20 && ((parent_20.kind === 246) || (parent_20.kind === 247))) { + return parent_20.parent; } break; case 16: - if (parent_19 && - parent_19.kind === 248 && - parent_19.parent && - (parent_19.parent.kind === 246)) { - return parent_19.parent.parent; + if (parent_20 && + parent_20.kind === 248 && + parent_20.parent && + (parent_20.parent.kind === 246)) { + return parent_20.parent.parent; } - if (parent_19 && parent_19.kind === 247) { - return parent_19.parent; + if (parent_20 && parent_20.kind === 247) { + return parent_20.parent; } break; } @@ -48228,17 +48247,17 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent_20 = child.parent; - if (ts.isFunctionBlock(parent_20) || parent_20.kind === 256) { - return parent_20; + var parent_21 = child.parent; + if (ts.isFunctionBlock(parent_21) || parent_21.kind === 256) { + return parent_21; } - if (parent_20.kind === 216) { - var tryStatement = parent_20; + if (parent_21.kind === 216) { + var tryStatement = parent_21; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent_20; + child = parent_21; } return undefined; } diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index e9b95951e62..724a16dd326 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -14312,6 +14312,7 @@ var ts; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); + var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false); var enumNumberIndexInfo = createIndexInfo(stringType, true); var globals = ts.createMap(); var patternAmbientModules; @@ -16479,7 +16480,9 @@ var ts; if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 2048)) { type = getTypeWithFacts(type, 131072); } - return type; + return declaration.initializer ? + getUnionType([type, checkExpressionCached(declaration.initializer)], true) : + type; } function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { var jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration); @@ -21332,13 +21335,14 @@ var ts; var isParameter = ts.getRootDeclaration(declaration).kind === 142; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); + var isOuterVariable = flowContainer !== declarationContainer; while (flowContainer !== declarationContainer && (flowContainer.kind === 179 || flowContainer.kind === 180) && (isReadonlySymbol(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } var assumeInitialized = !strictNullChecks || (type.flags & 1) !== 0 || isParameter || - flowContainer !== declarationContainer || ts.isInAmbientContext(declaration); + isOuterVariable || ts.isInAmbientContext(declaration); var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); if (!assumeInitialized && !(getFalsyFlags(type) & 2048) && getFalsyFlags(flowType) & 2048) { error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol)); @@ -23568,16 +23572,16 @@ var ts; function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); var cached = links.resolvedSignature; - if (cached && cached !== anySignature && !candidatesOutArray) { + if (cached && cached !== resolvingSignature && !candidatesOutArray) { return cached; } - links.resolvedSignature = anySignature; + links.resolvedSignature = resolvingSignature; var result = resolveSignature(node, candidatesOutArray); links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached; return result; } function getResolvedOrAnySignature(node) { - return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node); + return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node); } function getInferredClassType(symbol) { var links = getSymbolLinks(symbol); @@ -24529,7 +24533,7 @@ var ts; return maybeTypeOfKind(contextualType, (64 | 256)); } if (type.flags & 8) { - return maybeTypeOfKind(contextualType, 128) && !isTypeAssignableTo(booleanType, contextualType); + return maybeTypeOfKind(contextualType, 128); } if (type.flags & 16) { return typeContainsLiteralFromEnum(contextualType, type); @@ -37531,7 +37535,6 @@ var ts; (function (ts) { ts.version = "2.0.2"; var emptyArray = []; - var defaultTypeRoots = ["node_modules/@types"]; function findConfigFile(searchPath, fileExists) { while (true) { var fileName = ts.combinePaths(searchPath, "tsconfig.json"); @@ -37664,11 +37667,27 @@ var ts; else if (host.getCurrentDirectory) { currentDirectory = host.getCurrentDirectory(); } - if (!currentDirectory) { - return undefined; - } - return ts.map(defaultTypeRoots, function (d) { return ts.combinePaths(currentDirectory, d); }); + return currentDirectory && getDefaultTypeRoots(currentDirectory, host); } + function getDefaultTypeRoots(currentDirectory, host) { + if (!host.directoryExists) { + return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; + } + var typeRoots; + while (true) { + var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes); + if (host.directoryExists(atTypes)) { + (typeRoots || (typeRoots = [])).push(atTypes); + } + var parent_15 = ts.getDirectoryPath(currentDirectory); + if (parent_15 === currentDirectory) { + break; + } + currentDirectory = parent_15; + } + return typeRoots; + } + var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types"); function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host) { var traceEnabled = isTraceEnabled(options, host); var moduleResolutionState = { @@ -39877,24 +39896,24 @@ var ts; switch (n.kind) { case 199: if (!ts.isFunctionBlock(n)) { - var parent_15 = n.parent; + var parent_16 = n.parent; var openBrace = ts.findChildOfKind(n, 15, sourceFile); var closeBrace = ts.findChildOfKind(n, 16, sourceFile); - if (parent_15.kind === 204 || - parent_15.kind === 207 || - parent_15.kind === 208 || - parent_15.kind === 206 || - parent_15.kind === 203 || - parent_15.kind === 205 || - parent_15.kind === 212 || - parent_15.kind === 252) { - addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n)); + if (parent_16.kind === 204 || + parent_16.kind === 207 || + parent_16.kind === 208 || + parent_16.kind === 206 || + parent_16.kind === 203 || + parent_16.kind === 205 || + parent_16.kind === 212 || + parent_16.kind === 252) { + addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_15.kind === 216) { - var tryStatement = parent_15; + if (parent_16.kind === 216) { + var tryStatement = parent_16; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -45512,8 +45531,8 @@ var ts; if (declaration.kind !== 218 && declaration.kind !== 220) { return false; } - for (var parent_16 = declaration.parent; !ts.isFunctionBlock(parent_16); parent_16 = parent_16.parent) { - if (parent_16.kind === 256 || parent_16.kind === 226) { + for (var parent_17 = declaration.parent; !ts.isFunctionBlock(parent_17); parent_17 = parent_17.parent) { + if (parent_17.kind === 256 || parent_17.kind === 226) { return false; } } @@ -46642,13 +46661,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent_17 = contextToken.parent, kind = contextToken.kind; + var parent_18 = contextToken.parent, kind = contextToken.kind; if (kind === 21) { - if (parent_17.kind === 172) { + if (parent_18.kind === 172) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent_17.kind === 139) { + else if (parent_18.kind === 139) { node = contextToken.parent.left; isRightOfDot = true; } @@ -46936,9 +46955,9 @@ var ts; switch (contextToken.kind) { case 15: case 24: - var parent_18 = contextToken.parent; - if (parent_18 && (parent_18.kind === 171 || parent_18.kind === 167)) { - return parent_18; + var parent_19 = contextToken.parent; + if (parent_19 && (parent_19.kind === 171 || parent_19.kind === 167)) { + return parent_19; } break; } @@ -46961,34 +46980,34 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent_19 = contextToken.parent; + var parent_20 = contextToken.parent; switch (contextToken.kind) { case 26: case 39: case 69: case 246: case 247: - if (parent_19 && (parent_19.kind === 242 || parent_19.kind === 243)) { - return parent_19; + if (parent_20 && (parent_20.kind === 242 || parent_20.kind === 243)) { + return parent_20; } - else if (parent_19.kind === 246) { - return parent_19.parent; + else if (parent_20.kind === 246) { + return parent_20.parent; } break; case 9: - if (parent_19 && ((parent_19.kind === 246) || (parent_19.kind === 247))) { - return parent_19.parent; + if (parent_20 && ((parent_20.kind === 246) || (parent_20.kind === 247))) { + return parent_20.parent; } break; case 16: - if (parent_19 && - parent_19.kind === 248 && - parent_19.parent && - (parent_19.parent.kind === 246)) { - return parent_19.parent.parent; + if (parent_20 && + parent_20.kind === 248 && + parent_20.parent && + (parent_20.parent.kind === 246)) { + return parent_20.parent.parent; } - if (parent_19 && parent_19.kind === 247) { - return parent_19.parent; + if (parent_20 && parent_20.kind === 247) { + return parent_20.parent; } break; } @@ -48228,17 +48247,17 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent_20 = child.parent; - if (ts.isFunctionBlock(parent_20) || parent_20.kind === 256) { - return parent_20; + var parent_21 = child.parent; + if (ts.isFunctionBlock(parent_21) || parent_21.kind === 256) { + return parent_21; } - if (parent_20.kind === 216) { - var tryStatement = parent_20; + if (parent_21.kind === 216) { + var tryStatement = parent_21; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent_20; + child = parent_21; } return undefined; } diff --git a/lib/typescript.js b/lib/typescript.js index 6babaf9e4a0..b4f5deb40a0 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -16621,6 +16621,7 @@ var ts; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true); var globals = ts.createMap(); /** @@ -19194,7 +19195,9 @@ var ts; if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 2048 /* Undefined */)) { type = getTypeWithFacts(type, 131072 /* NEUndefined */); } - return type; + return declaration.initializer ? + getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : + type; } function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { var jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration); @@ -24650,6 +24653,7 @@ var ts; var isParameter = ts.getRootDeclaration(declaration).kind === 142 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); + var isOuterVariable = flowContainer !== declarationContainer; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. @@ -24662,7 +24666,7 @@ var ts; // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). var assumeInitialized = !strictNullChecks || (type.flags & 1 /* Any */) !== 0 || isParameter || - flowContainer !== declarationContainer || ts.isInAmbientContext(declaration); + isOuterVariable || ts.isInAmbientContext(declaration); var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); // A variable is considered uninitialized when it is possible to analyze the entire control flow graph // from declaration to use, and when the variable's declared type doesn't include undefined but the @@ -27628,10 +27632,10 @@ var ts; // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work // to correctly fill the candidatesOutArray. var cached = links.resolvedSignature; - if (cached && cached !== anySignature && !candidatesOutArray) { + if (cached && cached !== resolvingSignature && !candidatesOutArray) { return cached; } - links.resolvedSignature = anySignature; + links.resolvedSignature = resolvingSignature; var result = resolveSignature(node, candidatesOutArray); // If signature resolution originated in control flow type analysis (for example to compute the // assigned type in a flow assignment) we don't cache the result as it may be based on temporary @@ -27642,7 +27646,7 @@ var ts; function getResolvedOrAnySignature(node) { // If we're already in the process of resolving the given signature, don't resolve again as // that could cause infinite recursion. Instead, return anySignature. - return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node); + return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node); } function getInferredClassType(symbol) { var links = getSymbolLinks(symbol); @@ -28775,7 +28779,7 @@ var ts; return maybeTypeOfKind(contextualType, (64 /* NumberLiteral */ | 256 /* EnumLiteral */)); } if (type.flags & 8 /* Boolean */) { - return maybeTypeOfKind(contextualType, 128 /* BooleanLiteral */) && !isTypeAssignableTo(booleanType, contextualType); + return maybeTypeOfKind(contextualType, 128 /* BooleanLiteral */); } if (type.flags & 16 /* Enum */) { return typeContainsLiteralFromEnum(contextualType, type); @@ -43942,7 +43946,6 @@ var ts; /** The version of the TypeScript compiler release */ ts.version = "2.0.2"; var emptyArray = []; - var defaultTypeRoots = ["node_modules/@types"]; function findConfigFile(searchPath, fileExists) { while (true) { var fileName = ts.combinePaths(searchPath, "tsconfig.json"); @@ -44086,11 +44089,31 @@ var ts; else if (host.getCurrentDirectory) { currentDirectory = host.getCurrentDirectory(); } - if (!currentDirectory) { - return undefined; - } - return ts.map(defaultTypeRoots, function (d) { return ts.combinePaths(currentDirectory, d); }); + return currentDirectory && getDefaultTypeRoots(currentDirectory, host); } + /** + * Returns the path to every node_modules/@types directory from some ancestor directory. + * Returns undefined if there are none. + */ + function getDefaultTypeRoots(currentDirectory, host) { + if (!host.directoryExists) { + return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; + } + var typeRoots; + while (true) { + var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes); + if (host.directoryExists(atTypes)) { + (typeRoots || (typeRoots = [])).push(atTypes); + } + var parent_15 = ts.getDirectoryPath(currentDirectory); + if (parent_15 === currentDirectory) { + break; + } + currentDirectory = parent_15; + } + return typeRoots; + } + var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types"); /** * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown. * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups @@ -47263,28 +47286,28 @@ var ts; switch (n.kind) { case 199 /* Block */: if (!ts.isFunctionBlock(n)) { - var parent_15 = n.parent; + var parent_16 = n.parent; var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. - if (parent_15.kind === 204 /* DoStatement */ || - parent_15.kind === 207 /* ForInStatement */ || - parent_15.kind === 208 /* ForOfStatement */ || - parent_15.kind === 206 /* ForStatement */ || - parent_15.kind === 203 /* IfStatement */ || - parent_15.kind === 205 /* WhileStatement */ || - parent_15.kind === 212 /* WithStatement */ || - parent_15.kind === 252 /* CatchClause */) { - addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n)); + if (parent_16.kind === 204 /* DoStatement */ || + parent_16.kind === 207 /* ForInStatement */ || + parent_16.kind === 208 /* ForOfStatement */ || + parent_16.kind === 206 /* ForStatement */ || + parent_16.kind === 203 /* IfStatement */ || + parent_16.kind === 205 /* WhileStatement */ || + parent_16.kind === 212 /* WithStatement */ || + parent_16.kind === 252 /* CatchClause */) { + addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_15.kind === 216 /* TryStatement */) { + if (parent_16.kind === 216 /* TryStatement */) { // Could be the try-block, or the finally-block. - var tryStatement = parent_15; + var tryStatement = parent_16; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -54114,9 +54137,9 @@ var ts; return false; } // If the parent is not sourceFile or module block it is local variable - for (var parent_16 = declaration.parent; !ts.isFunctionBlock(parent_16); parent_16 = parent_16.parent) { + for (var parent_17 = declaration.parent; !ts.isFunctionBlock(parent_17); parent_17 = parent_17.parent) { // Reached source file or module block - if (parent_16.kind === 256 /* SourceFile */ || parent_16.kind === 226 /* ModuleBlock */) { + if (parent_17.kind === 256 /* SourceFile */ || parent_17.kind === 226 /* ModuleBlock */) { return false; } } @@ -55482,13 +55505,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent_17 = contextToken.parent, kind = contextToken.kind; + var parent_18 = contextToken.parent, kind = contextToken.kind; if (kind === 21 /* DotToken */) { - if (parent_17.kind === 172 /* PropertyAccessExpression */) { + if (parent_18.kind === 172 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent_17.kind === 139 /* QualifiedName */) { + else if (parent_18.kind === 139 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -55866,9 +55889,9 @@ var ts; switch (contextToken.kind) { case 15 /* OpenBraceToken */: // const x = { | case 24 /* CommaToken */: - var parent_18 = contextToken.parent; - if (parent_18 && (parent_18.kind === 171 /* ObjectLiteralExpression */ || parent_18.kind === 167 /* ObjectBindingPattern */)) { - return parent_18; + var parent_19 = contextToken.parent; + if (parent_19 && (parent_19.kind === 171 /* ObjectLiteralExpression */ || parent_19.kind === 167 /* ObjectBindingPattern */)) { + return parent_19; } break; } @@ -55895,37 +55918,37 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent_19 = contextToken.parent; + var parent_20 = contextToken.parent; switch (contextToken.kind) { case 26 /* LessThanSlashToken */: case 39 /* SlashToken */: case 69 /* Identifier */: case 246 /* JsxAttribute */: case 247 /* JsxSpreadAttribute */: - if (parent_19 && (parent_19.kind === 242 /* JsxSelfClosingElement */ || parent_19.kind === 243 /* JsxOpeningElement */)) { - return parent_19; + if (parent_20 && (parent_20.kind === 242 /* JsxSelfClosingElement */ || parent_20.kind === 243 /* JsxOpeningElement */)) { + return parent_20; } - else if (parent_19.kind === 246 /* JsxAttribute */) { - return parent_19.parent; + else if (parent_20.kind === 246 /* JsxAttribute */) { + return parent_20.parent; } break; // The context token is the closing } or " of an attribute, which means // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent_19 && ((parent_19.kind === 246 /* JsxAttribute */) || (parent_19.kind === 247 /* JsxSpreadAttribute */))) { - return parent_19.parent; + if (parent_20 && ((parent_20.kind === 246 /* JsxAttribute */) || (parent_20.kind === 247 /* JsxSpreadAttribute */))) { + return parent_20.parent; } break; case 16 /* CloseBraceToken */: - if (parent_19 && - parent_19.kind === 248 /* JsxExpression */ && - parent_19.parent && - (parent_19.parent.kind === 246 /* JsxAttribute */)) { - return parent_19.parent.parent; + if (parent_20 && + parent_20.kind === 248 /* JsxExpression */ && + parent_20.parent && + (parent_20.parent.kind === 246 /* JsxAttribute */)) { + return parent_20.parent.parent; } - if (parent_19 && parent_19.kind === 247 /* JsxSpreadAttribute */) { - return parent_19.parent; + if (parent_20 && parent_20.kind === 247 /* JsxSpreadAttribute */) { + return parent_20.parent; } break; } @@ -57319,19 +57342,19 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent_20 = child.parent; - if (ts.isFunctionBlock(parent_20) || parent_20.kind === 256 /* SourceFile */) { - return parent_20; + var parent_21 = child.parent; + if (ts.isFunctionBlock(parent_21) || parent_21.kind === 256 /* SourceFile */) { + return parent_21; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent_20.kind === 216 /* TryStatement */) { - var tryStatement = parent_20; + if (parent_21.kind === 216 /* TryStatement */) { + var tryStatement = parent_21; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent_20; + child = parent_21; } return undefined; } diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 6babaf9e4a0..b4f5deb40a0 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -16621,6 +16621,7 @@ var ts; var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true); var globals = ts.createMap(); /** @@ -19194,7 +19195,9 @@ var ts; if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 2048 /* Undefined */)) { type = getTypeWithFacts(type, 131072 /* NEUndefined */); } - return type; + return declaration.initializer ? + getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : + type; } function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) { var jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration); @@ -24650,6 +24653,7 @@ var ts; var isParameter = ts.getRootDeclaration(declaration).kind === 142 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); + var isOuterVariable = flowContainer !== declarationContainer; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. @@ -24662,7 +24666,7 @@ var ts; // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). var assumeInitialized = !strictNullChecks || (type.flags & 1 /* Any */) !== 0 || isParameter || - flowContainer !== declarationContainer || ts.isInAmbientContext(declaration); + isOuterVariable || ts.isInAmbientContext(declaration); var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); // A variable is considered uninitialized when it is possible to analyze the entire control flow graph // from declaration to use, and when the variable's declared type doesn't include undefined but the @@ -27628,10 +27632,10 @@ var ts; // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work // to correctly fill the candidatesOutArray. var cached = links.resolvedSignature; - if (cached && cached !== anySignature && !candidatesOutArray) { + if (cached && cached !== resolvingSignature && !candidatesOutArray) { return cached; } - links.resolvedSignature = anySignature; + links.resolvedSignature = resolvingSignature; var result = resolveSignature(node, candidatesOutArray); // If signature resolution originated in control flow type analysis (for example to compute the // assigned type in a flow assignment) we don't cache the result as it may be based on temporary @@ -27642,7 +27646,7 @@ var ts; function getResolvedOrAnySignature(node) { // If we're already in the process of resolving the given signature, don't resolve again as // that could cause infinite recursion. Instead, return anySignature. - return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node); + return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node); } function getInferredClassType(symbol) { var links = getSymbolLinks(symbol); @@ -28775,7 +28779,7 @@ var ts; return maybeTypeOfKind(contextualType, (64 /* NumberLiteral */ | 256 /* EnumLiteral */)); } if (type.flags & 8 /* Boolean */) { - return maybeTypeOfKind(contextualType, 128 /* BooleanLiteral */) && !isTypeAssignableTo(booleanType, contextualType); + return maybeTypeOfKind(contextualType, 128 /* BooleanLiteral */); } if (type.flags & 16 /* Enum */) { return typeContainsLiteralFromEnum(contextualType, type); @@ -43942,7 +43946,6 @@ var ts; /** The version of the TypeScript compiler release */ ts.version = "2.0.2"; var emptyArray = []; - var defaultTypeRoots = ["node_modules/@types"]; function findConfigFile(searchPath, fileExists) { while (true) { var fileName = ts.combinePaths(searchPath, "tsconfig.json"); @@ -44086,11 +44089,31 @@ var ts; else if (host.getCurrentDirectory) { currentDirectory = host.getCurrentDirectory(); } - if (!currentDirectory) { - return undefined; - } - return ts.map(defaultTypeRoots, function (d) { return ts.combinePaths(currentDirectory, d); }); + return currentDirectory && getDefaultTypeRoots(currentDirectory, host); } + /** + * Returns the path to every node_modules/@types directory from some ancestor directory. + * Returns undefined if there are none. + */ + function getDefaultTypeRoots(currentDirectory, host) { + if (!host.directoryExists) { + return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; + } + var typeRoots; + while (true) { + var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes); + if (host.directoryExists(atTypes)) { + (typeRoots || (typeRoots = [])).push(atTypes); + } + var parent_15 = ts.getDirectoryPath(currentDirectory); + if (parent_15 === currentDirectory) { + break; + } + currentDirectory = parent_15; + } + return typeRoots; + } + var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types"); /** * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown. * This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups @@ -47263,28 +47286,28 @@ var ts; switch (n.kind) { case 199 /* Block */: if (!ts.isFunctionBlock(n)) { - var parent_15 = n.parent; + var parent_16 = n.parent; var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile); // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. - if (parent_15.kind === 204 /* DoStatement */ || - parent_15.kind === 207 /* ForInStatement */ || - parent_15.kind === 208 /* ForOfStatement */ || - parent_15.kind === 206 /* ForStatement */ || - parent_15.kind === 203 /* IfStatement */ || - parent_15.kind === 205 /* WhileStatement */ || - parent_15.kind === 212 /* WithStatement */ || - parent_15.kind === 252 /* CatchClause */) { - addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n)); + if (parent_16.kind === 204 /* DoStatement */ || + parent_16.kind === 207 /* ForInStatement */ || + parent_16.kind === 208 /* ForOfStatement */ || + parent_16.kind === 206 /* ForStatement */ || + parent_16.kind === 203 /* IfStatement */ || + parent_16.kind === 205 /* WhileStatement */ || + parent_16.kind === 212 /* WithStatement */ || + parent_16.kind === 252 /* CatchClause */) { + addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_15.kind === 216 /* TryStatement */) { + if (parent_16.kind === 216 /* TryStatement */) { // Could be the try-block, or the finally-block. - var tryStatement = parent_15; + var tryStatement = parent_16; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -54114,9 +54137,9 @@ var ts; return false; } // If the parent is not sourceFile or module block it is local variable - for (var parent_16 = declaration.parent; !ts.isFunctionBlock(parent_16); parent_16 = parent_16.parent) { + for (var parent_17 = declaration.parent; !ts.isFunctionBlock(parent_17); parent_17 = parent_17.parent) { // Reached source file or module block - if (parent_16.kind === 256 /* SourceFile */ || parent_16.kind === 226 /* ModuleBlock */) { + if (parent_17.kind === 256 /* SourceFile */ || parent_17.kind === 226 /* ModuleBlock */) { return false; } } @@ -55482,13 +55505,13 @@ var ts; log("Returning an empty list because completion was requested in an invalid position."); return undefined; } - var parent_17 = contextToken.parent, kind = contextToken.kind; + var parent_18 = contextToken.parent, kind = contextToken.kind; if (kind === 21 /* DotToken */) { - if (parent_17.kind === 172 /* PropertyAccessExpression */) { + if (parent_18.kind === 172 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (parent_17.kind === 139 /* QualifiedName */) { + else if (parent_18.kind === 139 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -55866,9 +55889,9 @@ var ts; switch (contextToken.kind) { case 15 /* OpenBraceToken */: // const x = { | case 24 /* CommaToken */: - var parent_18 = contextToken.parent; - if (parent_18 && (parent_18.kind === 171 /* ObjectLiteralExpression */ || parent_18.kind === 167 /* ObjectBindingPattern */)) { - return parent_18; + var parent_19 = contextToken.parent; + if (parent_19 && (parent_19.kind === 171 /* ObjectLiteralExpression */ || parent_19.kind === 167 /* ObjectBindingPattern */)) { + return parent_19; } break; } @@ -55895,37 +55918,37 @@ var ts; } function tryGetContainingJsxElement(contextToken) { if (contextToken) { - var parent_19 = contextToken.parent; + var parent_20 = contextToken.parent; switch (contextToken.kind) { case 26 /* LessThanSlashToken */: case 39 /* SlashToken */: case 69 /* Identifier */: case 246 /* JsxAttribute */: case 247 /* JsxSpreadAttribute */: - if (parent_19 && (parent_19.kind === 242 /* JsxSelfClosingElement */ || parent_19.kind === 243 /* JsxOpeningElement */)) { - return parent_19; + if (parent_20 && (parent_20.kind === 242 /* JsxSelfClosingElement */ || parent_20.kind === 243 /* JsxOpeningElement */)) { + return parent_20; } - else if (parent_19.kind === 246 /* JsxAttribute */) { - return parent_19.parent; + else if (parent_20.kind === 246 /* JsxAttribute */) { + return parent_20.parent; } break; // The context token is the closing } or " of an attribute, which means // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent_19 && ((parent_19.kind === 246 /* JsxAttribute */) || (parent_19.kind === 247 /* JsxSpreadAttribute */))) { - return parent_19.parent; + if (parent_20 && ((parent_20.kind === 246 /* JsxAttribute */) || (parent_20.kind === 247 /* JsxSpreadAttribute */))) { + return parent_20.parent; } break; case 16 /* CloseBraceToken */: - if (parent_19 && - parent_19.kind === 248 /* JsxExpression */ && - parent_19.parent && - (parent_19.parent.kind === 246 /* JsxAttribute */)) { - return parent_19.parent.parent; + if (parent_20 && + parent_20.kind === 248 /* JsxExpression */ && + parent_20.parent && + (parent_20.parent.kind === 246 /* JsxAttribute */)) { + return parent_20.parent.parent; } - if (parent_19 && parent_19.kind === 247 /* JsxSpreadAttribute */) { - return parent_19.parent; + if (parent_20 && parent_20.kind === 247 /* JsxSpreadAttribute */) { + return parent_20.parent; } break; } @@ -57319,19 +57342,19 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent_20 = child.parent; - if (ts.isFunctionBlock(parent_20) || parent_20.kind === 256 /* SourceFile */) { - return parent_20; + var parent_21 = child.parent; + if (ts.isFunctionBlock(parent_21) || parent_21.kind === 256 /* SourceFile */) { + return parent_21; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent_20.kind === 216 /* TryStatement */) { - var tryStatement = parent_20; + if (parent_21.kind === 216 /* TryStatement */) { + var tryStatement = parent_21; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent_20; + child = parent_21; } return undefined; } From 709b4ebc83f8bbfdd55507aedab99564497f12db Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 10 Sep 2016 07:13:57 -0700 Subject: [PATCH 14/44] Preserve type parameter types in narrowing --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 162c40e108a..8dca2ac0d0b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8665,7 +8665,7 @@ namespace ts { // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the // two types. const targetType = type.flags & TypeFlags.TypeParameter ? getApparentType(type) : type; - return isTypeSubtypeOf(candidate, targetType) ? candidate : + return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, targetType) ? candidate : getIntersectionType([type, candidate]); From 9986f81981d56e47957ca436b69384d026c14eda Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 10 Sep 2016 07:20:05 -0700 Subject: [PATCH 15/44] Add regression test --- .../narrowingConstrainedTypeParameter.js | 32 ++++++++++++ .../narrowingConstrainedTypeParameter.symbols | 42 +++++++++++++++ .../narrowingConstrainedTypeParameter.types | 52 +++++++++++++++++++ .../narrowingConstrainedTypeParameter.ts | 18 +++++++ 4 files changed, 144 insertions(+) create mode 100644 tests/baselines/reference/narrowingConstrainedTypeParameter.js create mode 100644 tests/baselines/reference/narrowingConstrainedTypeParameter.symbols create mode 100644 tests/baselines/reference/narrowingConstrainedTypeParameter.types create mode 100644 tests/cases/compiler/narrowingConstrainedTypeParameter.ts diff --git a/tests/baselines/reference/narrowingConstrainedTypeParameter.js b/tests/baselines/reference/narrowingConstrainedTypeParameter.js new file mode 100644 index 00000000000..3107585d941 --- /dev/null +++ b/tests/baselines/reference/narrowingConstrainedTypeParameter.js @@ -0,0 +1,32 @@ +//// [narrowingConstrainedTypeParameter.ts] + +// Repro from #10811 + +interface Pet { + name: string; +} + +function isPet(pet: any): pet is Pet { + return typeof pet.name === "string"; +} + +export function speak(pet: TPet, voice: (pet: TPet) => string): string { + if (!isPet(pet)) { + throw new Error("Expected \"pet\" to be a Pet"); + } + return voice(pet); +} + +//// [narrowingConstrainedTypeParameter.js] +// Repro from #10811 +"use strict"; +function isPet(pet) { + return typeof pet.name === "string"; +} +function speak(pet, voice) { + if (!isPet(pet)) { + throw new Error("Expected \"pet\" to be a Pet"); + } + return voice(pet); +} +exports.speak = speak; diff --git a/tests/baselines/reference/narrowingConstrainedTypeParameter.symbols b/tests/baselines/reference/narrowingConstrainedTypeParameter.symbols new file mode 100644 index 00000000000..89ca39e98a2 --- /dev/null +++ b/tests/baselines/reference/narrowingConstrainedTypeParameter.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/narrowingConstrainedTypeParameter.ts === + +// Repro from #10811 + +interface Pet { +>Pet : Symbol(Pet, Decl(narrowingConstrainedTypeParameter.ts, 0, 0)) + + name: string; +>name : Symbol(Pet.name, Decl(narrowingConstrainedTypeParameter.ts, 3, 15)) +} + +function isPet(pet: any): pet is Pet { +>isPet : Symbol(isPet, Decl(narrowingConstrainedTypeParameter.ts, 5, 1)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 7, 15)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 7, 15)) +>Pet : Symbol(Pet, Decl(narrowingConstrainedTypeParameter.ts, 0, 0)) + + return typeof pet.name === "string"; +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 7, 15)) +} + +export function speak(pet: TPet, voice: (pet: TPet) => string): string { +>speak : Symbol(speak, Decl(narrowingConstrainedTypeParameter.ts, 9, 1)) +>TPet : Symbol(TPet, Decl(narrowingConstrainedTypeParameter.ts, 11, 22)) +>Pet : Symbol(Pet, Decl(narrowingConstrainedTypeParameter.ts, 0, 0)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 11, 40)) +>TPet : Symbol(TPet, Decl(narrowingConstrainedTypeParameter.ts, 11, 22)) +>voice : Symbol(voice, Decl(narrowingConstrainedTypeParameter.ts, 11, 50)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 11, 59)) +>TPet : Symbol(TPet, Decl(narrowingConstrainedTypeParameter.ts, 11, 22)) + + if (!isPet(pet)) { +>isPet : Symbol(isPet, Decl(narrowingConstrainedTypeParameter.ts, 5, 1)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 11, 40)) + + throw new Error("Expected \"pet\" to be a Pet"); +>Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + } + return voice(pet); +>voice : Symbol(voice, Decl(narrowingConstrainedTypeParameter.ts, 11, 50)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 11, 40)) +} diff --git a/tests/baselines/reference/narrowingConstrainedTypeParameter.types b/tests/baselines/reference/narrowingConstrainedTypeParameter.types new file mode 100644 index 00000000000..adefb63ab88 --- /dev/null +++ b/tests/baselines/reference/narrowingConstrainedTypeParameter.types @@ -0,0 +1,52 @@ +=== tests/cases/compiler/narrowingConstrainedTypeParameter.ts === + +// Repro from #10811 + +interface Pet { +>Pet : Pet + + name: string; +>name : string +} + +function isPet(pet: any): pet is Pet { +>isPet : (pet: any) => pet is Pet +>pet : any +>pet : any +>Pet : Pet + + return typeof pet.name === "string"; +>typeof pet.name === "string" : boolean +>typeof pet.name : string +>pet.name : any +>pet : any +>name : any +>"string" : "string" +} + +export function speak(pet: TPet, voice: (pet: TPet) => string): string { +>speak : (pet: TPet, voice: (pet: TPet) => string) => string +>TPet : TPet +>Pet : Pet +>pet : TPet +>TPet : TPet +>voice : (pet: TPet) => string +>pet : TPet +>TPet : TPet + + if (!isPet(pet)) { +>!isPet(pet) : boolean +>isPet(pet) : boolean +>isPet : (pet: any) => pet is Pet +>pet : TPet + + throw new Error("Expected \"pet\" to be a Pet"); +>new Error("Expected \"pet\" to be a Pet") : Error +>Error : ErrorConstructor +>"Expected \"pet\" to be a Pet" : string + } + return voice(pet); +>voice(pet) : string +>voice : (pet: TPet) => string +>pet : TPet +} diff --git a/tests/cases/compiler/narrowingConstrainedTypeParameter.ts b/tests/cases/compiler/narrowingConstrainedTypeParameter.ts new file mode 100644 index 00000000000..8eacbca0119 --- /dev/null +++ b/tests/cases/compiler/narrowingConstrainedTypeParameter.ts @@ -0,0 +1,18 @@ +// @strictNullChecks: true + +// Repro from #10811 + +interface Pet { + name: string; +} + +function isPet(pet: any): pet is Pet { + return typeof pet.name === "string"; +} + +export function speak(pet: TPet, voice: (pet: TPet) => string): string { + if (!isPet(pet)) { + throw new Error("Expected \"pet\" to be a Pet"); + } + return voice(pet); +} \ No newline at end of file From b8759b38ee32ad40023be5f9089d558152d73267 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 12 Sep 2016 12:38:32 -0700 Subject: [PATCH 16/44] Update LKG --- lib/tsc.js | 15 +++++++++------ lib/tsserver.js | 15 +++++++++------ lib/tsserverlibrary.d.ts | 2 +- lib/tsserverlibrary.js | 15 +++++++++------ lib/typescript.js | 17 ++++++++++------- lib/typescriptServices.js | 17 ++++++++++------- 6 files changed, 48 insertions(+), 33 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index 2be63c051ad..99e4d75cbf7 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -4271,10 +4271,13 @@ var ts; (node.name.kind === 9 || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; + function isShorthandAmbientModuleSymbol(moduleSymbol) { + return isShorthandAmbientModule(moduleSymbol.valueDeclaration); + } + ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { return node.kind === 225 && (!node.body); } - ts.isShorthandAmbientModule = isShorthandAmbientModule; function isBlockScopedContainerTopLevel(node) { return node.kind === 256 || node.kind === 225 || @@ -13944,7 +13947,7 @@ var ts; function getTargetOfImportClause(node) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration) ? + var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? moduleSymbol : moduleSymbol.exports["export="] ? getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : @@ -13999,7 +14002,7 @@ var ts; if (targetSymbol) { var name_10 = specifier.propertyName || specifier.name; if (name_10.text) { - if (ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration)) { + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; @@ -15774,7 +15777,7 @@ var ts; function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModule(symbol.valueDeclaration)) { + if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModuleSymbol(symbol)) { links.type = anyType; } else { @@ -20167,7 +20170,7 @@ var ts; } } var targetType = type.flags & 16384 ? getApparentType(type) : type; - return isTypeSubtypeOf(candidate, targetType) ? candidate : + return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, targetType) ? candidate : getIntersectionType([type, candidate]); @@ -27123,7 +27126,7 @@ var ts; } function moduleExportsSomeValue(moduleReferenceExpression) { var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); - if (!moduleSymbol) { + if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return true; } var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol); diff --git a/lib/tsserver.js b/lib/tsserver.js index 94b94d71415..ea61f48883c 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -5267,10 +5267,13 @@ var ts; (node.name.kind === 9 || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; + function isShorthandAmbientModuleSymbol(moduleSymbol) { + return isShorthandAmbientModule(moduleSymbol.valueDeclaration); + } + ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { return node.kind === 225 && (!node.body); } - ts.isShorthandAmbientModule = isShorthandAmbientModule; function isBlockScopedContainerTopLevel(node) { return node.kind === 256 || node.kind === 225 || @@ -14940,7 +14943,7 @@ var ts; function getTargetOfImportClause(node) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration) ? + var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? moduleSymbol : moduleSymbol.exports["export="] ? getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : @@ -14995,7 +14998,7 @@ var ts; if (targetSymbol) { var name_12 = specifier.propertyName || specifier.name; if (name_12.text) { - if (ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration)) { + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; @@ -16770,7 +16773,7 @@ var ts; function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModule(symbol.valueDeclaration)) { + if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModuleSymbol(symbol)) { links.type = anyType; } else { @@ -21163,7 +21166,7 @@ var ts; } } var targetType = type.flags & 16384 ? getApparentType(type) : type; - return isTypeSubtypeOf(candidate, targetType) ? candidate : + return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, targetType) ? candidate : getIntersectionType([type, candidate]); @@ -28119,7 +28122,7 @@ var ts; } function moduleExportsSomeValue(moduleReferenceExpression) { var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); - if (!moduleSymbol) { + if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return true; } var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol); diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index 7fe9da64cfe..c7ca800d0fe 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -7043,7 +7043,7 @@ declare namespace ts { function makeIdentifierFromModuleName(moduleName: string): string; function isBlockOrCatchScoped(declaration: Declaration): boolean; function isAmbientModule(node: Node): boolean; - function isShorthandAmbientModule(node: Node): boolean; + function isShorthandAmbientModuleSymbol(moduleSymbol: Symbol): boolean; function isBlockScopedContainerTopLevel(node: Node): boolean; function isGlobalScopeAugmentation(module: ModuleDeclaration): boolean; function isExternalModuleAugmentation(node: Node): boolean; diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 724a16dd326..88edc5dce20 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -5267,10 +5267,13 @@ var ts; (node.name.kind === 9 || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; + function isShorthandAmbientModuleSymbol(moduleSymbol) { + return isShorthandAmbientModule(moduleSymbol.valueDeclaration); + } + ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { return node.kind === 225 && (!node.body); } - ts.isShorthandAmbientModule = isShorthandAmbientModule; function isBlockScopedContainerTopLevel(node) { return node.kind === 256 || node.kind === 225 || @@ -14940,7 +14943,7 @@ var ts; function getTargetOfImportClause(node) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration) ? + var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? moduleSymbol : moduleSymbol.exports["export="] ? getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : @@ -14995,7 +14998,7 @@ var ts; if (targetSymbol) { var name_12 = specifier.propertyName || specifier.name; if (name_12.text) { - if (ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration)) { + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; @@ -16770,7 +16773,7 @@ var ts; function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModule(symbol.valueDeclaration)) { + if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModuleSymbol(symbol)) { links.type = anyType; } else { @@ -21163,7 +21166,7 @@ var ts; } } var targetType = type.flags & 16384 ? getApparentType(type) : type; - return isTypeSubtypeOf(candidate, targetType) ? candidate : + return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, targetType) ? candidate : getIntersectionType([type, candidate]); @@ -28119,7 +28122,7 @@ var ts; } function moduleExportsSomeValue(moduleReferenceExpression) { var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); - if (!moduleSymbol) { + if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return true; } var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol); diff --git a/lib/typescript.js b/lib/typescript.js index b4f5deb40a0..d3b32c17496 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -5636,11 +5636,14 @@ var ts; (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; + function isShorthandAmbientModuleSymbol(moduleSymbol) { + return isShorthandAmbientModule(moduleSymbol.valueDeclaration); + } + ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. return node.kind === 225 /* ModuleDeclaration */ && (!node.body); } - ts.isShorthandAmbientModule = isShorthandAmbientModule; function isBlockScopedContainerTopLevel(node) { return node.kind === 256 /* SourceFile */ || node.kind === 225 /* ModuleDeclaration */ || @@ -17445,7 +17448,7 @@ var ts; function getTargetOfImportClause(node) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration) ? + var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? moduleSymbol : moduleSymbol.exports["export="] ? getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : @@ -17518,7 +17521,7 @@ var ts; if (targetSymbol) { var name_10 = specifier.propertyName || specifier.name; if (name_10.text) { - if (ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration)) { + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; @@ -19549,7 +19552,7 @@ var ts; function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.valueDeclaration.kind === 225 /* ModuleDeclaration */ && ts.isShorthandAmbientModule(symbol.valueDeclaration)) { + if (symbol.valueDeclaration.kind === 225 /* ModuleDeclaration */ && ts.isShorthandAmbientModuleSymbol(symbol)) { links.type = anyType; } else { @@ -24454,7 +24457,7 @@ var ts; // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the // two types. var targetType = type.flags & 16384 /* TypeParameter */ ? getApparentType(type) : type; - return isTypeSubtypeOf(candidate, targetType) ? candidate : + return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, targetType) ? candidate : getIntersectionType([type, candidate]); @@ -33082,8 +33085,8 @@ var ts; } function moduleExportsSomeValue(moduleReferenceExpression) { var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); - if (!moduleSymbol) { - // module not found - be conservative + if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { + // If the module is not found or is shorthand, assume that it may export a value. return true; } var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol); diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index b4f5deb40a0..d3b32c17496 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -5636,11 +5636,14 @@ var ts; (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; + function isShorthandAmbientModuleSymbol(moduleSymbol) { + return isShorthandAmbientModule(moduleSymbol.valueDeclaration); + } + ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. return node.kind === 225 /* ModuleDeclaration */ && (!node.body); } - ts.isShorthandAmbientModule = isShorthandAmbientModule; function isBlockScopedContainerTopLevel(node) { return node.kind === 256 /* SourceFile */ || node.kind === 225 /* ModuleDeclaration */ || @@ -17445,7 +17448,7 @@ var ts; function getTargetOfImportClause(node) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { - var exportDefaultSymbol = ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration) ? + var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ? moduleSymbol : moduleSymbol.exports["export="] ? getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : @@ -17518,7 +17521,7 @@ var ts; if (targetSymbol) { var name_10 = specifier.propertyName || specifier.name; if (name_10.text) { - if (ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration)) { + if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } var symbolFromVariable = void 0; @@ -19549,7 +19552,7 @@ var ts; function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.valueDeclaration.kind === 225 /* ModuleDeclaration */ && ts.isShorthandAmbientModule(symbol.valueDeclaration)) { + if (symbol.valueDeclaration.kind === 225 /* ModuleDeclaration */ && ts.isShorthandAmbientModuleSymbol(symbol)) { links.type = anyType; } else { @@ -24454,7 +24457,7 @@ var ts; // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the // two types. var targetType = type.flags & 16384 /* TypeParameter */ ? getApparentType(type) : type; - return isTypeSubtypeOf(candidate, targetType) ? candidate : + return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, targetType) ? candidate : getIntersectionType([type, candidate]); @@ -33082,8 +33085,8 @@ var ts; } function moduleExportsSomeValue(moduleReferenceExpression) { var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); - if (!moduleSymbol) { - // module not found - be conservative + if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { + // If the module is not found or is shorthand, assume that it may export a value. return true; } var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol); From 88349ab436117ce31829afefda42cd049fd64d7b Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 12 Sep 2016 12:41:15 -0700 Subject: [PATCH 17/44] Quick bail out when narrowing type any by equality --- src/compiler/checker.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8dca2ac0d0b..7199e4a548f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8522,6 +8522,9 @@ namespace ts { } function narrowTypeByEquality(type: Type, operator: SyntaxKind, value: Expression, assumeTrue: boolean): Type { + if (type.flags & TypeFlags.Any) { + return type; + } if (operator === SyntaxKind.ExclamationEqualsToken || operator === SyntaxKind.ExclamationEqualsEqualsToken) { assumeTrue = !assumeTrue; } From 81c69b2a58a41d832ef3d0e825829bfe30968ebe Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 12 Sep 2016 12:41:39 -0700 Subject: [PATCH 18/44] Add regression test --- .../reference/complexNarrowingWithAny.js | 1027 ++++++ .../reference/complexNarrowingWithAny.symbols | 2304 +++++++++++++ .../reference/complexNarrowingWithAny.types | 3043 +++++++++++++++++ .../cases/compiler/complexNarrowingWithAny.ts | 558 +++ 4 files changed, 6932 insertions(+) create mode 100644 tests/baselines/reference/complexNarrowingWithAny.js create mode 100644 tests/baselines/reference/complexNarrowingWithAny.symbols create mode 100644 tests/baselines/reference/complexNarrowingWithAny.types create mode 100644 tests/cases/compiler/complexNarrowingWithAny.ts diff --git a/tests/baselines/reference/complexNarrowingWithAny.js b/tests/baselines/reference/complexNarrowingWithAny.js new file mode 100644 index 00000000000..0a137f5d793 --- /dev/null +++ b/tests/baselines/reference/complexNarrowingWithAny.js @@ -0,0 +1,1027 @@ +//// [complexNarrowingWithAny.ts] +// Repro from #10869 + +/** + * This file is generated by the Angular 2 template compiler. + * Do not edit. + */ + /* tslint:disable */ + +// import * as import0 from '@angular/core/src/linker/ng_module_factory'; +// import * as import1 from '../../app'; +// import * as import2 from '@angular/common/src/common_module'; +// import * as import3 from '@angular/core/src/application_module'; +// import * as import4 from '@angular/platform-browser/src/browser'; +// import * as import5 from '@angular/forms/src/directives'; +// import * as import6 from '@angular/forms/src/form_providers'; +// import * as import7 from '@angular/common/src/localization'; +// import * as import8 from '@angular/core/src/application_init'; +// import * as import9 from '@angular/core/src/testability/testability'; +// import * as import10 from '@angular/core/src/application_ref'; +// import * as import11 from '@angular/core/src/linker/compiler'; +// import * as import12 from '@angular/platform-browser/src/dom/events/hammer_gestures'; +// import * as import13 from '@angular/platform-browser/src/dom/events/event_manager'; +// import * as import14 from '@angular/platform-browser/src/dom/shared_styles_host'; +// import * as import15 from '@angular/platform-browser/src/dom/dom_renderer'; +// import * as import16 from '@angular/platform-browser/src/security/dom_sanitization_service'; +// import * as import17 from '@angular/core/src/linker/view_utils'; +// import * as import18 from '@angular/forms/src/form_builder'; +// import * as import19 from '@angular/forms/src/directives/radio_control_value_accessor'; +// import * as import20 from '@angular/core/src/di/injector'; +// import * as import21 from '@angular/core/src/application_tokens'; +// import * as import22 from '@angular/platform-browser/src/dom/events/dom_events'; +// import * as import23 from '@angular/platform-browser/src/dom/events/key_events'; +// import * as import24 from '@angular/core/src/zone/ng_zone'; +// import * as import25 from '@angular/platform-browser/src/dom/debug/ng_probe'; +// import * as import26 from '@angular/core/src/console'; +// import * as import27 from '@angular/core/src/i18n/tokens'; +// import * as import28 from '@angular/core/src/error_handler'; +// import * as import29 from '@angular/platform-browser/src/dom/dom_tokens'; +// import * as import30 from '@angular/platform-browser/src/dom/animation_driver'; +// import * as import31 from '@angular/core/src/render/api'; +// import * as import32 from '@angular/core/src/security'; +// import * as import33 from '@angular/core/src/change_detection/differs/iterable_differs'; +// import * as import34 from '@angular/core/src/change_detection/differs/keyvalue_differs'; +// import * as import35 from '@angular/core/src/i18n/tokens'; +// import * as import36 from '@angular/core/src/render/api'; +// import * as import37 from '@angular/core/src/linker/view'; +// import * as import38 from '@angular/core/src/linker/element'; +// import * as import39 from '@angular/core/src/linker/view_utils'; +// import * as import40 from '@angular/core/src/linker/view_type'; +// import * as import41 from '@angular/core/src/change_detection/change_detection'; +// import * as import42 from '@angular/core/src/metadata/view'; +// import * as import43 from '@angular/core/src/linker/component_factory'; +// import * as import44 from '@angular/forms/src/directives/reactive_directives/form_group_directive'; +// import * as import45 from '@angular/forms/src/directives/ng_control_status'; +// import * as import46 from '@angular/forms/src/directives/default_value_accessor'; +// import * as import47 from '@angular/forms/src/directives/reactive_directives/form_control_name'; +// import * as import48 from '@angular/core/src/linker/element_ref'; +// import * as import49 from '@angular/forms/src/directives/control_value_accessor'; +// import * as import50 from '@angular/forms/src/directives/ng_control'; +// import * as import51 from '@angular/forms/src/directives/control_container'; + +//stubbed out imports + +namespace import44 { + export class FormGroupDirective { + constructor(any){} + } +} + +namespace import45 { + export class NgControlStatus { + constructor(any){} + } + export class NgControlStatusGroup { + constructor(any){} + } +} + +namespace import46 { + export class DefaultValueAccessor { + constructor(any){} + } +} + +namespace import47 { + export class FormControlName { + constructor(any){} + } +} + +namespace import48 { + export class FormControlName { + constructor(any){} + } +} + + +//HERE BE DRAGONS + +//Using a value here - 65+ seconds to typecheck +namespace import49 { + //real code uses an opaque token, using new String() to simulate. + //export var NG_VALUE_ACCESSOR = new OpaqueToken('ngValueAccessor') + export var NG_VALUE_ACCESSOR = new String('foo') +} + +//using a class - < 1 sec typecheck +// namespace import49 { +// export class NG_VALUE_ACCESSOR { +// constructor(any){} +// } +// } + +//END DRAGONS + + +namespace import50 { + export class NgControl { + constructor(any){} + } +} + +namespace import51 { + export class ControlContainer { + constructor(any){} + } +} + + + +class _View_AppComponent0 { + _text_0:any; + _el_1:any; + _FormGroupDirective_1_3:import44.FormGroupDirective; + _ControlContainer_1_4:any; + _NgControlStatusGroup_1_5:import45.NgControlStatusGroup; + _text_2:any; + _el_3:any; + _DefaultValueAccessor_3_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_3_4:any[]; + _FormControlName_3_5:import47.FormControlName; + _NgControl_3_6:any; + _NgControlStatus_3_7:import45.NgControlStatus; + _el_4:any; + _text_5:any; + _el_6:any; + _DefaultValueAccessor_6_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_6_4:any[]; + _FormControlName_6_5:import47.FormControlName; + _NgControl_6_6:any; + _NgControlStatus_6_7:import45.NgControlStatus; + _el_7:any; + _text_8:any; + _el_9:any; + _DefaultValueAccessor_9_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_9_4:any[]; + _FormControlName_9_5:import47.FormControlName; + _NgControl_9_6:any; + _NgControlStatus_9_7:import45.NgControlStatus; + _el_10:any; + _text_11:any; + _el_12:any; + _DefaultValueAccessor_12_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_12_4:any[]; + _FormControlName_12_5:import47.FormControlName; + _NgControl_12_6:any; + _NgControlStatus_12_7:import45.NgControlStatus; + _el_13:any; + _text_14:any; + _el_15:any; + _DefaultValueAccessor_15_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_15_4:any[]; + _FormControlName_15_5:import47.FormControlName; + _NgControl_15_6:any; + _NgControlStatus_15_7:import45.NgControlStatus; + _el_16:any; + _text_17:any; + _el_18:any; + _DefaultValueAccessor_18_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_18_4:any[]; + _FormControlName_18_5:import47.FormControlName; + _NgControl_18_6:any; + _NgControlStatus_18_7:import45.NgControlStatus; + _el_19:any; + _text_20:any; + _el_21:any; + _DefaultValueAccessor_21_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_21_4:any[]; + _FormControlName_21_5:import47.FormControlName; + _NgControl_21_6:any; + _NgControlStatus_21_7:import45.NgControlStatus; + _el_22:any; + _text_23:any; + _el_24:any; + _DefaultValueAccessor_24_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_24_4:any[]; + _FormControlName_24_5:import47.FormControlName; + _NgControl_24_6:any; + _NgControlStatus_24_7:import45.NgControlStatus; + _el_25:any; + _text_26:any; + _el_27:any; + _DefaultValueAccessor_27_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_27_4:any[]; + _FormControlName_27_5:import47.FormControlName; + _NgControl_27_6:any; + _NgControlStatus_27_7:import45.NgControlStatus; + _el_28:any; + _text_29:any; + _el_30:any; + _DefaultValueAccessor_30_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_30_4:any[]; + _FormControlName_30_5:import47.FormControlName; + _NgControl_30_6:any; + _NgControlStatus_30_7:import45.NgControlStatus; + _el_31:any; + _text_32:any; + _el_33:any; + _DefaultValueAccessor_33_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_33_4:any[]; + _FormControlName_33_5:import47.FormControlName; + _NgControl_33_6:any; + _NgControlStatus_33_7:import45.NgControlStatus; + _el_34:any; + _text_35:any; + _el_36:any; + _DefaultValueAccessor_36_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_36_4:any[]; + _FormControlName_36_5:import47.FormControlName; + _NgControl_36_6:any; + _NgControlStatus_36_7:import45.NgControlStatus; + _el_37:any; + _text_38:any; + _el_39:any; + _DefaultValueAccessor_39_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_39_4:any[]; + _FormControlName_39_5:import47.FormControlName; + _NgControl_39_6:any; + _NgControlStatus_39_7:import45.NgControlStatus; + _el_40:any; + _text_41:any; + _el_42:any; + _DefaultValueAccessor_42_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_42_4:any[]; + _FormControlName_42_5:import47.FormControlName; + _NgControl_42_6:any; + _NgControlStatus_42_7:import45.NgControlStatus; + _el_43:any; + _text_44:any; + _el_45:any; + _DefaultValueAccessor_45_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_45_4:any[]; + _FormControlName_45_5:import47.FormControlName; + _NgControl_45_6:any; + _NgControlStatus_45_7:import45.NgControlStatus; + _el_46:any; + _text_47:any; + _el_48:any; + _DefaultValueAccessor_48_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_48_4:any[]; + _FormControlName_48_5:import47.FormControlName; + _NgControl_48_6:any; + _NgControlStatus_48_7:import45.NgControlStatus; + _el_49:any; + _text_50:any; + _el_51:any; + _DefaultValueAccessor_51_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_51_4:any[]; + _FormControlName_51_5:import47.FormControlName; + _NgControl_51_6:any; + _NgControlStatus_51_7:import45.NgControlStatus; + _el_52:any; + _text_53:any; + _el_54:any; + _DefaultValueAccessor_54_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_54_4:any[]; + _FormControlName_54_5:import47.FormControlName; + _NgControl_54_6:any; + _NgControlStatus_54_7:import45.NgControlStatus; + _el_55:any; + _text_56:any; + _el_57:any; + _DefaultValueAccessor_57_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_57_4:any[]; + _FormControlName_57_5:import47.FormControlName; + _NgControl_57_6:any; + _NgControlStatus_57_7:import45.NgControlStatus; + _el_58:any; + _text_59:any; + _el_60:any; + _DefaultValueAccessor_60_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_60_4:any[]; + _FormControlName_60_5:import47.FormControlName; + _NgControl_60_6:any; + _NgControlStatus_60_7:import45.NgControlStatus; + _el_61:any; + _text_62:any; + _text_63:any; + /*private*/ _expr_2:any; + /*private*/ _expr_3:any; + /*private*/ _expr_4:any; + /*private*/ _expr_5:any; + /*private*/ _expr_6:any; + /*private*/ _expr_7:any; + /*private*/ _expr_8:any; + /*private*/ _expr_11:any; + /*private*/ _expr_12:any; + /*private*/ _expr_13:any; + /*private*/ _expr_14:any; + /*private*/ _expr_15:any; + /*private*/ _expr_16:any; + /*private*/ _expr_17:any; + /*private*/ _expr_20:any; + /*private*/ _expr_21:any; + /*private*/ _expr_22:any; + /*private*/ _expr_23:any; + /*private*/ _expr_24:any; + /*private*/ _expr_25:any; + /*private*/ _expr_26:any; + /*private*/ _expr_29:any; + /*private*/ _expr_30:any; + /*private*/ _expr_31:any; + /*private*/ _expr_32:any; + /*private*/ _expr_33:any; + /*private*/ _expr_34:any; + /*private*/ _expr_35:any; + /*private*/ _expr_38:any; + /*private*/ _expr_39:any; + /*private*/ _expr_40:any; + /*private*/ _expr_41:any; + /*private*/ _expr_42:any; + /*private*/ _expr_43:any; + /*private*/ _expr_44:any; + /*private*/ _expr_47:any; + /*private*/ _expr_48:any; + /*private*/ _expr_49:any; + /*private*/ _expr_50:any; + /*private*/ _expr_51:any; + /*private*/ _expr_52:any; + /*private*/ _expr_53:any; + /*private*/ _expr_56:any; + /*private*/ _expr_57:any; + /*private*/ _expr_58:any; + /*private*/ _expr_59:any; + /*private*/ _expr_60:any; + /*private*/ _expr_61:any; + /*private*/ _expr_62:any; + /*private*/ _expr_65:any; + /*private*/ _expr_66:any; + /*private*/ _expr_67:any; + /*private*/ _expr_68:any; + /*private*/ _expr_69:any; + /*private*/ _expr_70:any; + /*private*/ _expr_71:any; + /*private*/ _expr_74:any; + /*private*/ _expr_75:any; + /*private*/ _expr_76:any; + /*private*/ _expr_77:any; + /*private*/ _expr_78:any; + /*private*/ _expr_79:any; + /*private*/ _expr_80:any; + /*private*/ _expr_83:any; + /*private*/ _expr_84:any; + /*private*/ _expr_85:any; + /*private*/ _expr_86:any; + /*private*/ _expr_87:any; + /*private*/ _expr_88:any; + /*private*/ _expr_89:any; + /*private*/ _expr_92:any; + /*private*/ _expr_93:any; + /*private*/ _expr_94:any; + /*private*/ _expr_95:any; + /*private*/ _expr_96:any; + /*private*/ _expr_97:any; + /*private*/ _expr_98:any; + /*private*/ _expr_101:any; + /*private*/ _expr_102:any; + /*private*/ _expr_103:any; + /*private*/ _expr_104:any; + /*private*/ _expr_105:any; + /*private*/ _expr_106:any; + /*private*/ _expr_107:any; + /*private*/ _expr_110:any; + /*private*/ _expr_111:any; + /*private*/ _expr_112:any; + /*private*/ _expr_113:any; + /*private*/ _expr_114:any; + /*private*/ _expr_115:any; + /*private*/ _expr_116:any; + /*private*/ _expr_119:any; + /*private*/ _expr_120:any; + /*private*/ _expr_121:any; + /*private*/ _expr_122:any; + /*private*/ _expr_123:any; + /*private*/ _expr_124:any; + /*private*/ _expr_125:any; + /*private*/ _expr_128:any; + /*private*/ _expr_129:any; + /*private*/ _expr_130:any; + /*private*/ _expr_131:any; + /*private*/ _expr_132:any; + /*private*/ _expr_133:any; + /*private*/ _expr_134:any; + /*private*/ _expr_137:any; + /*private*/ _expr_138:any; + /*private*/ _expr_139:any; + /*private*/ _expr_140:any; + /*private*/ _expr_141:any; + /*private*/ _expr_142:any; + /*private*/ _expr_143:any; + /*private*/ _expr_146:any; + /*private*/ _expr_147:any; + /*private*/ _expr_148:any; + /*private*/ _expr_149:any; + /*private*/ _expr_150:any; + /*private*/ _expr_151:any; + /*private*/ _expr_152:any; + /*private*/ _expr_155:any; + /*private*/ _expr_156:any; + /*private*/ _expr_157:any; + /*private*/ _expr_158:any; + /*private*/ _expr_159:any; + /*private*/ _expr_160:any; + /*private*/ _expr_161:any; + /*private*/ _expr_164:any; + /*private*/ _expr_165:any; + /*private*/ _expr_166:any; + /*private*/ _expr_167:any; + /*private*/ _expr_168:any; + /*private*/ _expr_169:any; + /*private*/ _expr_170:any; + /*private*/ _expr_173:any; + /*private*/ _expr_174:any; + /*private*/ _expr_175:any; + /*private*/ _expr_176:any; + /*private*/ _expr_177:any; + /*private*/ _expr_178:any; + /*private*/ _expr_179:any; + /*private*/ _expr_182:any; + /*private*/ _expr_183:any; + /*private*/ _expr_184:any; + /*private*/ _expr_185:any; + /*private*/ _expr_186:any; + /*private*/ _expr_187:any; + /*private*/ _expr_188:any; + constructor(viewUtils:any,parentInjector:any,declarationEl:any) { + } + + injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { + if (((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex))) { return this._DefaultValueAccessor_3_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_3_4; } + if (((token === import47.FormControlName) && (3 === requestNodeIndex))) { return this._FormControlName_3_5; } + if (((token === import50.NgControl) && (3 === requestNodeIndex))) { return this._NgControl_3_6; } + if (((token === import45.NgControlStatus) && (3 === requestNodeIndex))) { return this._NgControlStatus_3_7; } + if (((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex))) { return this._DefaultValueAccessor_6_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_6_4; } + if (((token === import47.FormControlName) && (6 === requestNodeIndex))) { return this._FormControlName_6_5; } + if (((token === import50.NgControl) && (6 === requestNodeIndex))) { return this._NgControl_6_6; } + if (((token === import45.NgControlStatus) && (6 === requestNodeIndex))) { return this._NgControlStatus_6_7; } + if (((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex))) { return this._DefaultValueAccessor_9_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_9_4; } + if (((token === import47.FormControlName) && (9 === requestNodeIndex))) { return this._FormControlName_9_5; } + if (((token === import50.NgControl) && (9 === requestNodeIndex))) { return this._NgControl_9_6; } + if (((token === import45.NgControlStatus) && (9 === requestNodeIndex))) { return this._NgControlStatus_9_7; } + if (((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex))) { return this._DefaultValueAccessor_12_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_12_4; } + if (((token === import47.FormControlName) && (12 === requestNodeIndex))) { return this._FormControlName_12_5; } + if (((token === import50.NgControl) && (12 === requestNodeIndex))) { return this._NgControl_12_6; } + if (((token === import45.NgControlStatus) && (12 === requestNodeIndex))) { return this._NgControlStatus_12_7; } + if (((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex))) { return this._DefaultValueAccessor_15_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_15_4; } + if (((token === import47.FormControlName) && (15 === requestNodeIndex))) { return this._FormControlName_15_5; } + if (((token === import50.NgControl) && (15 === requestNodeIndex))) { return this._NgControl_15_6; } + if (((token === import45.NgControlStatus) && (15 === requestNodeIndex))) { return this._NgControlStatus_15_7; } + if (((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex))) { return this._DefaultValueAccessor_18_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_18_4; } + if (((token === import47.FormControlName) && (18 === requestNodeIndex))) { return this._FormControlName_18_5; } + if (((token === import50.NgControl) && (18 === requestNodeIndex))) { return this._NgControl_18_6; } + if (((token === import45.NgControlStatus) && (18 === requestNodeIndex))) { return this._NgControlStatus_18_7; } + if (((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex))) { return this._DefaultValueAccessor_21_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_21_4; } + if (((token === import47.FormControlName) && (21 === requestNodeIndex))) { return this._FormControlName_21_5; } + if (((token === import50.NgControl) && (21 === requestNodeIndex))) { return this._NgControl_21_6; } + if (((token === import45.NgControlStatus) && (21 === requestNodeIndex))) { return this._NgControlStatus_21_7; } + if (((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex))) { return this._DefaultValueAccessor_24_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_24_4; } + if (((token === import47.FormControlName) && (24 === requestNodeIndex))) { return this._FormControlName_24_5; } + if (((token === import50.NgControl) && (24 === requestNodeIndex))) { return this._NgControl_24_6; } + if (((token === import45.NgControlStatus) && (24 === requestNodeIndex))) { return this._NgControlStatus_24_7; } + if (((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex))) { return this._DefaultValueAccessor_27_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_27_4; } + if (((token === import47.FormControlName) && (27 === requestNodeIndex))) { return this._FormControlName_27_5; } + if (((token === import50.NgControl) && (27 === requestNodeIndex))) { return this._NgControl_27_6; } + if (((token === import45.NgControlStatus) && (27 === requestNodeIndex))) { return this._NgControlStatus_27_7; } + if (((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex))) { return this._DefaultValueAccessor_30_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_30_4; } + if (((token === import47.FormControlName) && (30 === requestNodeIndex))) { return this._FormControlName_30_5; } + if (((token === import50.NgControl) && (30 === requestNodeIndex))) { return this._NgControl_30_6; } + if (((token === import45.NgControlStatus) && (30 === requestNodeIndex))) { return this._NgControlStatus_30_7; } + if (((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex))) { return this._DefaultValueAccessor_33_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_33_4; } + if (((token === import47.FormControlName) && (33 === requestNodeIndex))) { return this._FormControlName_33_5; } + if (((token === import50.NgControl) && (33 === requestNodeIndex))) { return this._NgControl_33_6; } + if (((token === import45.NgControlStatus) && (33 === requestNodeIndex))) { return this._NgControlStatus_33_7; } + if (((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex))) { return this._DefaultValueAccessor_36_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_36_4; } + if (((token === import47.FormControlName) && (36 === requestNodeIndex))) { return this._FormControlName_36_5; } + if (((token === import50.NgControl) && (36 === requestNodeIndex))) { return this._NgControl_36_6; } + if (((token === import45.NgControlStatus) && (36 === requestNodeIndex))) { return this._NgControlStatus_36_7; } + if (((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex))) { return this._DefaultValueAccessor_39_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_39_4; } + if (((token === import47.FormControlName) && (39 === requestNodeIndex))) { return this._FormControlName_39_5; } + if (((token === import50.NgControl) && (39 === requestNodeIndex))) { return this._NgControl_39_6; } + if (((token === import45.NgControlStatus) && (39 === requestNodeIndex))) { return this._NgControlStatus_39_7; } + if (((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex))) { return this._DefaultValueAccessor_42_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_42_4; } + if (((token === import47.FormControlName) && (42 === requestNodeIndex))) { return this._FormControlName_42_5; } + if (((token === import50.NgControl) && (42 === requestNodeIndex))) { return this._NgControl_42_6; } + if (((token === import45.NgControlStatus) && (42 === requestNodeIndex))) { return this._NgControlStatus_42_7; } + if (((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex))) { return this._DefaultValueAccessor_45_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_45_4; } + if (((token === import47.FormControlName) && (45 === requestNodeIndex))) { return this._FormControlName_45_5; } + if (((token === import50.NgControl) && (45 === requestNodeIndex))) { return this._NgControl_45_6; } + if (((token === import45.NgControlStatus) && (45 === requestNodeIndex))) { return this._NgControlStatus_45_7; } + if (((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex))) { return this._DefaultValueAccessor_48_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_48_4; } + if (((token === import47.FormControlName) && (48 === requestNodeIndex))) { return this._FormControlName_48_5; } + if (((token === import50.NgControl) && (48 === requestNodeIndex))) { return this._NgControl_48_6; } + if (((token === import45.NgControlStatus) && (48 === requestNodeIndex))) { return this._NgControlStatus_48_7; } + if (((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex))) { return this._DefaultValueAccessor_51_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_51_4; } + if (((token === import47.FormControlName) && (51 === requestNodeIndex))) { return this._FormControlName_51_5; } + if (((token === import50.NgControl) && (51 === requestNodeIndex))) { return this._NgControl_51_6; } + if (((token === import45.NgControlStatus) && (51 === requestNodeIndex))) { return this._NgControlStatus_51_7; } + if (((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex))) { return this._DefaultValueAccessor_54_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_54_4; } + if (((token === import47.FormControlName) && (54 === requestNodeIndex))) { return this._FormControlName_54_5; } + if (((token === import50.NgControl) && (54 === requestNodeIndex))) { return this._NgControl_54_6; } + if (((token === import45.NgControlStatus) && (54 === requestNodeIndex))) { return this._NgControlStatus_54_7; } + if (((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex))) { return this._DefaultValueAccessor_57_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_57_4; } + if (((token === import47.FormControlName) && (57 === requestNodeIndex))) { return this._FormControlName_57_5; } + if (((token === import50.NgControl) && (57 === requestNodeIndex))) { return this._NgControl_57_6; } + if (((token === import45.NgControlStatus) && (57 === requestNodeIndex))) { return this._NgControlStatus_57_7; } + if (((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex))) { return this._DefaultValueAccessor_60_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_60_4; } + if (((token === import47.FormControlName) && (60 === requestNodeIndex))) { return this._FormControlName_60_5; } + if (((token === import50.NgControl) && (60 === requestNodeIndex))) { return this._NgControl_60_6; } + if (((token === import45.NgControlStatus) && (60 === requestNodeIndex))) { return this._NgControlStatus_60_7; } + if (((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._FormGroupDirective_1_3; } + if (((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._ControlContainer_1_4; } + if (((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._NgControlStatusGroup_1_5; } + return notFoundResult; + } +} +export function viewFactory_AppComponent0(viewUtils:any,parentInjector:any,declarationEl:any):any { + return new _View_AppComponent0(viewUtils,parentInjector,declarationEl); +} + + +//// [complexNarrowingWithAny.js] +// Repro from #10869 +"use strict"; +/** + * This file is generated by the Angular 2 template compiler. + * Do not edit. + */ +/* tslint:disable */ +// import * as import0 from '@angular/core/src/linker/ng_module_factory'; +// import * as import1 from '../../app'; +// import * as import2 from '@angular/common/src/common_module'; +// import * as import3 from '@angular/core/src/application_module'; +// import * as import4 from '@angular/platform-browser/src/browser'; +// import * as import5 from '@angular/forms/src/directives'; +// import * as import6 from '@angular/forms/src/form_providers'; +// import * as import7 from '@angular/common/src/localization'; +// import * as import8 from '@angular/core/src/application_init'; +// import * as import9 from '@angular/core/src/testability/testability'; +// import * as import10 from '@angular/core/src/application_ref'; +// import * as import11 from '@angular/core/src/linker/compiler'; +// import * as import12 from '@angular/platform-browser/src/dom/events/hammer_gestures'; +// import * as import13 from '@angular/platform-browser/src/dom/events/event_manager'; +// import * as import14 from '@angular/platform-browser/src/dom/shared_styles_host'; +// import * as import15 from '@angular/platform-browser/src/dom/dom_renderer'; +// import * as import16 from '@angular/platform-browser/src/security/dom_sanitization_service'; +// import * as import17 from '@angular/core/src/linker/view_utils'; +// import * as import18 from '@angular/forms/src/form_builder'; +// import * as import19 from '@angular/forms/src/directives/radio_control_value_accessor'; +// import * as import20 from '@angular/core/src/di/injector'; +// import * as import21 from '@angular/core/src/application_tokens'; +// import * as import22 from '@angular/platform-browser/src/dom/events/dom_events'; +// import * as import23 from '@angular/platform-browser/src/dom/events/key_events'; +// import * as import24 from '@angular/core/src/zone/ng_zone'; +// import * as import25 from '@angular/platform-browser/src/dom/debug/ng_probe'; +// import * as import26 from '@angular/core/src/console'; +// import * as import27 from '@angular/core/src/i18n/tokens'; +// import * as import28 from '@angular/core/src/error_handler'; +// import * as import29 from '@angular/platform-browser/src/dom/dom_tokens'; +// import * as import30 from '@angular/platform-browser/src/dom/animation_driver'; +// import * as import31 from '@angular/core/src/render/api'; +// import * as import32 from '@angular/core/src/security'; +// import * as import33 from '@angular/core/src/change_detection/differs/iterable_differs'; +// import * as import34 from '@angular/core/src/change_detection/differs/keyvalue_differs'; +// import * as import35 from '@angular/core/src/i18n/tokens'; +// import * as import36 from '@angular/core/src/render/api'; +// import * as import37 from '@angular/core/src/linker/view'; +// import * as import38 from '@angular/core/src/linker/element'; +// import * as import39 from '@angular/core/src/linker/view_utils'; +// import * as import40 from '@angular/core/src/linker/view_type'; +// import * as import41 from '@angular/core/src/change_detection/change_detection'; +// import * as import42 from '@angular/core/src/metadata/view'; +// import * as import43 from '@angular/core/src/linker/component_factory'; +// import * as import44 from '@angular/forms/src/directives/reactive_directives/form_group_directive'; +// import * as import45 from '@angular/forms/src/directives/ng_control_status'; +// import * as import46 from '@angular/forms/src/directives/default_value_accessor'; +// import * as import47 from '@angular/forms/src/directives/reactive_directives/form_control_name'; +// import * as import48 from '@angular/core/src/linker/element_ref'; +// import * as import49 from '@angular/forms/src/directives/control_value_accessor'; +// import * as import50 from '@angular/forms/src/directives/ng_control'; +// import * as import51 from '@angular/forms/src/directives/control_container'; +//stubbed out imports +var import44; +(function (import44) { + var FormGroupDirective = (function () { + function FormGroupDirective(any) { + } + return FormGroupDirective; + }()); + import44.FormGroupDirective = FormGroupDirective; +})(import44 || (import44 = {})); +var import45; +(function (import45) { + var NgControlStatus = (function () { + function NgControlStatus(any) { + } + return NgControlStatus; + }()); + import45.NgControlStatus = NgControlStatus; + var NgControlStatusGroup = (function () { + function NgControlStatusGroup(any) { + } + return NgControlStatusGroup; + }()); + import45.NgControlStatusGroup = NgControlStatusGroup; +})(import45 || (import45 = {})); +var import46; +(function (import46) { + var DefaultValueAccessor = (function () { + function DefaultValueAccessor(any) { + } + return DefaultValueAccessor; + }()); + import46.DefaultValueAccessor = DefaultValueAccessor; +})(import46 || (import46 = {})); +var import47; +(function (import47) { + var FormControlName = (function () { + function FormControlName(any) { + } + return FormControlName; + }()); + import47.FormControlName = FormControlName; +})(import47 || (import47 = {})); +var import48; +(function (import48) { + var FormControlName = (function () { + function FormControlName(any) { + } + return FormControlName; + }()); + import48.FormControlName = FormControlName; +})(import48 || (import48 = {})); +//HERE BE DRAGONS +//Using a value here - 65+ seconds to typecheck +var import49; +(function (import49) { + //real code uses an opaque token, using new String() to simulate. + //export var NG_VALUE_ACCESSOR = new OpaqueToken('ngValueAccessor') + import49.NG_VALUE_ACCESSOR = new String('foo'); +})(import49 || (import49 = {})); +//using a class - < 1 sec typecheck +// namespace import49 { +// export class NG_VALUE_ACCESSOR { +// constructor(any){} +// } +// } +//END DRAGONS +var import50; +(function (import50) { + var NgControl = (function () { + function NgControl(any) { + } + return NgControl; + }()); + import50.NgControl = NgControl; +})(import50 || (import50 = {})); +var import51; +(function (import51) { + var ControlContainer = (function () { + function ControlContainer(any) { + } + return ControlContainer; + }()); + import51.ControlContainer = ControlContainer; +})(import51 || (import51 = {})); +var _View_AppComponent0 = (function () { + function _View_AppComponent0(viewUtils, parentInjector, declarationEl) { + } + _View_AppComponent0.prototype.injectorGetInternal = function (token, requestNodeIndex, notFoundResult) { + if (((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex))) { + return this._DefaultValueAccessor_3_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_3_4; + } + if (((token === import47.FormControlName) && (3 === requestNodeIndex))) { + return this._FormControlName_3_5; + } + if (((token === import50.NgControl) && (3 === requestNodeIndex))) { + return this._NgControl_3_6; + } + if (((token === import45.NgControlStatus) && (3 === requestNodeIndex))) { + return this._NgControlStatus_3_7; + } + if (((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex))) { + return this._DefaultValueAccessor_6_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_6_4; + } + if (((token === import47.FormControlName) && (6 === requestNodeIndex))) { + return this._FormControlName_6_5; + } + if (((token === import50.NgControl) && (6 === requestNodeIndex))) { + return this._NgControl_6_6; + } + if (((token === import45.NgControlStatus) && (6 === requestNodeIndex))) { + return this._NgControlStatus_6_7; + } + if (((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex))) { + return this._DefaultValueAccessor_9_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_9_4; + } + if (((token === import47.FormControlName) && (9 === requestNodeIndex))) { + return this._FormControlName_9_5; + } + if (((token === import50.NgControl) && (9 === requestNodeIndex))) { + return this._NgControl_9_6; + } + if (((token === import45.NgControlStatus) && (9 === requestNodeIndex))) { + return this._NgControlStatus_9_7; + } + if (((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex))) { + return this._DefaultValueAccessor_12_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_12_4; + } + if (((token === import47.FormControlName) && (12 === requestNodeIndex))) { + return this._FormControlName_12_5; + } + if (((token === import50.NgControl) && (12 === requestNodeIndex))) { + return this._NgControl_12_6; + } + if (((token === import45.NgControlStatus) && (12 === requestNodeIndex))) { + return this._NgControlStatus_12_7; + } + if (((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex))) { + return this._DefaultValueAccessor_15_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_15_4; + } + if (((token === import47.FormControlName) && (15 === requestNodeIndex))) { + return this._FormControlName_15_5; + } + if (((token === import50.NgControl) && (15 === requestNodeIndex))) { + return this._NgControl_15_6; + } + if (((token === import45.NgControlStatus) && (15 === requestNodeIndex))) { + return this._NgControlStatus_15_7; + } + if (((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex))) { + return this._DefaultValueAccessor_18_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_18_4; + } + if (((token === import47.FormControlName) && (18 === requestNodeIndex))) { + return this._FormControlName_18_5; + } + if (((token === import50.NgControl) && (18 === requestNodeIndex))) { + return this._NgControl_18_6; + } + if (((token === import45.NgControlStatus) && (18 === requestNodeIndex))) { + return this._NgControlStatus_18_7; + } + if (((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex))) { + return this._DefaultValueAccessor_21_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_21_4; + } + if (((token === import47.FormControlName) && (21 === requestNodeIndex))) { + return this._FormControlName_21_5; + } + if (((token === import50.NgControl) && (21 === requestNodeIndex))) { + return this._NgControl_21_6; + } + if (((token === import45.NgControlStatus) && (21 === requestNodeIndex))) { + return this._NgControlStatus_21_7; + } + if (((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex))) { + return this._DefaultValueAccessor_24_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_24_4; + } + if (((token === import47.FormControlName) && (24 === requestNodeIndex))) { + return this._FormControlName_24_5; + } + if (((token === import50.NgControl) && (24 === requestNodeIndex))) { + return this._NgControl_24_6; + } + if (((token === import45.NgControlStatus) && (24 === requestNodeIndex))) { + return this._NgControlStatus_24_7; + } + if (((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex))) { + return this._DefaultValueAccessor_27_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_27_4; + } + if (((token === import47.FormControlName) && (27 === requestNodeIndex))) { + return this._FormControlName_27_5; + } + if (((token === import50.NgControl) && (27 === requestNodeIndex))) { + return this._NgControl_27_6; + } + if (((token === import45.NgControlStatus) && (27 === requestNodeIndex))) { + return this._NgControlStatus_27_7; + } + if (((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex))) { + return this._DefaultValueAccessor_30_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_30_4; + } + if (((token === import47.FormControlName) && (30 === requestNodeIndex))) { + return this._FormControlName_30_5; + } + if (((token === import50.NgControl) && (30 === requestNodeIndex))) { + return this._NgControl_30_6; + } + if (((token === import45.NgControlStatus) && (30 === requestNodeIndex))) { + return this._NgControlStatus_30_7; + } + if (((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex))) { + return this._DefaultValueAccessor_33_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_33_4; + } + if (((token === import47.FormControlName) && (33 === requestNodeIndex))) { + return this._FormControlName_33_5; + } + if (((token === import50.NgControl) && (33 === requestNodeIndex))) { + return this._NgControl_33_6; + } + if (((token === import45.NgControlStatus) && (33 === requestNodeIndex))) { + return this._NgControlStatus_33_7; + } + if (((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex))) { + return this._DefaultValueAccessor_36_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_36_4; + } + if (((token === import47.FormControlName) && (36 === requestNodeIndex))) { + return this._FormControlName_36_5; + } + if (((token === import50.NgControl) && (36 === requestNodeIndex))) { + return this._NgControl_36_6; + } + if (((token === import45.NgControlStatus) && (36 === requestNodeIndex))) { + return this._NgControlStatus_36_7; + } + if (((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex))) { + return this._DefaultValueAccessor_39_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_39_4; + } + if (((token === import47.FormControlName) && (39 === requestNodeIndex))) { + return this._FormControlName_39_5; + } + if (((token === import50.NgControl) && (39 === requestNodeIndex))) { + return this._NgControl_39_6; + } + if (((token === import45.NgControlStatus) && (39 === requestNodeIndex))) { + return this._NgControlStatus_39_7; + } + if (((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex))) { + return this._DefaultValueAccessor_42_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_42_4; + } + if (((token === import47.FormControlName) && (42 === requestNodeIndex))) { + return this._FormControlName_42_5; + } + if (((token === import50.NgControl) && (42 === requestNodeIndex))) { + return this._NgControl_42_6; + } + if (((token === import45.NgControlStatus) && (42 === requestNodeIndex))) { + return this._NgControlStatus_42_7; + } + if (((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex))) { + return this._DefaultValueAccessor_45_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_45_4; + } + if (((token === import47.FormControlName) && (45 === requestNodeIndex))) { + return this._FormControlName_45_5; + } + if (((token === import50.NgControl) && (45 === requestNodeIndex))) { + return this._NgControl_45_6; + } + if (((token === import45.NgControlStatus) && (45 === requestNodeIndex))) { + return this._NgControlStatus_45_7; + } + if (((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex))) { + return this._DefaultValueAccessor_48_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_48_4; + } + if (((token === import47.FormControlName) && (48 === requestNodeIndex))) { + return this._FormControlName_48_5; + } + if (((token === import50.NgControl) && (48 === requestNodeIndex))) { + return this._NgControl_48_6; + } + if (((token === import45.NgControlStatus) && (48 === requestNodeIndex))) { + return this._NgControlStatus_48_7; + } + if (((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex))) { + return this._DefaultValueAccessor_51_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_51_4; + } + if (((token === import47.FormControlName) && (51 === requestNodeIndex))) { + return this._FormControlName_51_5; + } + if (((token === import50.NgControl) && (51 === requestNodeIndex))) { + return this._NgControl_51_6; + } + if (((token === import45.NgControlStatus) && (51 === requestNodeIndex))) { + return this._NgControlStatus_51_7; + } + if (((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex))) { + return this._DefaultValueAccessor_54_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_54_4; + } + if (((token === import47.FormControlName) && (54 === requestNodeIndex))) { + return this._FormControlName_54_5; + } + if (((token === import50.NgControl) && (54 === requestNodeIndex))) { + return this._NgControl_54_6; + } + if (((token === import45.NgControlStatus) && (54 === requestNodeIndex))) { + return this._NgControlStatus_54_7; + } + if (((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex))) { + return this._DefaultValueAccessor_57_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_57_4; + } + if (((token === import47.FormControlName) && (57 === requestNodeIndex))) { + return this._FormControlName_57_5; + } + if (((token === import50.NgControl) && (57 === requestNodeIndex))) { + return this._NgControl_57_6; + } + if (((token === import45.NgControlStatus) && (57 === requestNodeIndex))) { + return this._NgControlStatus_57_7; + } + if (((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex))) { + return this._DefaultValueAccessor_60_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_60_4; + } + if (((token === import47.FormControlName) && (60 === requestNodeIndex))) { + return this._FormControlName_60_5; + } + if (((token === import50.NgControl) && (60 === requestNodeIndex))) { + return this._NgControl_60_6; + } + if (((token === import45.NgControlStatus) && (60 === requestNodeIndex))) { + return this._NgControlStatus_60_7; + } + if (((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { + return this._FormGroupDirective_1_3; + } + if (((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { + return this._ControlContainer_1_4; + } + if (((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { + return this._NgControlStatusGroup_1_5; + } + return notFoundResult; + }; + return _View_AppComponent0; +}()); +function viewFactory_AppComponent0(viewUtils, parentInjector, declarationEl) { + return new _View_AppComponent0(viewUtils, parentInjector, declarationEl); +} +exports.viewFactory_AppComponent0 = viewFactory_AppComponent0; diff --git a/tests/baselines/reference/complexNarrowingWithAny.symbols b/tests/baselines/reference/complexNarrowingWithAny.symbols new file mode 100644 index 00000000000..d286502479c --- /dev/null +++ b/tests/baselines/reference/complexNarrowingWithAny.symbols @@ -0,0 +1,2304 @@ +=== tests/cases/compiler/complexNarrowingWithAny.ts === +// Repro from #10869 + +/** + * This file is generated by the Angular 2 template compiler. + * Do not edit. + */ + /* tslint:disable */ + +// import * as import0 from '@angular/core/src/linker/ng_module_factory'; +// import * as import1 from '../../app'; +// import * as import2 from '@angular/common/src/common_module'; +// import * as import3 from '@angular/core/src/application_module'; +// import * as import4 from '@angular/platform-browser/src/browser'; +// import * as import5 from '@angular/forms/src/directives'; +// import * as import6 from '@angular/forms/src/form_providers'; +// import * as import7 from '@angular/common/src/localization'; +// import * as import8 from '@angular/core/src/application_init'; +// import * as import9 from '@angular/core/src/testability/testability'; +// import * as import10 from '@angular/core/src/application_ref'; +// import * as import11 from '@angular/core/src/linker/compiler'; +// import * as import12 from '@angular/platform-browser/src/dom/events/hammer_gestures'; +// import * as import13 from '@angular/platform-browser/src/dom/events/event_manager'; +// import * as import14 from '@angular/platform-browser/src/dom/shared_styles_host'; +// import * as import15 from '@angular/platform-browser/src/dom/dom_renderer'; +// import * as import16 from '@angular/platform-browser/src/security/dom_sanitization_service'; +// import * as import17 from '@angular/core/src/linker/view_utils'; +// import * as import18 from '@angular/forms/src/form_builder'; +// import * as import19 from '@angular/forms/src/directives/radio_control_value_accessor'; +// import * as import20 from '@angular/core/src/di/injector'; +// import * as import21 from '@angular/core/src/application_tokens'; +// import * as import22 from '@angular/platform-browser/src/dom/events/dom_events'; +// import * as import23 from '@angular/platform-browser/src/dom/events/key_events'; +// import * as import24 from '@angular/core/src/zone/ng_zone'; +// import * as import25 from '@angular/platform-browser/src/dom/debug/ng_probe'; +// import * as import26 from '@angular/core/src/console'; +// import * as import27 from '@angular/core/src/i18n/tokens'; +// import * as import28 from '@angular/core/src/error_handler'; +// import * as import29 from '@angular/platform-browser/src/dom/dom_tokens'; +// import * as import30 from '@angular/platform-browser/src/dom/animation_driver'; +// import * as import31 from '@angular/core/src/render/api'; +// import * as import32 from '@angular/core/src/security'; +// import * as import33 from '@angular/core/src/change_detection/differs/iterable_differs'; +// import * as import34 from '@angular/core/src/change_detection/differs/keyvalue_differs'; +// import * as import35 from '@angular/core/src/i18n/tokens'; +// import * as import36 from '@angular/core/src/render/api'; +// import * as import37 from '@angular/core/src/linker/view'; +// import * as import38 from '@angular/core/src/linker/element'; +// import * as import39 from '@angular/core/src/linker/view_utils'; +// import * as import40 from '@angular/core/src/linker/view_type'; +// import * as import41 from '@angular/core/src/change_detection/change_detection'; +// import * as import42 from '@angular/core/src/metadata/view'; +// import * as import43 from '@angular/core/src/linker/component_factory'; +// import * as import44 from '@angular/forms/src/directives/reactive_directives/form_group_directive'; +// import * as import45 from '@angular/forms/src/directives/ng_control_status'; +// import * as import46 from '@angular/forms/src/directives/default_value_accessor'; +// import * as import47 from '@angular/forms/src/directives/reactive_directives/form_control_name'; +// import * as import48 from '@angular/core/src/linker/element_ref'; +// import * as import49 from '@angular/forms/src/directives/control_value_accessor'; +// import * as import50 from '@angular/forms/src/directives/ng_control'; +// import * as import51 from '@angular/forms/src/directives/control_container'; + +//stubbed out imports + +namespace import44 { +>import44 : Symbol(import44, Decl(complexNarrowingWithAny.ts, 0, 0)) + + export class FormGroupDirective { +>FormGroupDirective : Symbol(FormGroupDirective, Decl(complexNarrowingWithAny.ts, 63, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 65, 14)) + } +} + +namespace import45 { +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) + + export class NgControlStatus { +>NgControlStatus : Symbol(NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 71, 14)) + } + export class NgControlStatusGroup { +>NgControlStatusGroup : Symbol(NgControlStatusGroup, Decl(complexNarrowingWithAny.ts, 72, 2)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 74, 14)) + } +} + +namespace import46 { +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) + + export class DefaultValueAccessor { +>DefaultValueAccessor : Symbol(DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 80, 14)) + } +} + +namespace import47 { +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) + + export class FormControlName { +>FormControlName : Symbol(FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 86, 14)) + } +} + +namespace import48 { +>import48 : Symbol(import48, Decl(complexNarrowingWithAny.ts, 88, 1)) + + export class FormControlName { +>FormControlName : Symbol(FormControlName, Decl(complexNarrowingWithAny.ts, 90, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 92, 14)) + } +} + + +//HERE BE DRAGONS + +//Using a value here - 65+ seconds to typecheck +namespace import49 { +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) + + //real code uses an opaque token, using new String() to simulate. + //export var NG_VALUE_ACCESSOR = new OpaqueToken('ngValueAccessor') + export var NG_VALUE_ACCESSOR = new String('foo') +>NG_VALUE_ACCESSOR : Symbol(NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +} + +//using a class - < 1 sec typecheck +// namespace import49 { +// export class NG_VALUE_ACCESSOR { +// constructor(any){} +// } +// } + +//END DRAGONS + + +namespace import50 { +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) + + export class NgControl { +>NgControl : Symbol(NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 118, 14)) + } +} + +namespace import51 { +>import51 : Symbol(import51, Decl(complexNarrowingWithAny.ts, 120, 1)) + + export class ControlContainer { +>ControlContainer : Symbol(ControlContainer, Decl(complexNarrowingWithAny.ts, 122, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 124, 14)) + } +} + + + +class _View_AppComponent0 { +>_View_AppComponent0 : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) + + _text_0:any; +>_text_0 : Symbol(_View_AppComponent0._text_0, Decl(complexNarrowingWithAny.ts, 130, 27)) + + _el_1:any; +>_el_1 : Symbol(_View_AppComponent0._el_1, Decl(complexNarrowingWithAny.ts, 131, 14)) + + _FormGroupDirective_1_3:import44.FormGroupDirective; +>_FormGroupDirective_1_3 : Symbol(_View_AppComponent0._FormGroupDirective_1_3, Decl(complexNarrowingWithAny.ts, 132, 12)) +>import44 : Symbol(import44, Decl(complexNarrowingWithAny.ts, 0, 0)) +>FormGroupDirective : Symbol(import44.FormGroupDirective, Decl(complexNarrowingWithAny.ts, 63, 20)) + + _ControlContainer_1_4:any; +>_ControlContainer_1_4 : Symbol(_View_AppComponent0._ControlContainer_1_4, Decl(complexNarrowingWithAny.ts, 133, 54)) + + _NgControlStatusGroup_1_5:import45.NgControlStatusGroup; +>_NgControlStatusGroup_1_5 : Symbol(_View_AppComponent0._NgControlStatusGroup_1_5, Decl(complexNarrowingWithAny.ts, 134, 28)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatusGroup : Symbol(import45.NgControlStatusGroup, Decl(complexNarrowingWithAny.ts, 72, 2)) + + _text_2:any; +>_text_2 : Symbol(_View_AppComponent0._text_2, Decl(complexNarrowingWithAny.ts, 135, 58)) + + _el_3:any; +>_el_3 : Symbol(_View_AppComponent0._el_3, Decl(complexNarrowingWithAny.ts, 136, 14)) + + _DefaultValueAccessor_3_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_3_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_3_3, Decl(complexNarrowingWithAny.ts, 137, 12)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_3_4:any[]; +>_NG_VALUE_ACCESSOR_3_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_3_4, Decl(complexNarrowingWithAny.ts, 138, 58)) + + _FormControlName_3_5:import47.FormControlName; +>_FormControlName_3_5 : Symbol(_View_AppComponent0._FormControlName_3_5, Decl(complexNarrowingWithAny.ts, 139, 31)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_3_6:any; +>_NgControl_3_6 : Symbol(_View_AppComponent0._NgControl_3_6, Decl(complexNarrowingWithAny.ts, 140, 48)) + + _NgControlStatus_3_7:import45.NgControlStatus; +>_NgControlStatus_3_7 : Symbol(_View_AppComponent0._NgControlStatus_3_7, Decl(complexNarrowingWithAny.ts, 141, 21)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_4:any; +>_el_4 : Symbol(_View_AppComponent0._el_4, Decl(complexNarrowingWithAny.ts, 142, 48)) + + _text_5:any; +>_text_5 : Symbol(_View_AppComponent0._text_5, Decl(complexNarrowingWithAny.ts, 143, 12)) + + _el_6:any; +>_el_6 : Symbol(_View_AppComponent0._el_6, Decl(complexNarrowingWithAny.ts, 144, 14)) + + _DefaultValueAccessor_6_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_6_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_6_3, Decl(complexNarrowingWithAny.ts, 145, 12)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_6_4:any[]; +>_NG_VALUE_ACCESSOR_6_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_6_4, Decl(complexNarrowingWithAny.ts, 146, 58)) + + _FormControlName_6_5:import47.FormControlName; +>_FormControlName_6_5 : Symbol(_View_AppComponent0._FormControlName_6_5, Decl(complexNarrowingWithAny.ts, 147, 31)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_6_6:any; +>_NgControl_6_6 : Symbol(_View_AppComponent0._NgControl_6_6, Decl(complexNarrowingWithAny.ts, 148, 48)) + + _NgControlStatus_6_7:import45.NgControlStatus; +>_NgControlStatus_6_7 : Symbol(_View_AppComponent0._NgControlStatus_6_7, Decl(complexNarrowingWithAny.ts, 149, 21)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_7:any; +>_el_7 : Symbol(_View_AppComponent0._el_7, Decl(complexNarrowingWithAny.ts, 150, 48)) + + _text_8:any; +>_text_8 : Symbol(_View_AppComponent0._text_8, Decl(complexNarrowingWithAny.ts, 151, 12)) + + _el_9:any; +>_el_9 : Symbol(_View_AppComponent0._el_9, Decl(complexNarrowingWithAny.ts, 152, 14)) + + _DefaultValueAccessor_9_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_9_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_9_3, Decl(complexNarrowingWithAny.ts, 153, 12)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_9_4:any[]; +>_NG_VALUE_ACCESSOR_9_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_9_4, Decl(complexNarrowingWithAny.ts, 154, 58)) + + _FormControlName_9_5:import47.FormControlName; +>_FormControlName_9_5 : Symbol(_View_AppComponent0._FormControlName_9_5, Decl(complexNarrowingWithAny.ts, 155, 31)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_9_6:any; +>_NgControl_9_6 : Symbol(_View_AppComponent0._NgControl_9_6, Decl(complexNarrowingWithAny.ts, 156, 48)) + + _NgControlStatus_9_7:import45.NgControlStatus; +>_NgControlStatus_9_7 : Symbol(_View_AppComponent0._NgControlStatus_9_7, Decl(complexNarrowingWithAny.ts, 157, 21)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_10:any; +>_el_10 : Symbol(_View_AppComponent0._el_10, Decl(complexNarrowingWithAny.ts, 158, 48)) + + _text_11:any; +>_text_11 : Symbol(_View_AppComponent0._text_11, Decl(complexNarrowingWithAny.ts, 159, 13)) + + _el_12:any; +>_el_12 : Symbol(_View_AppComponent0._el_12, Decl(complexNarrowingWithAny.ts, 160, 15)) + + _DefaultValueAccessor_12_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_12_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_12_3, Decl(complexNarrowingWithAny.ts, 161, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_12_4:any[]; +>_NG_VALUE_ACCESSOR_12_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_12_4, Decl(complexNarrowingWithAny.ts, 162, 59)) + + _FormControlName_12_5:import47.FormControlName; +>_FormControlName_12_5 : Symbol(_View_AppComponent0._FormControlName_12_5, Decl(complexNarrowingWithAny.ts, 163, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_12_6:any; +>_NgControl_12_6 : Symbol(_View_AppComponent0._NgControl_12_6, Decl(complexNarrowingWithAny.ts, 164, 49)) + + _NgControlStatus_12_7:import45.NgControlStatus; +>_NgControlStatus_12_7 : Symbol(_View_AppComponent0._NgControlStatus_12_7, Decl(complexNarrowingWithAny.ts, 165, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_13:any; +>_el_13 : Symbol(_View_AppComponent0._el_13, Decl(complexNarrowingWithAny.ts, 166, 49)) + + _text_14:any; +>_text_14 : Symbol(_View_AppComponent0._text_14, Decl(complexNarrowingWithAny.ts, 167, 13)) + + _el_15:any; +>_el_15 : Symbol(_View_AppComponent0._el_15, Decl(complexNarrowingWithAny.ts, 168, 15)) + + _DefaultValueAccessor_15_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_15_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_15_3, Decl(complexNarrowingWithAny.ts, 169, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_15_4:any[]; +>_NG_VALUE_ACCESSOR_15_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_15_4, Decl(complexNarrowingWithAny.ts, 170, 59)) + + _FormControlName_15_5:import47.FormControlName; +>_FormControlName_15_5 : Symbol(_View_AppComponent0._FormControlName_15_5, Decl(complexNarrowingWithAny.ts, 171, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_15_6:any; +>_NgControl_15_6 : Symbol(_View_AppComponent0._NgControl_15_6, Decl(complexNarrowingWithAny.ts, 172, 49)) + + _NgControlStatus_15_7:import45.NgControlStatus; +>_NgControlStatus_15_7 : Symbol(_View_AppComponent0._NgControlStatus_15_7, Decl(complexNarrowingWithAny.ts, 173, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_16:any; +>_el_16 : Symbol(_View_AppComponent0._el_16, Decl(complexNarrowingWithAny.ts, 174, 49)) + + _text_17:any; +>_text_17 : Symbol(_View_AppComponent0._text_17, Decl(complexNarrowingWithAny.ts, 175, 13)) + + _el_18:any; +>_el_18 : Symbol(_View_AppComponent0._el_18, Decl(complexNarrowingWithAny.ts, 176, 15)) + + _DefaultValueAccessor_18_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_18_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_18_3, Decl(complexNarrowingWithAny.ts, 177, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_18_4:any[]; +>_NG_VALUE_ACCESSOR_18_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_18_4, Decl(complexNarrowingWithAny.ts, 178, 59)) + + _FormControlName_18_5:import47.FormControlName; +>_FormControlName_18_5 : Symbol(_View_AppComponent0._FormControlName_18_5, Decl(complexNarrowingWithAny.ts, 179, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_18_6:any; +>_NgControl_18_6 : Symbol(_View_AppComponent0._NgControl_18_6, Decl(complexNarrowingWithAny.ts, 180, 49)) + + _NgControlStatus_18_7:import45.NgControlStatus; +>_NgControlStatus_18_7 : Symbol(_View_AppComponent0._NgControlStatus_18_7, Decl(complexNarrowingWithAny.ts, 181, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_19:any; +>_el_19 : Symbol(_View_AppComponent0._el_19, Decl(complexNarrowingWithAny.ts, 182, 49)) + + _text_20:any; +>_text_20 : Symbol(_View_AppComponent0._text_20, Decl(complexNarrowingWithAny.ts, 183, 13)) + + _el_21:any; +>_el_21 : Symbol(_View_AppComponent0._el_21, Decl(complexNarrowingWithAny.ts, 184, 15)) + + _DefaultValueAccessor_21_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_21_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_21_3, Decl(complexNarrowingWithAny.ts, 185, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_21_4:any[]; +>_NG_VALUE_ACCESSOR_21_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_21_4, Decl(complexNarrowingWithAny.ts, 186, 59)) + + _FormControlName_21_5:import47.FormControlName; +>_FormControlName_21_5 : Symbol(_View_AppComponent0._FormControlName_21_5, Decl(complexNarrowingWithAny.ts, 187, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_21_6:any; +>_NgControl_21_6 : Symbol(_View_AppComponent0._NgControl_21_6, Decl(complexNarrowingWithAny.ts, 188, 49)) + + _NgControlStatus_21_7:import45.NgControlStatus; +>_NgControlStatus_21_7 : Symbol(_View_AppComponent0._NgControlStatus_21_7, Decl(complexNarrowingWithAny.ts, 189, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_22:any; +>_el_22 : Symbol(_View_AppComponent0._el_22, Decl(complexNarrowingWithAny.ts, 190, 49)) + + _text_23:any; +>_text_23 : Symbol(_View_AppComponent0._text_23, Decl(complexNarrowingWithAny.ts, 191, 13)) + + _el_24:any; +>_el_24 : Symbol(_View_AppComponent0._el_24, Decl(complexNarrowingWithAny.ts, 192, 15)) + + _DefaultValueAccessor_24_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_24_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_24_3, Decl(complexNarrowingWithAny.ts, 193, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_24_4:any[]; +>_NG_VALUE_ACCESSOR_24_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_24_4, Decl(complexNarrowingWithAny.ts, 194, 59)) + + _FormControlName_24_5:import47.FormControlName; +>_FormControlName_24_5 : Symbol(_View_AppComponent0._FormControlName_24_5, Decl(complexNarrowingWithAny.ts, 195, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_24_6:any; +>_NgControl_24_6 : Symbol(_View_AppComponent0._NgControl_24_6, Decl(complexNarrowingWithAny.ts, 196, 49)) + + _NgControlStatus_24_7:import45.NgControlStatus; +>_NgControlStatus_24_7 : Symbol(_View_AppComponent0._NgControlStatus_24_7, Decl(complexNarrowingWithAny.ts, 197, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_25:any; +>_el_25 : Symbol(_View_AppComponent0._el_25, Decl(complexNarrowingWithAny.ts, 198, 49)) + + _text_26:any; +>_text_26 : Symbol(_View_AppComponent0._text_26, Decl(complexNarrowingWithAny.ts, 199, 13)) + + _el_27:any; +>_el_27 : Symbol(_View_AppComponent0._el_27, Decl(complexNarrowingWithAny.ts, 200, 15)) + + _DefaultValueAccessor_27_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_27_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_27_3, Decl(complexNarrowingWithAny.ts, 201, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_27_4:any[]; +>_NG_VALUE_ACCESSOR_27_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_27_4, Decl(complexNarrowingWithAny.ts, 202, 59)) + + _FormControlName_27_5:import47.FormControlName; +>_FormControlName_27_5 : Symbol(_View_AppComponent0._FormControlName_27_5, Decl(complexNarrowingWithAny.ts, 203, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_27_6:any; +>_NgControl_27_6 : Symbol(_View_AppComponent0._NgControl_27_6, Decl(complexNarrowingWithAny.ts, 204, 49)) + + _NgControlStatus_27_7:import45.NgControlStatus; +>_NgControlStatus_27_7 : Symbol(_View_AppComponent0._NgControlStatus_27_7, Decl(complexNarrowingWithAny.ts, 205, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_28:any; +>_el_28 : Symbol(_View_AppComponent0._el_28, Decl(complexNarrowingWithAny.ts, 206, 49)) + + _text_29:any; +>_text_29 : Symbol(_View_AppComponent0._text_29, Decl(complexNarrowingWithAny.ts, 207, 13)) + + _el_30:any; +>_el_30 : Symbol(_View_AppComponent0._el_30, Decl(complexNarrowingWithAny.ts, 208, 15)) + + _DefaultValueAccessor_30_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_30_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_30_3, Decl(complexNarrowingWithAny.ts, 209, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_30_4:any[]; +>_NG_VALUE_ACCESSOR_30_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_30_4, Decl(complexNarrowingWithAny.ts, 210, 59)) + + _FormControlName_30_5:import47.FormControlName; +>_FormControlName_30_5 : Symbol(_View_AppComponent0._FormControlName_30_5, Decl(complexNarrowingWithAny.ts, 211, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_30_6:any; +>_NgControl_30_6 : Symbol(_View_AppComponent0._NgControl_30_6, Decl(complexNarrowingWithAny.ts, 212, 49)) + + _NgControlStatus_30_7:import45.NgControlStatus; +>_NgControlStatus_30_7 : Symbol(_View_AppComponent0._NgControlStatus_30_7, Decl(complexNarrowingWithAny.ts, 213, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_31:any; +>_el_31 : Symbol(_View_AppComponent0._el_31, Decl(complexNarrowingWithAny.ts, 214, 49)) + + _text_32:any; +>_text_32 : Symbol(_View_AppComponent0._text_32, Decl(complexNarrowingWithAny.ts, 215, 13)) + + _el_33:any; +>_el_33 : Symbol(_View_AppComponent0._el_33, Decl(complexNarrowingWithAny.ts, 216, 15)) + + _DefaultValueAccessor_33_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_33_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_33_3, Decl(complexNarrowingWithAny.ts, 217, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_33_4:any[]; +>_NG_VALUE_ACCESSOR_33_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_33_4, Decl(complexNarrowingWithAny.ts, 218, 59)) + + _FormControlName_33_5:import47.FormControlName; +>_FormControlName_33_5 : Symbol(_View_AppComponent0._FormControlName_33_5, Decl(complexNarrowingWithAny.ts, 219, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_33_6:any; +>_NgControl_33_6 : Symbol(_View_AppComponent0._NgControl_33_6, Decl(complexNarrowingWithAny.ts, 220, 49)) + + _NgControlStatus_33_7:import45.NgControlStatus; +>_NgControlStatus_33_7 : Symbol(_View_AppComponent0._NgControlStatus_33_7, Decl(complexNarrowingWithAny.ts, 221, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_34:any; +>_el_34 : Symbol(_View_AppComponent0._el_34, Decl(complexNarrowingWithAny.ts, 222, 49)) + + _text_35:any; +>_text_35 : Symbol(_View_AppComponent0._text_35, Decl(complexNarrowingWithAny.ts, 223, 13)) + + _el_36:any; +>_el_36 : Symbol(_View_AppComponent0._el_36, Decl(complexNarrowingWithAny.ts, 224, 15)) + + _DefaultValueAccessor_36_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_36_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_36_3, Decl(complexNarrowingWithAny.ts, 225, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_36_4:any[]; +>_NG_VALUE_ACCESSOR_36_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_36_4, Decl(complexNarrowingWithAny.ts, 226, 59)) + + _FormControlName_36_5:import47.FormControlName; +>_FormControlName_36_5 : Symbol(_View_AppComponent0._FormControlName_36_5, Decl(complexNarrowingWithAny.ts, 227, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_36_6:any; +>_NgControl_36_6 : Symbol(_View_AppComponent0._NgControl_36_6, Decl(complexNarrowingWithAny.ts, 228, 49)) + + _NgControlStatus_36_7:import45.NgControlStatus; +>_NgControlStatus_36_7 : Symbol(_View_AppComponent0._NgControlStatus_36_7, Decl(complexNarrowingWithAny.ts, 229, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_37:any; +>_el_37 : Symbol(_View_AppComponent0._el_37, Decl(complexNarrowingWithAny.ts, 230, 49)) + + _text_38:any; +>_text_38 : Symbol(_View_AppComponent0._text_38, Decl(complexNarrowingWithAny.ts, 231, 13)) + + _el_39:any; +>_el_39 : Symbol(_View_AppComponent0._el_39, Decl(complexNarrowingWithAny.ts, 232, 15)) + + _DefaultValueAccessor_39_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_39_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_39_3, Decl(complexNarrowingWithAny.ts, 233, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_39_4:any[]; +>_NG_VALUE_ACCESSOR_39_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_39_4, Decl(complexNarrowingWithAny.ts, 234, 59)) + + _FormControlName_39_5:import47.FormControlName; +>_FormControlName_39_5 : Symbol(_View_AppComponent0._FormControlName_39_5, Decl(complexNarrowingWithAny.ts, 235, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_39_6:any; +>_NgControl_39_6 : Symbol(_View_AppComponent0._NgControl_39_6, Decl(complexNarrowingWithAny.ts, 236, 49)) + + _NgControlStatus_39_7:import45.NgControlStatus; +>_NgControlStatus_39_7 : Symbol(_View_AppComponent0._NgControlStatus_39_7, Decl(complexNarrowingWithAny.ts, 237, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_40:any; +>_el_40 : Symbol(_View_AppComponent0._el_40, Decl(complexNarrowingWithAny.ts, 238, 49)) + + _text_41:any; +>_text_41 : Symbol(_View_AppComponent0._text_41, Decl(complexNarrowingWithAny.ts, 239, 13)) + + _el_42:any; +>_el_42 : Symbol(_View_AppComponent0._el_42, Decl(complexNarrowingWithAny.ts, 240, 15)) + + _DefaultValueAccessor_42_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_42_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_42_3, Decl(complexNarrowingWithAny.ts, 241, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_42_4:any[]; +>_NG_VALUE_ACCESSOR_42_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_42_4, Decl(complexNarrowingWithAny.ts, 242, 59)) + + _FormControlName_42_5:import47.FormControlName; +>_FormControlName_42_5 : Symbol(_View_AppComponent0._FormControlName_42_5, Decl(complexNarrowingWithAny.ts, 243, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_42_6:any; +>_NgControl_42_6 : Symbol(_View_AppComponent0._NgControl_42_6, Decl(complexNarrowingWithAny.ts, 244, 49)) + + _NgControlStatus_42_7:import45.NgControlStatus; +>_NgControlStatus_42_7 : Symbol(_View_AppComponent0._NgControlStatus_42_7, Decl(complexNarrowingWithAny.ts, 245, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_43:any; +>_el_43 : Symbol(_View_AppComponent0._el_43, Decl(complexNarrowingWithAny.ts, 246, 49)) + + _text_44:any; +>_text_44 : Symbol(_View_AppComponent0._text_44, Decl(complexNarrowingWithAny.ts, 247, 13)) + + _el_45:any; +>_el_45 : Symbol(_View_AppComponent0._el_45, Decl(complexNarrowingWithAny.ts, 248, 15)) + + _DefaultValueAccessor_45_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_45_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_45_3, Decl(complexNarrowingWithAny.ts, 249, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_45_4:any[]; +>_NG_VALUE_ACCESSOR_45_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_45_4, Decl(complexNarrowingWithAny.ts, 250, 59)) + + _FormControlName_45_5:import47.FormControlName; +>_FormControlName_45_5 : Symbol(_View_AppComponent0._FormControlName_45_5, Decl(complexNarrowingWithAny.ts, 251, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_45_6:any; +>_NgControl_45_6 : Symbol(_View_AppComponent0._NgControl_45_6, Decl(complexNarrowingWithAny.ts, 252, 49)) + + _NgControlStatus_45_7:import45.NgControlStatus; +>_NgControlStatus_45_7 : Symbol(_View_AppComponent0._NgControlStatus_45_7, Decl(complexNarrowingWithAny.ts, 253, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_46:any; +>_el_46 : Symbol(_View_AppComponent0._el_46, Decl(complexNarrowingWithAny.ts, 254, 49)) + + _text_47:any; +>_text_47 : Symbol(_View_AppComponent0._text_47, Decl(complexNarrowingWithAny.ts, 255, 13)) + + _el_48:any; +>_el_48 : Symbol(_View_AppComponent0._el_48, Decl(complexNarrowingWithAny.ts, 256, 15)) + + _DefaultValueAccessor_48_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_48_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_48_3, Decl(complexNarrowingWithAny.ts, 257, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_48_4:any[]; +>_NG_VALUE_ACCESSOR_48_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_48_4, Decl(complexNarrowingWithAny.ts, 258, 59)) + + _FormControlName_48_5:import47.FormControlName; +>_FormControlName_48_5 : Symbol(_View_AppComponent0._FormControlName_48_5, Decl(complexNarrowingWithAny.ts, 259, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_48_6:any; +>_NgControl_48_6 : Symbol(_View_AppComponent0._NgControl_48_6, Decl(complexNarrowingWithAny.ts, 260, 49)) + + _NgControlStatus_48_7:import45.NgControlStatus; +>_NgControlStatus_48_7 : Symbol(_View_AppComponent0._NgControlStatus_48_7, Decl(complexNarrowingWithAny.ts, 261, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_49:any; +>_el_49 : Symbol(_View_AppComponent0._el_49, Decl(complexNarrowingWithAny.ts, 262, 49)) + + _text_50:any; +>_text_50 : Symbol(_View_AppComponent0._text_50, Decl(complexNarrowingWithAny.ts, 263, 13)) + + _el_51:any; +>_el_51 : Symbol(_View_AppComponent0._el_51, Decl(complexNarrowingWithAny.ts, 264, 15)) + + _DefaultValueAccessor_51_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_51_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_51_3, Decl(complexNarrowingWithAny.ts, 265, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_51_4:any[]; +>_NG_VALUE_ACCESSOR_51_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_51_4, Decl(complexNarrowingWithAny.ts, 266, 59)) + + _FormControlName_51_5:import47.FormControlName; +>_FormControlName_51_5 : Symbol(_View_AppComponent0._FormControlName_51_5, Decl(complexNarrowingWithAny.ts, 267, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_51_6:any; +>_NgControl_51_6 : Symbol(_View_AppComponent0._NgControl_51_6, Decl(complexNarrowingWithAny.ts, 268, 49)) + + _NgControlStatus_51_7:import45.NgControlStatus; +>_NgControlStatus_51_7 : Symbol(_View_AppComponent0._NgControlStatus_51_7, Decl(complexNarrowingWithAny.ts, 269, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_52:any; +>_el_52 : Symbol(_View_AppComponent0._el_52, Decl(complexNarrowingWithAny.ts, 270, 49)) + + _text_53:any; +>_text_53 : Symbol(_View_AppComponent0._text_53, Decl(complexNarrowingWithAny.ts, 271, 13)) + + _el_54:any; +>_el_54 : Symbol(_View_AppComponent0._el_54, Decl(complexNarrowingWithAny.ts, 272, 15)) + + _DefaultValueAccessor_54_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_54_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_54_3, Decl(complexNarrowingWithAny.ts, 273, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_54_4:any[]; +>_NG_VALUE_ACCESSOR_54_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_54_4, Decl(complexNarrowingWithAny.ts, 274, 59)) + + _FormControlName_54_5:import47.FormControlName; +>_FormControlName_54_5 : Symbol(_View_AppComponent0._FormControlName_54_5, Decl(complexNarrowingWithAny.ts, 275, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_54_6:any; +>_NgControl_54_6 : Symbol(_View_AppComponent0._NgControl_54_6, Decl(complexNarrowingWithAny.ts, 276, 49)) + + _NgControlStatus_54_7:import45.NgControlStatus; +>_NgControlStatus_54_7 : Symbol(_View_AppComponent0._NgControlStatus_54_7, Decl(complexNarrowingWithAny.ts, 277, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_55:any; +>_el_55 : Symbol(_View_AppComponent0._el_55, Decl(complexNarrowingWithAny.ts, 278, 49)) + + _text_56:any; +>_text_56 : Symbol(_View_AppComponent0._text_56, Decl(complexNarrowingWithAny.ts, 279, 13)) + + _el_57:any; +>_el_57 : Symbol(_View_AppComponent0._el_57, Decl(complexNarrowingWithAny.ts, 280, 15)) + + _DefaultValueAccessor_57_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_57_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_57_3, Decl(complexNarrowingWithAny.ts, 281, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_57_4:any[]; +>_NG_VALUE_ACCESSOR_57_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_57_4, Decl(complexNarrowingWithAny.ts, 282, 59)) + + _FormControlName_57_5:import47.FormControlName; +>_FormControlName_57_5 : Symbol(_View_AppComponent0._FormControlName_57_5, Decl(complexNarrowingWithAny.ts, 283, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_57_6:any; +>_NgControl_57_6 : Symbol(_View_AppComponent0._NgControl_57_6, Decl(complexNarrowingWithAny.ts, 284, 49)) + + _NgControlStatus_57_7:import45.NgControlStatus; +>_NgControlStatus_57_7 : Symbol(_View_AppComponent0._NgControlStatus_57_7, Decl(complexNarrowingWithAny.ts, 285, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_58:any; +>_el_58 : Symbol(_View_AppComponent0._el_58, Decl(complexNarrowingWithAny.ts, 286, 49)) + + _text_59:any; +>_text_59 : Symbol(_View_AppComponent0._text_59, Decl(complexNarrowingWithAny.ts, 287, 13)) + + _el_60:any; +>_el_60 : Symbol(_View_AppComponent0._el_60, Decl(complexNarrowingWithAny.ts, 288, 15)) + + _DefaultValueAccessor_60_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_60_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_60_3, Decl(complexNarrowingWithAny.ts, 289, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_60_4:any[]; +>_NG_VALUE_ACCESSOR_60_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_60_4, Decl(complexNarrowingWithAny.ts, 290, 59)) + + _FormControlName_60_5:import47.FormControlName; +>_FormControlName_60_5 : Symbol(_View_AppComponent0._FormControlName_60_5, Decl(complexNarrowingWithAny.ts, 291, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_60_6:any; +>_NgControl_60_6 : Symbol(_View_AppComponent0._NgControl_60_6, Decl(complexNarrowingWithAny.ts, 292, 49)) + + _NgControlStatus_60_7:import45.NgControlStatus; +>_NgControlStatus_60_7 : Symbol(_View_AppComponent0._NgControlStatus_60_7, Decl(complexNarrowingWithAny.ts, 293, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_61:any; +>_el_61 : Symbol(_View_AppComponent0._el_61, Decl(complexNarrowingWithAny.ts, 294, 49)) + + _text_62:any; +>_text_62 : Symbol(_View_AppComponent0._text_62, Decl(complexNarrowingWithAny.ts, 295, 13)) + + _text_63:any; +>_text_63 : Symbol(_View_AppComponent0._text_63, Decl(complexNarrowingWithAny.ts, 296, 15)) + + /*private*/ _expr_2:any; +>_expr_2 : Symbol(_View_AppComponent0._expr_2, Decl(complexNarrowingWithAny.ts, 297, 15)) + + /*private*/ _expr_3:any; +>_expr_3 : Symbol(_View_AppComponent0._expr_3, Decl(complexNarrowingWithAny.ts, 298, 26)) + + /*private*/ _expr_4:any; +>_expr_4 : Symbol(_View_AppComponent0._expr_4, Decl(complexNarrowingWithAny.ts, 299, 26)) + + /*private*/ _expr_5:any; +>_expr_5 : Symbol(_View_AppComponent0._expr_5, Decl(complexNarrowingWithAny.ts, 300, 26)) + + /*private*/ _expr_6:any; +>_expr_6 : Symbol(_View_AppComponent0._expr_6, Decl(complexNarrowingWithAny.ts, 301, 26)) + + /*private*/ _expr_7:any; +>_expr_7 : Symbol(_View_AppComponent0._expr_7, Decl(complexNarrowingWithAny.ts, 302, 26)) + + /*private*/ _expr_8:any; +>_expr_8 : Symbol(_View_AppComponent0._expr_8, Decl(complexNarrowingWithAny.ts, 303, 26)) + + /*private*/ _expr_11:any; +>_expr_11 : Symbol(_View_AppComponent0._expr_11, Decl(complexNarrowingWithAny.ts, 304, 26)) + + /*private*/ _expr_12:any; +>_expr_12 : Symbol(_View_AppComponent0._expr_12, Decl(complexNarrowingWithAny.ts, 305, 27)) + + /*private*/ _expr_13:any; +>_expr_13 : Symbol(_View_AppComponent0._expr_13, Decl(complexNarrowingWithAny.ts, 306, 27)) + + /*private*/ _expr_14:any; +>_expr_14 : Symbol(_View_AppComponent0._expr_14, Decl(complexNarrowingWithAny.ts, 307, 27)) + + /*private*/ _expr_15:any; +>_expr_15 : Symbol(_View_AppComponent0._expr_15, Decl(complexNarrowingWithAny.ts, 308, 27)) + + /*private*/ _expr_16:any; +>_expr_16 : Symbol(_View_AppComponent0._expr_16, Decl(complexNarrowingWithAny.ts, 309, 27)) + + /*private*/ _expr_17:any; +>_expr_17 : Symbol(_View_AppComponent0._expr_17, Decl(complexNarrowingWithAny.ts, 310, 27)) + + /*private*/ _expr_20:any; +>_expr_20 : Symbol(_View_AppComponent0._expr_20, Decl(complexNarrowingWithAny.ts, 311, 27)) + + /*private*/ _expr_21:any; +>_expr_21 : Symbol(_View_AppComponent0._expr_21, Decl(complexNarrowingWithAny.ts, 312, 27)) + + /*private*/ _expr_22:any; +>_expr_22 : Symbol(_View_AppComponent0._expr_22, Decl(complexNarrowingWithAny.ts, 313, 27)) + + /*private*/ _expr_23:any; +>_expr_23 : Symbol(_View_AppComponent0._expr_23, Decl(complexNarrowingWithAny.ts, 314, 27)) + + /*private*/ _expr_24:any; +>_expr_24 : Symbol(_View_AppComponent0._expr_24, Decl(complexNarrowingWithAny.ts, 315, 27)) + + /*private*/ _expr_25:any; +>_expr_25 : Symbol(_View_AppComponent0._expr_25, Decl(complexNarrowingWithAny.ts, 316, 27)) + + /*private*/ _expr_26:any; +>_expr_26 : Symbol(_View_AppComponent0._expr_26, Decl(complexNarrowingWithAny.ts, 317, 27)) + + /*private*/ _expr_29:any; +>_expr_29 : Symbol(_View_AppComponent0._expr_29, Decl(complexNarrowingWithAny.ts, 318, 27)) + + /*private*/ _expr_30:any; +>_expr_30 : Symbol(_View_AppComponent0._expr_30, Decl(complexNarrowingWithAny.ts, 319, 27)) + + /*private*/ _expr_31:any; +>_expr_31 : Symbol(_View_AppComponent0._expr_31, Decl(complexNarrowingWithAny.ts, 320, 27)) + + /*private*/ _expr_32:any; +>_expr_32 : Symbol(_View_AppComponent0._expr_32, Decl(complexNarrowingWithAny.ts, 321, 27)) + + /*private*/ _expr_33:any; +>_expr_33 : Symbol(_View_AppComponent0._expr_33, Decl(complexNarrowingWithAny.ts, 322, 27)) + + /*private*/ _expr_34:any; +>_expr_34 : Symbol(_View_AppComponent0._expr_34, Decl(complexNarrowingWithAny.ts, 323, 27)) + + /*private*/ _expr_35:any; +>_expr_35 : Symbol(_View_AppComponent0._expr_35, Decl(complexNarrowingWithAny.ts, 324, 27)) + + /*private*/ _expr_38:any; +>_expr_38 : Symbol(_View_AppComponent0._expr_38, Decl(complexNarrowingWithAny.ts, 325, 27)) + + /*private*/ _expr_39:any; +>_expr_39 : Symbol(_View_AppComponent0._expr_39, Decl(complexNarrowingWithAny.ts, 326, 27)) + + /*private*/ _expr_40:any; +>_expr_40 : Symbol(_View_AppComponent0._expr_40, Decl(complexNarrowingWithAny.ts, 327, 27)) + + /*private*/ _expr_41:any; +>_expr_41 : Symbol(_View_AppComponent0._expr_41, Decl(complexNarrowingWithAny.ts, 328, 27)) + + /*private*/ _expr_42:any; +>_expr_42 : Symbol(_View_AppComponent0._expr_42, Decl(complexNarrowingWithAny.ts, 329, 27)) + + /*private*/ _expr_43:any; +>_expr_43 : Symbol(_View_AppComponent0._expr_43, Decl(complexNarrowingWithAny.ts, 330, 27)) + + /*private*/ _expr_44:any; +>_expr_44 : Symbol(_View_AppComponent0._expr_44, Decl(complexNarrowingWithAny.ts, 331, 27)) + + /*private*/ _expr_47:any; +>_expr_47 : Symbol(_View_AppComponent0._expr_47, Decl(complexNarrowingWithAny.ts, 332, 27)) + + /*private*/ _expr_48:any; +>_expr_48 : Symbol(_View_AppComponent0._expr_48, Decl(complexNarrowingWithAny.ts, 333, 27)) + + /*private*/ _expr_49:any; +>_expr_49 : Symbol(_View_AppComponent0._expr_49, Decl(complexNarrowingWithAny.ts, 334, 27)) + + /*private*/ _expr_50:any; +>_expr_50 : Symbol(_View_AppComponent0._expr_50, Decl(complexNarrowingWithAny.ts, 335, 27)) + + /*private*/ _expr_51:any; +>_expr_51 : Symbol(_View_AppComponent0._expr_51, Decl(complexNarrowingWithAny.ts, 336, 27)) + + /*private*/ _expr_52:any; +>_expr_52 : Symbol(_View_AppComponent0._expr_52, Decl(complexNarrowingWithAny.ts, 337, 27)) + + /*private*/ _expr_53:any; +>_expr_53 : Symbol(_View_AppComponent0._expr_53, Decl(complexNarrowingWithAny.ts, 338, 27)) + + /*private*/ _expr_56:any; +>_expr_56 : Symbol(_View_AppComponent0._expr_56, Decl(complexNarrowingWithAny.ts, 339, 27)) + + /*private*/ _expr_57:any; +>_expr_57 : Symbol(_View_AppComponent0._expr_57, Decl(complexNarrowingWithAny.ts, 340, 27)) + + /*private*/ _expr_58:any; +>_expr_58 : Symbol(_View_AppComponent0._expr_58, Decl(complexNarrowingWithAny.ts, 341, 27)) + + /*private*/ _expr_59:any; +>_expr_59 : Symbol(_View_AppComponent0._expr_59, Decl(complexNarrowingWithAny.ts, 342, 27)) + + /*private*/ _expr_60:any; +>_expr_60 : Symbol(_View_AppComponent0._expr_60, Decl(complexNarrowingWithAny.ts, 343, 27)) + + /*private*/ _expr_61:any; +>_expr_61 : Symbol(_View_AppComponent0._expr_61, Decl(complexNarrowingWithAny.ts, 344, 27)) + + /*private*/ _expr_62:any; +>_expr_62 : Symbol(_View_AppComponent0._expr_62, Decl(complexNarrowingWithAny.ts, 345, 27)) + + /*private*/ _expr_65:any; +>_expr_65 : Symbol(_View_AppComponent0._expr_65, Decl(complexNarrowingWithAny.ts, 346, 27)) + + /*private*/ _expr_66:any; +>_expr_66 : Symbol(_View_AppComponent0._expr_66, Decl(complexNarrowingWithAny.ts, 347, 27)) + + /*private*/ _expr_67:any; +>_expr_67 : Symbol(_View_AppComponent0._expr_67, Decl(complexNarrowingWithAny.ts, 348, 27)) + + /*private*/ _expr_68:any; +>_expr_68 : Symbol(_View_AppComponent0._expr_68, Decl(complexNarrowingWithAny.ts, 349, 27)) + + /*private*/ _expr_69:any; +>_expr_69 : Symbol(_View_AppComponent0._expr_69, Decl(complexNarrowingWithAny.ts, 350, 27)) + + /*private*/ _expr_70:any; +>_expr_70 : Symbol(_View_AppComponent0._expr_70, Decl(complexNarrowingWithAny.ts, 351, 27)) + + /*private*/ _expr_71:any; +>_expr_71 : Symbol(_View_AppComponent0._expr_71, Decl(complexNarrowingWithAny.ts, 352, 27)) + + /*private*/ _expr_74:any; +>_expr_74 : Symbol(_View_AppComponent0._expr_74, Decl(complexNarrowingWithAny.ts, 353, 27)) + + /*private*/ _expr_75:any; +>_expr_75 : Symbol(_View_AppComponent0._expr_75, Decl(complexNarrowingWithAny.ts, 354, 27)) + + /*private*/ _expr_76:any; +>_expr_76 : Symbol(_View_AppComponent0._expr_76, Decl(complexNarrowingWithAny.ts, 355, 27)) + + /*private*/ _expr_77:any; +>_expr_77 : Symbol(_View_AppComponent0._expr_77, Decl(complexNarrowingWithAny.ts, 356, 27)) + + /*private*/ _expr_78:any; +>_expr_78 : Symbol(_View_AppComponent0._expr_78, Decl(complexNarrowingWithAny.ts, 357, 27)) + + /*private*/ _expr_79:any; +>_expr_79 : Symbol(_View_AppComponent0._expr_79, Decl(complexNarrowingWithAny.ts, 358, 27)) + + /*private*/ _expr_80:any; +>_expr_80 : Symbol(_View_AppComponent0._expr_80, Decl(complexNarrowingWithAny.ts, 359, 27)) + + /*private*/ _expr_83:any; +>_expr_83 : Symbol(_View_AppComponent0._expr_83, Decl(complexNarrowingWithAny.ts, 360, 27)) + + /*private*/ _expr_84:any; +>_expr_84 : Symbol(_View_AppComponent0._expr_84, Decl(complexNarrowingWithAny.ts, 361, 27)) + + /*private*/ _expr_85:any; +>_expr_85 : Symbol(_View_AppComponent0._expr_85, Decl(complexNarrowingWithAny.ts, 362, 27)) + + /*private*/ _expr_86:any; +>_expr_86 : Symbol(_View_AppComponent0._expr_86, Decl(complexNarrowingWithAny.ts, 363, 27)) + + /*private*/ _expr_87:any; +>_expr_87 : Symbol(_View_AppComponent0._expr_87, Decl(complexNarrowingWithAny.ts, 364, 27)) + + /*private*/ _expr_88:any; +>_expr_88 : Symbol(_View_AppComponent0._expr_88, Decl(complexNarrowingWithAny.ts, 365, 27)) + + /*private*/ _expr_89:any; +>_expr_89 : Symbol(_View_AppComponent0._expr_89, Decl(complexNarrowingWithAny.ts, 366, 27)) + + /*private*/ _expr_92:any; +>_expr_92 : Symbol(_View_AppComponent0._expr_92, Decl(complexNarrowingWithAny.ts, 367, 27)) + + /*private*/ _expr_93:any; +>_expr_93 : Symbol(_View_AppComponent0._expr_93, Decl(complexNarrowingWithAny.ts, 368, 27)) + + /*private*/ _expr_94:any; +>_expr_94 : Symbol(_View_AppComponent0._expr_94, Decl(complexNarrowingWithAny.ts, 369, 27)) + + /*private*/ _expr_95:any; +>_expr_95 : Symbol(_View_AppComponent0._expr_95, Decl(complexNarrowingWithAny.ts, 370, 27)) + + /*private*/ _expr_96:any; +>_expr_96 : Symbol(_View_AppComponent0._expr_96, Decl(complexNarrowingWithAny.ts, 371, 27)) + + /*private*/ _expr_97:any; +>_expr_97 : Symbol(_View_AppComponent0._expr_97, Decl(complexNarrowingWithAny.ts, 372, 27)) + + /*private*/ _expr_98:any; +>_expr_98 : Symbol(_View_AppComponent0._expr_98, Decl(complexNarrowingWithAny.ts, 373, 27)) + + /*private*/ _expr_101:any; +>_expr_101 : Symbol(_View_AppComponent0._expr_101, Decl(complexNarrowingWithAny.ts, 374, 27)) + + /*private*/ _expr_102:any; +>_expr_102 : Symbol(_View_AppComponent0._expr_102, Decl(complexNarrowingWithAny.ts, 375, 28)) + + /*private*/ _expr_103:any; +>_expr_103 : Symbol(_View_AppComponent0._expr_103, Decl(complexNarrowingWithAny.ts, 376, 28)) + + /*private*/ _expr_104:any; +>_expr_104 : Symbol(_View_AppComponent0._expr_104, Decl(complexNarrowingWithAny.ts, 377, 28)) + + /*private*/ _expr_105:any; +>_expr_105 : Symbol(_View_AppComponent0._expr_105, Decl(complexNarrowingWithAny.ts, 378, 28)) + + /*private*/ _expr_106:any; +>_expr_106 : Symbol(_View_AppComponent0._expr_106, Decl(complexNarrowingWithAny.ts, 379, 28)) + + /*private*/ _expr_107:any; +>_expr_107 : Symbol(_View_AppComponent0._expr_107, Decl(complexNarrowingWithAny.ts, 380, 28)) + + /*private*/ _expr_110:any; +>_expr_110 : Symbol(_View_AppComponent0._expr_110, Decl(complexNarrowingWithAny.ts, 381, 28)) + + /*private*/ _expr_111:any; +>_expr_111 : Symbol(_View_AppComponent0._expr_111, Decl(complexNarrowingWithAny.ts, 382, 28)) + + /*private*/ _expr_112:any; +>_expr_112 : Symbol(_View_AppComponent0._expr_112, Decl(complexNarrowingWithAny.ts, 383, 28)) + + /*private*/ _expr_113:any; +>_expr_113 : Symbol(_View_AppComponent0._expr_113, Decl(complexNarrowingWithAny.ts, 384, 28)) + + /*private*/ _expr_114:any; +>_expr_114 : Symbol(_View_AppComponent0._expr_114, Decl(complexNarrowingWithAny.ts, 385, 28)) + + /*private*/ _expr_115:any; +>_expr_115 : Symbol(_View_AppComponent0._expr_115, Decl(complexNarrowingWithAny.ts, 386, 28)) + + /*private*/ _expr_116:any; +>_expr_116 : Symbol(_View_AppComponent0._expr_116, Decl(complexNarrowingWithAny.ts, 387, 28)) + + /*private*/ _expr_119:any; +>_expr_119 : Symbol(_View_AppComponent0._expr_119, Decl(complexNarrowingWithAny.ts, 388, 28)) + + /*private*/ _expr_120:any; +>_expr_120 : Symbol(_View_AppComponent0._expr_120, Decl(complexNarrowingWithAny.ts, 389, 28)) + + /*private*/ _expr_121:any; +>_expr_121 : Symbol(_View_AppComponent0._expr_121, Decl(complexNarrowingWithAny.ts, 390, 28)) + + /*private*/ _expr_122:any; +>_expr_122 : Symbol(_View_AppComponent0._expr_122, Decl(complexNarrowingWithAny.ts, 391, 28)) + + /*private*/ _expr_123:any; +>_expr_123 : Symbol(_View_AppComponent0._expr_123, Decl(complexNarrowingWithAny.ts, 392, 28)) + + /*private*/ _expr_124:any; +>_expr_124 : Symbol(_View_AppComponent0._expr_124, Decl(complexNarrowingWithAny.ts, 393, 28)) + + /*private*/ _expr_125:any; +>_expr_125 : Symbol(_View_AppComponent0._expr_125, Decl(complexNarrowingWithAny.ts, 394, 28)) + + /*private*/ _expr_128:any; +>_expr_128 : Symbol(_View_AppComponent0._expr_128, Decl(complexNarrowingWithAny.ts, 395, 28)) + + /*private*/ _expr_129:any; +>_expr_129 : Symbol(_View_AppComponent0._expr_129, Decl(complexNarrowingWithAny.ts, 396, 28)) + + /*private*/ _expr_130:any; +>_expr_130 : Symbol(_View_AppComponent0._expr_130, Decl(complexNarrowingWithAny.ts, 397, 28)) + + /*private*/ _expr_131:any; +>_expr_131 : Symbol(_View_AppComponent0._expr_131, Decl(complexNarrowingWithAny.ts, 398, 28)) + + /*private*/ _expr_132:any; +>_expr_132 : Symbol(_View_AppComponent0._expr_132, Decl(complexNarrowingWithAny.ts, 399, 28)) + + /*private*/ _expr_133:any; +>_expr_133 : Symbol(_View_AppComponent0._expr_133, Decl(complexNarrowingWithAny.ts, 400, 28)) + + /*private*/ _expr_134:any; +>_expr_134 : Symbol(_View_AppComponent0._expr_134, Decl(complexNarrowingWithAny.ts, 401, 28)) + + /*private*/ _expr_137:any; +>_expr_137 : Symbol(_View_AppComponent0._expr_137, Decl(complexNarrowingWithAny.ts, 402, 28)) + + /*private*/ _expr_138:any; +>_expr_138 : Symbol(_View_AppComponent0._expr_138, Decl(complexNarrowingWithAny.ts, 403, 28)) + + /*private*/ _expr_139:any; +>_expr_139 : Symbol(_View_AppComponent0._expr_139, Decl(complexNarrowingWithAny.ts, 404, 28)) + + /*private*/ _expr_140:any; +>_expr_140 : Symbol(_View_AppComponent0._expr_140, Decl(complexNarrowingWithAny.ts, 405, 28)) + + /*private*/ _expr_141:any; +>_expr_141 : Symbol(_View_AppComponent0._expr_141, Decl(complexNarrowingWithAny.ts, 406, 28)) + + /*private*/ _expr_142:any; +>_expr_142 : Symbol(_View_AppComponent0._expr_142, Decl(complexNarrowingWithAny.ts, 407, 28)) + + /*private*/ _expr_143:any; +>_expr_143 : Symbol(_View_AppComponent0._expr_143, Decl(complexNarrowingWithAny.ts, 408, 28)) + + /*private*/ _expr_146:any; +>_expr_146 : Symbol(_View_AppComponent0._expr_146, Decl(complexNarrowingWithAny.ts, 409, 28)) + + /*private*/ _expr_147:any; +>_expr_147 : Symbol(_View_AppComponent0._expr_147, Decl(complexNarrowingWithAny.ts, 410, 28)) + + /*private*/ _expr_148:any; +>_expr_148 : Symbol(_View_AppComponent0._expr_148, Decl(complexNarrowingWithAny.ts, 411, 28)) + + /*private*/ _expr_149:any; +>_expr_149 : Symbol(_View_AppComponent0._expr_149, Decl(complexNarrowingWithAny.ts, 412, 28)) + + /*private*/ _expr_150:any; +>_expr_150 : Symbol(_View_AppComponent0._expr_150, Decl(complexNarrowingWithAny.ts, 413, 28)) + + /*private*/ _expr_151:any; +>_expr_151 : Symbol(_View_AppComponent0._expr_151, Decl(complexNarrowingWithAny.ts, 414, 28)) + + /*private*/ _expr_152:any; +>_expr_152 : Symbol(_View_AppComponent0._expr_152, Decl(complexNarrowingWithAny.ts, 415, 28)) + + /*private*/ _expr_155:any; +>_expr_155 : Symbol(_View_AppComponent0._expr_155, Decl(complexNarrowingWithAny.ts, 416, 28)) + + /*private*/ _expr_156:any; +>_expr_156 : Symbol(_View_AppComponent0._expr_156, Decl(complexNarrowingWithAny.ts, 417, 28)) + + /*private*/ _expr_157:any; +>_expr_157 : Symbol(_View_AppComponent0._expr_157, Decl(complexNarrowingWithAny.ts, 418, 28)) + + /*private*/ _expr_158:any; +>_expr_158 : Symbol(_View_AppComponent0._expr_158, Decl(complexNarrowingWithAny.ts, 419, 28)) + + /*private*/ _expr_159:any; +>_expr_159 : Symbol(_View_AppComponent0._expr_159, Decl(complexNarrowingWithAny.ts, 420, 28)) + + /*private*/ _expr_160:any; +>_expr_160 : Symbol(_View_AppComponent0._expr_160, Decl(complexNarrowingWithAny.ts, 421, 28)) + + /*private*/ _expr_161:any; +>_expr_161 : Symbol(_View_AppComponent0._expr_161, Decl(complexNarrowingWithAny.ts, 422, 28)) + + /*private*/ _expr_164:any; +>_expr_164 : Symbol(_View_AppComponent0._expr_164, Decl(complexNarrowingWithAny.ts, 423, 28)) + + /*private*/ _expr_165:any; +>_expr_165 : Symbol(_View_AppComponent0._expr_165, Decl(complexNarrowingWithAny.ts, 424, 28)) + + /*private*/ _expr_166:any; +>_expr_166 : Symbol(_View_AppComponent0._expr_166, Decl(complexNarrowingWithAny.ts, 425, 28)) + + /*private*/ _expr_167:any; +>_expr_167 : Symbol(_View_AppComponent0._expr_167, Decl(complexNarrowingWithAny.ts, 426, 28)) + + /*private*/ _expr_168:any; +>_expr_168 : Symbol(_View_AppComponent0._expr_168, Decl(complexNarrowingWithAny.ts, 427, 28)) + + /*private*/ _expr_169:any; +>_expr_169 : Symbol(_View_AppComponent0._expr_169, Decl(complexNarrowingWithAny.ts, 428, 28)) + + /*private*/ _expr_170:any; +>_expr_170 : Symbol(_View_AppComponent0._expr_170, Decl(complexNarrowingWithAny.ts, 429, 28)) + + /*private*/ _expr_173:any; +>_expr_173 : Symbol(_View_AppComponent0._expr_173, Decl(complexNarrowingWithAny.ts, 430, 28)) + + /*private*/ _expr_174:any; +>_expr_174 : Symbol(_View_AppComponent0._expr_174, Decl(complexNarrowingWithAny.ts, 431, 28)) + + /*private*/ _expr_175:any; +>_expr_175 : Symbol(_View_AppComponent0._expr_175, Decl(complexNarrowingWithAny.ts, 432, 28)) + + /*private*/ _expr_176:any; +>_expr_176 : Symbol(_View_AppComponent0._expr_176, Decl(complexNarrowingWithAny.ts, 433, 28)) + + /*private*/ _expr_177:any; +>_expr_177 : Symbol(_View_AppComponent0._expr_177, Decl(complexNarrowingWithAny.ts, 434, 28)) + + /*private*/ _expr_178:any; +>_expr_178 : Symbol(_View_AppComponent0._expr_178, Decl(complexNarrowingWithAny.ts, 435, 28)) + + /*private*/ _expr_179:any; +>_expr_179 : Symbol(_View_AppComponent0._expr_179, Decl(complexNarrowingWithAny.ts, 436, 28)) + + /*private*/ _expr_182:any; +>_expr_182 : Symbol(_View_AppComponent0._expr_182, Decl(complexNarrowingWithAny.ts, 437, 28)) + + /*private*/ _expr_183:any; +>_expr_183 : Symbol(_View_AppComponent0._expr_183, Decl(complexNarrowingWithAny.ts, 438, 28)) + + /*private*/ _expr_184:any; +>_expr_184 : Symbol(_View_AppComponent0._expr_184, Decl(complexNarrowingWithAny.ts, 439, 28)) + + /*private*/ _expr_185:any; +>_expr_185 : Symbol(_View_AppComponent0._expr_185, Decl(complexNarrowingWithAny.ts, 440, 28)) + + /*private*/ _expr_186:any; +>_expr_186 : Symbol(_View_AppComponent0._expr_186, Decl(complexNarrowingWithAny.ts, 441, 28)) + + /*private*/ _expr_187:any; +>_expr_187 : Symbol(_View_AppComponent0._expr_187, Decl(complexNarrowingWithAny.ts, 442, 28)) + + /*private*/ _expr_188:any; +>_expr_188 : Symbol(_View_AppComponent0._expr_188, Decl(complexNarrowingWithAny.ts, 443, 28)) + + constructor(viewUtils:any,parentInjector:any,declarationEl:any) { +>viewUtils : Symbol(viewUtils, Decl(complexNarrowingWithAny.ts, 445, 14)) +>parentInjector : Symbol(parentInjector, Decl(complexNarrowingWithAny.ts, 445, 28)) +>declarationEl : Symbol(declarationEl, Decl(complexNarrowingWithAny.ts, 445, 47)) + } + + injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { +>injectorGetInternal : Symbol(_View_AppComponent0.injectorGetInternal, Decl(complexNarrowingWithAny.ts, 446, 3)) +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>notFoundResult : Symbol(notFoundResult, Decl(complexNarrowingWithAny.ts, 448, 56)) + + if (((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex))) { return this._DefaultValueAccessor_3_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_3_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_3_3, Decl(complexNarrowingWithAny.ts, 137, 12)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_3_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_3_3, Decl(complexNarrowingWithAny.ts, 137, 12)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_3_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_3_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_3_4, Decl(complexNarrowingWithAny.ts, 138, 58)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_3_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_3_4, Decl(complexNarrowingWithAny.ts, 138, 58)) + + if (((token === import47.FormControlName) && (3 === requestNodeIndex))) { return this._FormControlName_3_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_3_5 : Symbol(_View_AppComponent0._FormControlName_3_5, Decl(complexNarrowingWithAny.ts, 139, 31)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_3_5 : Symbol(_View_AppComponent0._FormControlName_3_5, Decl(complexNarrowingWithAny.ts, 139, 31)) + + if (((token === import50.NgControl) && (3 === requestNodeIndex))) { return this._NgControl_3_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_3_6 : Symbol(_View_AppComponent0._NgControl_3_6, Decl(complexNarrowingWithAny.ts, 140, 48)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_3_6 : Symbol(_View_AppComponent0._NgControl_3_6, Decl(complexNarrowingWithAny.ts, 140, 48)) + + if (((token === import45.NgControlStatus) && (3 === requestNodeIndex))) { return this._NgControlStatus_3_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_3_7 : Symbol(_View_AppComponent0._NgControlStatus_3_7, Decl(complexNarrowingWithAny.ts, 141, 21)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_3_7 : Symbol(_View_AppComponent0._NgControlStatus_3_7, Decl(complexNarrowingWithAny.ts, 141, 21)) + + if (((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex))) { return this._DefaultValueAccessor_6_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_6_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_6_3, Decl(complexNarrowingWithAny.ts, 145, 12)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_6_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_6_3, Decl(complexNarrowingWithAny.ts, 145, 12)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_6_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_6_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_6_4, Decl(complexNarrowingWithAny.ts, 146, 58)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_6_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_6_4, Decl(complexNarrowingWithAny.ts, 146, 58)) + + if (((token === import47.FormControlName) && (6 === requestNodeIndex))) { return this._FormControlName_6_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_6_5 : Symbol(_View_AppComponent0._FormControlName_6_5, Decl(complexNarrowingWithAny.ts, 147, 31)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_6_5 : Symbol(_View_AppComponent0._FormControlName_6_5, Decl(complexNarrowingWithAny.ts, 147, 31)) + + if (((token === import50.NgControl) && (6 === requestNodeIndex))) { return this._NgControl_6_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_6_6 : Symbol(_View_AppComponent0._NgControl_6_6, Decl(complexNarrowingWithAny.ts, 148, 48)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_6_6 : Symbol(_View_AppComponent0._NgControl_6_6, Decl(complexNarrowingWithAny.ts, 148, 48)) + + if (((token === import45.NgControlStatus) && (6 === requestNodeIndex))) { return this._NgControlStatus_6_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_6_7 : Symbol(_View_AppComponent0._NgControlStatus_6_7, Decl(complexNarrowingWithAny.ts, 149, 21)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_6_7 : Symbol(_View_AppComponent0._NgControlStatus_6_7, Decl(complexNarrowingWithAny.ts, 149, 21)) + + if (((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex))) { return this._DefaultValueAccessor_9_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_9_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_9_3, Decl(complexNarrowingWithAny.ts, 153, 12)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_9_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_9_3, Decl(complexNarrowingWithAny.ts, 153, 12)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_9_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_9_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_9_4, Decl(complexNarrowingWithAny.ts, 154, 58)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_9_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_9_4, Decl(complexNarrowingWithAny.ts, 154, 58)) + + if (((token === import47.FormControlName) && (9 === requestNodeIndex))) { return this._FormControlName_9_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_9_5 : Symbol(_View_AppComponent0._FormControlName_9_5, Decl(complexNarrowingWithAny.ts, 155, 31)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_9_5 : Symbol(_View_AppComponent0._FormControlName_9_5, Decl(complexNarrowingWithAny.ts, 155, 31)) + + if (((token === import50.NgControl) && (9 === requestNodeIndex))) { return this._NgControl_9_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_9_6 : Symbol(_View_AppComponent0._NgControl_9_6, Decl(complexNarrowingWithAny.ts, 156, 48)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_9_6 : Symbol(_View_AppComponent0._NgControl_9_6, Decl(complexNarrowingWithAny.ts, 156, 48)) + + if (((token === import45.NgControlStatus) && (9 === requestNodeIndex))) { return this._NgControlStatus_9_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_9_7 : Symbol(_View_AppComponent0._NgControlStatus_9_7, Decl(complexNarrowingWithAny.ts, 157, 21)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_9_7 : Symbol(_View_AppComponent0._NgControlStatus_9_7, Decl(complexNarrowingWithAny.ts, 157, 21)) + + if (((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex))) { return this._DefaultValueAccessor_12_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_12_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_12_3, Decl(complexNarrowingWithAny.ts, 161, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_12_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_12_3, Decl(complexNarrowingWithAny.ts, 161, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_12_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_12_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_12_4, Decl(complexNarrowingWithAny.ts, 162, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_12_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_12_4, Decl(complexNarrowingWithAny.ts, 162, 59)) + + if (((token === import47.FormControlName) && (12 === requestNodeIndex))) { return this._FormControlName_12_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_12_5 : Symbol(_View_AppComponent0._FormControlName_12_5, Decl(complexNarrowingWithAny.ts, 163, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_12_5 : Symbol(_View_AppComponent0._FormControlName_12_5, Decl(complexNarrowingWithAny.ts, 163, 32)) + + if (((token === import50.NgControl) && (12 === requestNodeIndex))) { return this._NgControl_12_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_12_6 : Symbol(_View_AppComponent0._NgControl_12_6, Decl(complexNarrowingWithAny.ts, 164, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_12_6 : Symbol(_View_AppComponent0._NgControl_12_6, Decl(complexNarrowingWithAny.ts, 164, 49)) + + if (((token === import45.NgControlStatus) && (12 === requestNodeIndex))) { return this._NgControlStatus_12_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_12_7 : Symbol(_View_AppComponent0._NgControlStatus_12_7, Decl(complexNarrowingWithAny.ts, 165, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_12_7 : Symbol(_View_AppComponent0._NgControlStatus_12_7, Decl(complexNarrowingWithAny.ts, 165, 22)) + + if (((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex))) { return this._DefaultValueAccessor_15_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_15_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_15_3, Decl(complexNarrowingWithAny.ts, 169, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_15_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_15_3, Decl(complexNarrowingWithAny.ts, 169, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_15_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_15_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_15_4, Decl(complexNarrowingWithAny.ts, 170, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_15_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_15_4, Decl(complexNarrowingWithAny.ts, 170, 59)) + + if (((token === import47.FormControlName) && (15 === requestNodeIndex))) { return this._FormControlName_15_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_15_5 : Symbol(_View_AppComponent0._FormControlName_15_5, Decl(complexNarrowingWithAny.ts, 171, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_15_5 : Symbol(_View_AppComponent0._FormControlName_15_5, Decl(complexNarrowingWithAny.ts, 171, 32)) + + if (((token === import50.NgControl) && (15 === requestNodeIndex))) { return this._NgControl_15_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_15_6 : Symbol(_View_AppComponent0._NgControl_15_6, Decl(complexNarrowingWithAny.ts, 172, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_15_6 : Symbol(_View_AppComponent0._NgControl_15_6, Decl(complexNarrowingWithAny.ts, 172, 49)) + + if (((token === import45.NgControlStatus) && (15 === requestNodeIndex))) { return this._NgControlStatus_15_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_15_7 : Symbol(_View_AppComponent0._NgControlStatus_15_7, Decl(complexNarrowingWithAny.ts, 173, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_15_7 : Symbol(_View_AppComponent0._NgControlStatus_15_7, Decl(complexNarrowingWithAny.ts, 173, 22)) + + if (((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex))) { return this._DefaultValueAccessor_18_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_18_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_18_3, Decl(complexNarrowingWithAny.ts, 177, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_18_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_18_3, Decl(complexNarrowingWithAny.ts, 177, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_18_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_18_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_18_4, Decl(complexNarrowingWithAny.ts, 178, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_18_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_18_4, Decl(complexNarrowingWithAny.ts, 178, 59)) + + if (((token === import47.FormControlName) && (18 === requestNodeIndex))) { return this._FormControlName_18_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_18_5 : Symbol(_View_AppComponent0._FormControlName_18_5, Decl(complexNarrowingWithAny.ts, 179, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_18_5 : Symbol(_View_AppComponent0._FormControlName_18_5, Decl(complexNarrowingWithAny.ts, 179, 32)) + + if (((token === import50.NgControl) && (18 === requestNodeIndex))) { return this._NgControl_18_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_18_6 : Symbol(_View_AppComponent0._NgControl_18_6, Decl(complexNarrowingWithAny.ts, 180, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_18_6 : Symbol(_View_AppComponent0._NgControl_18_6, Decl(complexNarrowingWithAny.ts, 180, 49)) + + if (((token === import45.NgControlStatus) && (18 === requestNodeIndex))) { return this._NgControlStatus_18_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_18_7 : Symbol(_View_AppComponent0._NgControlStatus_18_7, Decl(complexNarrowingWithAny.ts, 181, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_18_7 : Symbol(_View_AppComponent0._NgControlStatus_18_7, Decl(complexNarrowingWithAny.ts, 181, 22)) + + if (((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex))) { return this._DefaultValueAccessor_21_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_21_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_21_3, Decl(complexNarrowingWithAny.ts, 185, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_21_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_21_3, Decl(complexNarrowingWithAny.ts, 185, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_21_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_21_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_21_4, Decl(complexNarrowingWithAny.ts, 186, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_21_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_21_4, Decl(complexNarrowingWithAny.ts, 186, 59)) + + if (((token === import47.FormControlName) && (21 === requestNodeIndex))) { return this._FormControlName_21_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_21_5 : Symbol(_View_AppComponent0._FormControlName_21_5, Decl(complexNarrowingWithAny.ts, 187, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_21_5 : Symbol(_View_AppComponent0._FormControlName_21_5, Decl(complexNarrowingWithAny.ts, 187, 32)) + + if (((token === import50.NgControl) && (21 === requestNodeIndex))) { return this._NgControl_21_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_21_6 : Symbol(_View_AppComponent0._NgControl_21_6, Decl(complexNarrowingWithAny.ts, 188, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_21_6 : Symbol(_View_AppComponent0._NgControl_21_6, Decl(complexNarrowingWithAny.ts, 188, 49)) + + if (((token === import45.NgControlStatus) && (21 === requestNodeIndex))) { return this._NgControlStatus_21_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_21_7 : Symbol(_View_AppComponent0._NgControlStatus_21_7, Decl(complexNarrowingWithAny.ts, 189, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_21_7 : Symbol(_View_AppComponent0._NgControlStatus_21_7, Decl(complexNarrowingWithAny.ts, 189, 22)) + + if (((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex))) { return this._DefaultValueAccessor_24_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_24_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_24_3, Decl(complexNarrowingWithAny.ts, 193, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_24_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_24_3, Decl(complexNarrowingWithAny.ts, 193, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_24_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_24_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_24_4, Decl(complexNarrowingWithAny.ts, 194, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_24_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_24_4, Decl(complexNarrowingWithAny.ts, 194, 59)) + + if (((token === import47.FormControlName) && (24 === requestNodeIndex))) { return this._FormControlName_24_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_24_5 : Symbol(_View_AppComponent0._FormControlName_24_5, Decl(complexNarrowingWithAny.ts, 195, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_24_5 : Symbol(_View_AppComponent0._FormControlName_24_5, Decl(complexNarrowingWithAny.ts, 195, 32)) + + if (((token === import50.NgControl) && (24 === requestNodeIndex))) { return this._NgControl_24_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_24_6 : Symbol(_View_AppComponent0._NgControl_24_6, Decl(complexNarrowingWithAny.ts, 196, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_24_6 : Symbol(_View_AppComponent0._NgControl_24_6, Decl(complexNarrowingWithAny.ts, 196, 49)) + + if (((token === import45.NgControlStatus) && (24 === requestNodeIndex))) { return this._NgControlStatus_24_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_24_7 : Symbol(_View_AppComponent0._NgControlStatus_24_7, Decl(complexNarrowingWithAny.ts, 197, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_24_7 : Symbol(_View_AppComponent0._NgControlStatus_24_7, Decl(complexNarrowingWithAny.ts, 197, 22)) + + if (((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex))) { return this._DefaultValueAccessor_27_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_27_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_27_3, Decl(complexNarrowingWithAny.ts, 201, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_27_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_27_3, Decl(complexNarrowingWithAny.ts, 201, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_27_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_27_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_27_4, Decl(complexNarrowingWithAny.ts, 202, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_27_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_27_4, Decl(complexNarrowingWithAny.ts, 202, 59)) + + if (((token === import47.FormControlName) && (27 === requestNodeIndex))) { return this._FormControlName_27_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_27_5 : Symbol(_View_AppComponent0._FormControlName_27_5, Decl(complexNarrowingWithAny.ts, 203, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_27_5 : Symbol(_View_AppComponent0._FormControlName_27_5, Decl(complexNarrowingWithAny.ts, 203, 32)) + + if (((token === import50.NgControl) && (27 === requestNodeIndex))) { return this._NgControl_27_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_27_6 : Symbol(_View_AppComponent0._NgControl_27_6, Decl(complexNarrowingWithAny.ts, 204, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_27_6 : Symbol(_View_AppComponent0._NgControl_27_6, Decl(complexNarrowingWithAny.ts, 204, 49)) + + if (((token === import45.NgControlStatus) && (27 === requestNodeIndex))) { return this._NgControlStatus_27_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_27_7 : Symbol(_View_AppComponent0._NgControlStatus_27_7, Decl(complexNarrowingWithAny.ts, 205, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_27_7 : Symbol(_View_AppComponent0._NgControlStatus_27_7, Decl(complexNarrowingWithAny.ts, 205, 22)) + + if (((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex))) { return this._DefaultValueAccessor_30_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_30_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_30_3, Decl(complexNarrowingWithAny.ts, 209, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_30_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_30_3, Decl(complexNarrowingWithAny.ts, 209, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_30_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_30_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_30_4, Decl(complexNarrowingWithAny.ts, 210, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_30_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_30_4, Decl(complexNarrowingWithAny.ts, 210, 59)) + + if (((token === import47.FormControlName) && (30 === requestNodeIndex))) { return this._FormControlName_30_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_30_5 : Symbol(_View_AppComponent0._FormControlName_30_5, Decl(complexNarrowingWithAny.ts, 211, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_30_5 : Symbol(_View_AppComponent0._FormControlName_30_5, Decl(complexNarrowingWithAny.ts, 211, 32)) + + if (((token === import50.NgControl) && (30 === requestNodeIndex))) { return this._NgControl_30_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_30_6 : Symbol(_View_AppComponent0._NgControl_30_6, Decl(complexNarrowingWithAny.ts, 212, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_30_6 : Symbol(_View_AppComponent0._NgControl_30_6, Decl(complexNarrowingWithAny.ts, 212, 49)) + + if (((token === import45.NgControlStatus) && (30 === requestNodeIndex))) { return this._NgControlStatus_30_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_30_7 : Symbol(_View_AppComponent0._NgControlStatus_30_7, Decl(complexNarrowingWithAny.ts, 213, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_30_7 : Symbol(_View_AppComponent0._NgControlStatus_30_7, Decl(complexNarrowingWithAny.ts, 213, 22)) + + if (((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex))) { return this._DefaultValueAccessor_33_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_33_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_33_3, Decl(complexNarrowingWithAny.ts, 217, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_33_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_33_3, Decl(complexNarrowingWithAny.ts, 217, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_33_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_33_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_33_4, Decl(complexNarrowingWithAny.ts, 218, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_33_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_33_4, Decl(complexNarrowingWithAny.ts, 218, 59)) + + if (((token === import47.FormControlName) && (33 === requestNodeIndex))) { return this._FormControlName_33_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_33_5 : Symbol(_View_AppComponent0._FormControlName_33_5, Decl(complexNarrowingWithAny.ts, 219, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_33_5 : Symbol(_View_AppComponent0._FormControlName_33_5, Decl(complexNarrowingWithAny.ts, 219, 32)) + + if (((token === import50.NgControl) && (33 === requestNodeIndex))) { return this._NgControl_33_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_33_6 : Symbol(_View_AppComponent0._NgControl_33_6, Decl(complexNarrowingWithAny.ts, 220, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_33_6 : Symbol(_View_AppComponent0._NgControl_33_6, Decl(complexNarrowingWithAny.ts, 220, 49)) + + if (((token === import45.NgControlStatus) && (33 === requestNodeIndex))) { return this._NgControlStatus_33_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_33_7 : Symbol(_View_AppComponent0._NgControlStatus_33_7, Decl(complexNarrowingWithAny.ts, 221, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_33_7 : Symbol(_View_AppComponent0._NgControlStatus_33_7, Decl(complexNarrowingWithAny.ts, 221, 22)) + + if (((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex))) { return this._DefaultValueAccessor_36_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_36_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_36_3, Decl(complexNarrowingWithAny.ts, 225, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_36_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_36_3, Decl(complexNarrowingWithAny.ts, 225, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_36_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_36_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_36_4, Decl(complexNarrowingWithAny.ts, 226, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_36_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_36_4, Decl(complexNarrowingWithAny.ts, 226, 59)) + + if (((token === import47.FormControlName) && (36 === requestNodeIndex))) { return this._FormControlName_36_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_36_5 : Symbol(_View_AppComponent0._FormControlName_36_5, Decl(complexNarrowingWithAny.ts, 227, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_36_5 : Symbol(_View_AppComponent0._FormControlName_36_5, Decl(complexNarrowingWithAny.ts, 227, 32)) + + if (((token === import50.NgControl) && (36 === requestNodeIndex))) { return this._NgControl_36_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_36_6 : Symbol(_View_AppComponent0._NgControl_36_6, Decl(complexNarrowingWithAny.ts, 228, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_36_6 : Symbol(_View_AppComponent0._NgControl_36_6, Decl(complexNarrowingWithAny.ts, 228, 49)) + + if (((token === import45.NgControlStatus) && (36 === requestNodeIndex))) { return this._NgControlStatus_36_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_36_7 : Symbol(_View_AppComponent0._NgControlStatus_36_7, Decl(complexNarrowingWithAny.ts, 229, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_36_7 : Symbol(_View_AppComponent0._NgControlStatus_36_7, Decl(complexNarrowingWithAny.ts, 229, 22)) + + if (((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex))) { return this._DefaultValueAccessor_39_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_39_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_39_3, Decl(complexNarrowingWithAny.ts, 233, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_39_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_39_3, Decl(complexNarrowingWithAny.ts, 233, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_39_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_39_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_39_4, Decl(complexNarrowingWithAny.ts, 234, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_39_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_39_4, Decl(complexNarrowingWithAny.ts, 234, 59)) + + if (((token === import47.FormControlName) && (39 === requestNodeIndex))) { return this._FormControlName_39_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_39_5 : Symbol(_View_AppComponent0._FormControlName_39_5, Decl(complexNarrowingWithAny.ts, 235, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_39_5 : Symbol(_View_AppComponent0._FormControlName_39_5, Decl(complexNarrowingWithAny.ts, 235, 32)) + + if (((token === import50.NgControl) && (39 === requestNodeIndex))) { return this._NgControl_39_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_39_6 : Symbol(_View_AppComponent0._NgControl_39_6, Decl(complexNarrowingWithAny.ts, 236, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_39_6 : Symbol(_View_AppComponent0._NgControl_39_6, Decl(complexNarrowingWithAny.ts, 236, 49)) + + if (((token === import45.NgControlStatus) && (39 === requestNodeIndex))) { return this._NgControlStatus_39_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_39_7 : Symbol(_View_AppComponent0._NgControlStatus_39_7, Decl(complexNarrowingWithAny.ts, 237, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_39_7 : Symbol(_View_AppComponent0._NgControlStatus_39_7, Decl(complexNarrowingWithAny.ts, 237, 22)) + + if (((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex))) { return this._DefaultValueAccessor_42_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_42_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_42_3, Decl(complexNarrowingWithAny.ts, 241, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_42_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_42_3, Decl(complexNarrowingWithAny.ts, 241, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_42_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_42_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_42_4, Decl(complexNarrowingWithAny.ts, 242, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_42_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_42_4, Decl(complexNarrowingWithAny.ts, 242, 59)) + + if (((token === import47.FormControlName) && (42 === requestNodeIndex))) { return this._FormControlName_42_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_42_5 : Symbol(_View_AppComponent0._FormControlName_42_5, Decl(complexNarrowingWithAny.ts, 243, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_42_5 : Symbol(_View_AppComponent0._FormControlName_42_5, Decl(complexNarrowingWithAny.ts, 243, 32)) + + if (((token === import50.NgControl) && (42 === requestNodeIndex))) { return this._NgControl_42_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_42_6 : Symbol(_View_AppComponent0._NgControl_42_6, Decl(complexNarrowingWithAny.ts, 244, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_42_6 : Symbol(_View_AppComponent0._NgControl_42_6, Decl(complexNarrowingWithAny.ts, 244, 49)) + + if (((token === import45.NgControlStatus) && (42 === requestNodeIndex))) { return this._NgControlStatus_42_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_42_7 : Symbol(_View_AppComponent0._NgControlStatus_42_7, Decl(complexNarrowingWithAny.ts, 245, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_42_7 : Symbol(_View_AppComponent0._NgControlStatus_42_7, Decl(complexNarrowingWithAny.ts, 245, 22)) + + if (((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex))) { return this._DefaultValueAccessor_45_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_45_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_45_3, Decl(complexNarrowingWithAny.ts, 249, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_45_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_45_3, Decl(complexNarrowingWithAny.ts, 249, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_45_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_45_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_45_4, Decl(complexNarrowingWithAny.ts, 250, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_45_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_45_4, Decl(complexNarrowingWithAny.ts, 250, 59)) + + if (((token === import47.FormControlName) && (45 === requestNodeIndex))) { return this._FormControlName_45_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_45_5 : Symbol(_View_AppComponent0._FormControlName_45_5, Decl(complexNarrowingWithAny.ts, 251, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_45_5 : Symbol(_View_AppComponent0._FormControlName_45_5, Decl(complexNarrowingWithAny.ts, 251, 32)) + + if (((token === import50.NgControl) && (45 === requestNodeIndex))) { return this._NgControl_45_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_45_6 : Symbol(_View_AppComponent0._NgControl_45_6, Decl(complexNarrowingWithAny.ts, 252, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_45_6 : Symbol(_View_AppComponent0._NgControl_45_6, Decl(complexNarrowingWithAny.ts, 252, 49)) + + if (((token === import45.NgControlStatus) && (45 === requestNodeIndex))) { return this._NgControlStatus_45_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_45_7 : Symbol(_View_AppComponent0._NgControlStatus_45_7, Decl(complexNarrowingWithAny.ts, 253, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_45_7 : Symbol(_View_AppComponent0._NgControlStatus_45_7, Decl(complexNarrowingWithAny.ts, 253, 22)) + + if (((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex))) { return this._DefaultValueAccessor_48_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_48_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_48_3, Decl(complexNarrowingWithAny.ts, 257, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_48_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_48_3, Decl(complexNarrowingWithAny.ts, 257, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_48_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_48_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_48_4, Decl(complexNarrowingWithAny.ts, 258, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_48_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_48_4, Decl(complexNarrowingWithAny.ts, 258, 59)) + + if (((token === import47.FormControlName) && (48 === requestNodeIndex))) { return this._FormControlName_48_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_48_5 : Symbol(_View_AppComponent0._FormControlName_48_5, Decl(complexNarrowingWithAny.ts, 259, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_48_5 : Symbol(_View_AppComponent0._FormControlName_48_5, Decl(complexNarrowingWithAny.ts, 259, 32)) + + if (((token === import50.NgControl) && (48 === requestNodeIndex))) { return this._NgControl_48_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_48_6 : Symbol(_View_AppComponent0._NgControl_48_6, Decl(complexNarrowingWithAny.ts, 260, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_48_6 : Symbol(_View_AppComponent0._NgControl_48_6, Decl(complexNarrowingWithAny.ts, 260, 49)) + + if (((token === import45.NgControlStatus) && (48 === requestNodeIndex))) { return this._NgControlStatus_48_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_48_7 : Symbol(_View_AppComponent0._NgControlStatus_48_7, Decl(complexNarrowingWithAny.ts, 261, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_48_7 : Symbol(_View_AppComponent0._NgControlStatus_48_7, Decl(complexNarrowingWithAny.ts, 261, 22)) + + if (((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex))) { return this._DefaultValueAccessor_51_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_51_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_51_3, Decl(complexNarrowingWithAny.ts, 265, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_51_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_51_3, Decl(complexNarrowingWithAny.ts, 265, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_51_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_51_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_51_4, Decl(complexNarrowingWithAny.ts, 266, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_51_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_51_4, Decl(complexNarrowingWithAny.ts, 266, 59)) + + if (((token === import47.FormControlName) && (51 === requestNodeIndex))) { return this._FormControlName_51_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_51_5 : Symbol(_View_AppComponent0._FormControlName_51_5, Decl(complexNarrowingWithAny.ts, 267, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_51_5 : Symbol(_View_AppComponent0._FormControlName_51_5, Decl(complexNarrowingWithAny.ts, 267, 32)) + + if (((token === import50.NgControl) && (51 === requestNodeIndex))) { return this._NgControl_51_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_51_6 : Symbol(_View_AppComponent0._NgControl_51_6, Decl(complexNarrowingWithAny.ts, 268, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_51_6 : Symbol(_View_AppComponent0._NgControl_51_6, Decl(complexNarrowingWithAny.ts, 268, 49)) + + if (((token === import45.NgControlStatus) && (51 === requestNodeIndex))) { return this._NgControlStatus_51_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_51_7 : Symbol(_View_AppComponent0._NgControlStatus_51_7, Decl(complexNarrowingWithAny.ts, 269, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_51_7 : Symbol(_View_AppComponent0._NgControlStatus_51_7, Decl(complexNarrowingWithAny.ts, 269, 22)) + + if (((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex))) { return this._DefaultValueAccessor_54_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_54_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_54_3, Decl(complexNarrowingWithAny.ts, 273, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_54_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_54_3, Decl(complexNarrowingWithAny.ts, 273, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_54_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_54_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_54_4, Decl(complexNarrowingWithAny.ts, 274, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_54_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_54_4, Decl(complexNarrowingWithAny.ts, 274, 59)) + + if (((token === import47.FormControlName) && (54 === requestNodeIndex))) { return this._FormControlName_54_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_54_5 : Symbol(_View_AppComponent0._FormControlName_54_5, Decl(complexNarrowingWithAny.ts, 275, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_54_5 : Symbol(_View_AppComponent0._FormControlName_54_5, Decl(complexNarrowingWithAny.ts, 275, 32)) + + if (((token === import50.NgControl) && (54 === requestNodeIndex))) { return this._NgControl_54_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_54_6 : Symbol(_View_AppComponent0._NgControl_54_6, Decl(complexNarrowingWithAny.ts, 276, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_54_6 : Symbol(_View_AppComponent0._NgControl_54_6, Decl(complexNarrowingWithAny.ts, 276, 49)) + + if (((token === import45.NgControlStatus) && (54 === requestNodeIndex))) { return this._NgControlStatus_54_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_54_7 : Symbol(_View_AppComponent0._NgControlStatus_54_7, Decl(complexNarrowingWithAny.ts, 277, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_54_7 : Symbol(_View_AppComponent0._NgControlStatus_54_7, Decl(complexNarrowingWithAny.ts, 277, 22)) + + if (((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex))) { return this._DefaultValueAccessor_57_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_57_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_57_3, Decl(complexNarrowingWithAny.ts, 281, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_57_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_57_3, Decl(complexNarrowingWithAny.ts, 281, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_57_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_57_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_57_4, Decl(complexNarrowingWithAny.ts, 282, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_57_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_57_4, Decl(complexNarrowingWithAny.ts, 282, 59)) + + if (((token === import47.FormControlName) && (57 === requestNodeIndex))) { return this._FormControlName_57_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_57_5 : Symbol(_View_AppComponent0._FormControlName_57_5, Decl(complexNarrowingWithAny.ts, 283, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_57_5 : Symbol(_View_AppComponent0._FormControlName_57_5, Decl(complexNarrowingWithAny.ts, 283, 32)) + + if (((token === import50.NgControl) && (57 === requestNodeIndex))) { return this._NgControl_57_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_57_6 : Symbol(_View_AppComponent0._NgControl_57_6, Decl(complexNarrowingWithAny.ts, 284, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_57_6 : Symbol(_View_AppComponent0._NgControl_57_6, Decl(complexNarrowingWithAny.ts, 284, 49)) + + if (((token === import45.NgControlStatus) && (57 === requestNodeIndex))) { return this._NgControlStatus_57_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_57_7 : Symbol(_View_AppComponent0._NgControlStatus_57_7, Decl(complexNarrowingWithAny.ts, 285, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_57_7 : Symbol(_View_AppComponent0._NgControlStatus_57_7, Decl(complexNarrowingWithAny.ts, 285, 22)) + + if (((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex))) { return this._DefaultValueAccessor_60_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_60_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_60_3, Decl(complexNarrowingWithAny.ts, 289, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_60_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_60_3, Decl(complexNarrowingWithAny.ts, 289, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_60_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_60_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_60_4, Decl(complexNarrowingWithAny.ts, 290, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_60_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_60_4, Decl(complexNarrowingWithAny.ts, 290, 59)) + + if (((token === import47.FormControlName) && (60 === requestNodeIndex))) { return this._FormControlName_60_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_60_5 : Symbol(_View_AppComponent0._FormControlName_60_5, Decl(complexNarrowingWithAny.ts, 291, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_60_5 : Symbol(_View_AppComponent0._FormControlName_60_5, Decl(complexNarrowingWithAny.ts, 291, 32)) + + if (((token === import50.NgControl) && (60 === requestNodeIndex))) { return this._NgControl_60_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_60_6 : Symbol(_View_AppComponent0._NgControl_60_6, Decl(complexNarrowingWithAny.ts, 292, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_60_6 : Symbol(_View_AppComponent0._NgControl_60_6, Decl(complexNarrowingWithAny.ts, 292, 49)) + + if (((token === import45.NgControlStatus) && (60 === requestNodeIndex))) { return this._NgControlStatus_60_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_60_7 : Symbol(_View_AppComponent0._NgControlStatus_60_7, Decl(complexNarrowingWithAny.ts, 293, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_60_7 : Symbol(_View_AppComponent0._NgControlStatus_60_7, Decl(complexNarrowingWithAny.ts, 293, 22)) + + if (((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._FormGroupDirective_1_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import44.FormGroupDirective : Symbol(import44.FormGroupDirective, Decl(complexNarrowingWithAny.ts, 63, 20)) +>import44 : Symbol(import44, Decl(complexNarrowingWithAny.ts, 0, 0)) +>FormGroupDirective : Symbol(import44.FormGroupDirective, Decl(complexNarrowingWithAny.ts, 63, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormGroupDirective_1_3 : Symbol(_View_AppComponent0._FormGroupDirective_1_3, Decl(complexNarrowingWithAny.ts, 132, 12)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormGroupDirective_1_3 : Symbol(_View_AppComponent0._FormGroupDirective_1_3, Decl(complexNarrowingWithAny.ts, 132, 12)) + + if (((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._ControlContainer_1_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import51.ControlContainer : Symbol(import51.ControlContainer, Decl(complexNarrowingWithAny.ts, 122, 20)) +>import51 : Symbol(import51, Decl(complexNarrowingWithAny.ts, 120, 1)) +>ControlContainer : Symbol(import51.ControlContainer, Decl(complexNarrowingWithAny.ts, 122, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._ControlContainer_1_4 : Symbol(_View_AppComponent0._ControlContainer_1_4, Decl(complexNarrowingWithAny.ts, 133, 54)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_ControlContainer_1_4 : Symbol(_View_AppComponent0._ControlContainer_1_4, Decl(complexNarrowingWithAny.ts, 133, 54)) + + if (((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._NgControlStatusGroup_1_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatusGroup : Symbol(import45.NgControlStatusGroup, Decl(complexNarrowingWithAny.ts, 72, 2)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatusGroup : Symbol(import45.NgControlStatusGroup, Decl(complexNarrowingWithAny.ts, 72, 2)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatusGroup_1_5 : Symbol(_View_AppComponent0._NgControlStatusGroup_1_5, Decl(complexNarrowingWithAny.ts, 134, 28)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatusGroup_1_5 : Symbol(_View_AppComponent0._NgControlStatusGroup_1_5, Decl(complexNarrowingWithAny.ts, 134, 28)) + + return notFoundResult; +>notFoundResult : Symbol(notFoundResult, Decl(complexNarrowingWithAny.ts, 448, 56)) + } +} +export function viewFactory_AppComponent0(viewUtils:any,parentInjector:any,declarationEl:any):any { +>viewFactory_AppComponent0 : Symbol(viewFactory_AppComponent0, Decl(complexNarrowingWithAny.ts, 554, 1)) +>viewUtils : Symbol(viewUtils, Decl(complexNarrowingWithAny.ts, 555, 42)) +>parentInjector : Symbol(parentInjector, Decl(complexNarrowingWithAny.ts, 555, 56)) +>declarationEl : Symbol(declarationEl, Decl(complexNarrowingWithAny.ts, 555, 75)) + + return new _View_AppComponent0(viewUtils,parentInjector,declarationEl); +>_View_AppComponent0 : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>viewUtils : Symbol(viewUtils, Decl(complexNarrowingWithAny.ts, 555, 42)) +>parentInjector : Symbol(parentInjector, Decl(complexNarrowingWithAny.ts, 555, 56)) +>declarationEl : Symbol(declarationEl, Decl(complexNarrowingWithAny.ts, 555, 75)) +} + diff --git a/tests/baselines/reference/complexNarrowingWithAny.types b/tests/baselines/reference/complexNarrowingWithAny.types new file mode 100644 index 00000000000..656621b7a7a --- /dev/null +++ b/tests/baselines/reference/complexNarrowingWithAny.types @@ -0,0 +1,3043 @@ +=== tests/cases/compiler/complexNarrowingWithAny.ts === +// Repro from #10869 + +/** + * This file is generated by the Angular 2 template compiler. + * Do not edit. + */ + /* tslint:disable */ + +// import * as import0 from '@angular/core/src/linker/ng_module_factory'; +// import * as import1 from '../../app'; +// import * as import2 from '@angular/common/src/common_module'; +// import * as import3 from '@angular/core/src/application_module'; +// import * as import4 from '@angular/platform-browser/src/browser'; +// import * as import5 from '@angular/forms/src/directives'; +// import * as import6 from '@angular/forms/src/form_providers'; +// import * as import7 from '@angular/common/src/localization'; +// import * as import8 from '@angular/core/src/application_init'; +// import * as import9 from '@angular/core/src/testability/testability'; +// import * as import10 from '@angular/core/src/application_ref'; +// import * as import11 from '@angular/core/src/linker/compiler'; +// import * as import12 from '@angular/platform-browser/src/dom/events/hammer_gestures'; +// import * as import13 from '@angular/platform-browser/src/dom/events/event_manager'; +// import * as import14 from '@angular/platform-browser/src/dom/shared_styles_host'; +// import * as import15 from '@angular/platform-browser/src/dom/dom_renderer'; +// import * as import16 from '@angular/platform-browser/src/security/dom_sanitization_service'; +// import * as import17 from '@angular/core/src/linker/view_utils'; +// import * as import18 from '@angular/forms/src/form_builder'; +// import * as import19 from '@angular/forms/src/directives/radio_control_value_accessor'; +// import * as import20 from '@angular/core/src/di/injector'; +// import * as import21 from '@angular/core/src/application_tokens'; +// import * as import22 from '@angular/platform-browser/src/dom/events/dom_events'; +// import * as import23 from '@angular/platform-browser/src/dom/events/key_events'; +// import * as import24 from '@angular/core/src/zone/ng_zone'; +// import * as import25 from '@angular/platform-browser/src/dom/debug/ng_probe'; +// import * as import26 from '@angular/core/src/console'; +// import * as import27 from '@angular/core/src/i18n/tokens'; +// import * as import28 from '@angular/core/src/error_handler'; +// import * as import29 from '@angular/platform-browser/src/dom/dom_tokens'; +// import * as import30 from '@angular/platform-browser/src/dom/animation_driver'; +// import * as import31 from '@angular/core/src/render/api'; +// import * as import32 from '@angular/core/src/security'; +// import * as import33 from '@angular/core/src/change_detection/differs/iterable_differs'; +// import * as import34 from '@angular/core/src/change_detection/differs/keyvalue_differs'; +// import * as import35 from '@angular/core/src/i18n/tokens'; +// import * as import36 from '@angular/core/src/render/api'; +// import * as import37 from '@angular/core/src/linker/view'; +// import * as import38 from '@angular/core/src/linker/element'; +// import * as import39 from '@angular/core/src/linker/view_utils'; +// import * as import40 from '@angular/core/src/linker/view_type'; +// import * as import41 from '@angular/core/src/change_detection/change_detection'; +// import * as import42 from '@angular/core/src/metadata/view'; +// import * as import43 from '@angular/core/src/linker/component_factory'; +// import * as import44 from '@angular/forms/src/directives/reactive_directives/form_group_directive'; +// import * as import45 from '@angular/forms/src/directives/ng_control_status'; +// import * as import46 from '@angular/forms/src/directives/default_value_accessor'; +// import * as import47 from '@angular/forms/src/directives/reactive_directives/form_control_name'; +// import * as import48 from '@angular/core/src/linker/element_ref'; +// import * as import49 from '@angular/forms/src/directives/control_value_accessor'; +// import * as import50 from '@angular/forms/src/directives/ng_control'; +// import * as import51 from '@angular/forms/src/directives/control_container'; + +//stubbed out imports + +namespace import44 { +>import44 : typeof import44 + + export class FormGroupDirective { +>FormGroupDirective : FormGroupDirective + + constructor(any){} +>any : any + } +} + +namespace import45 { +>import45 : typeof import45 + + export class NgControlStatus { +>NgControlStatus : NgControlStatus + + constructor(any){} +>any : any + } + export class NgControlStatusGroup { +>NgControlStatusGroup : NgControlStatusGroup + + constructor(any){} +>any : any + } +} + +namespace import46 { +>import46 : typeof import46 + + export class DefaultValueAccessor { +>DefaultValueAccessor : DefaultValueAccessor + + constructor(any){} +>any : any + } +} + +namespace import47 { +>import47 : typeof import47 + + export class FormControlName { +>FormControlName : FormControlName + + constructor(any){} +>any : any + } +} + +namespace import48 { +>import48 : typeof import48 + + export class FormControlName { +>FormControlName : FormControlName + + constructor(any){} +>any : any + } +} + + +//HERE BE DRAGONS + +//Using a value here - 65+ seconds to typecheck +namespace import49 { +>import49 : typeof import49 + + //real code uses an opaque token, using new String() to simulate. + //export var NG_VALUE_ACCESSOR = new OpaqueToken('ngValueAccessor') + export var NG_VALUE_ACCESSOR = new String('foo') +>NG_VALUE_ACCESSOR : String +>new String('foo') : String +>String : StringConstructor +>'foo' : "foo" +} + +//using a class - < 1 sec typecheck +// namespace import49 { +// export class NG_VALUE_ACCESSOR { +// constructor(any){} +// } +// } + +//END DRAGONS + + +namespace import50 { +>import50 : typeof import50 + + export class NgControl { +>NgControl : NgControl + + constructor(any){} +>any : any + } +} + +namespace import51 { +>import51 : typeof import51 + + export class ControlContainer { +>ControlContainer : ControlContainer + + constructor(any){} +>any : any + } +} + + + +class _View_AppComponent0 { +>_View_AppComponent0 : _View_AppComponent0 + + _text_0:any; +>_text_0 : any + + _el_1:any; +>_el_1 : any + + _FormGroupDirective_1_3:import44.FormGroupDirective; +>_FormGroupDirective_1_3 : import44.FormGroupDirective +>import44 : any +>FormGroupDirective : import44.FormGroupDirective + + _ControlContainer_1_4:any; +>_ControlContainer_1_4 : any + + _NgControlStatusGroup_1_5:import45.NgControlStatusGroup; +>_NgControlStatusGroup_1_5 : import45.NgControlStatusGroup +>import45 : any +>NgControlStatusGroup : import45.NgControlStatusGroup + + _text_2:any; +>_text_2 : any + + _el_3:any; +>_el_3 : any + + _DefaultValueAccessor_3_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_3_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_3_4:any[]; +>_NG_VALUE_ACCESSOR_3_4 : any[] + + _FormControlName_3_5:import47.FormControlName; +>_FormControlName_3_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_3_6:any; +>_NgControl_3_6 : any + + _NgControlStatus_3_7:import45.NgControlStatus; +>_NgControlStatus_3_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_4:any; +>_el_4 : any + + _text_5:any; +>_text_5 : any + + _el_6:any; +>_el_6 : any + + _DefaultValueAccessor_6_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_6_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_6_4:any[]; +>_NG_VALUE_ACCESSOR_6_4 : any[] + + _FormControlName_6_5:import47.FormControlName; +>_FormControlName_6_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_6_6:any; +>_NgControl_6_6 : any + + _NgControlStatus_6_7:import45.NgControlStatus; +>_NgControlStatus_6_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_7:any; +>_el_7 : any + + _text_8:any; +>_text_8 : any + + _el_9:any; +>_el_9 : any + + _DefaultValueAccessor_9_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_9_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_9_4:any[]; +>_NG_VALUE_ACCESSOR_9_4 : any[] + + _FormControlName_9_5:import47.FormControlName; +>_FormControlName_9_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_9_6:any; +>_NgControl_9_6 : any + + _NgControlStatus_9_7:import45.NgControlStatus; +>_NgControlStatus_9_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_10:any; +>_el_10 : any + + _text_11:any; +>_text_11 : any + + _el_12:any; +>_el_12 : any + + _DefaultValueAccessor_12_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_12_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_12_4:any[]; +>_NG_VALUE_ACCESSOR_12_4 : any[] + + _FormControlName_12_5:import47.FormControlName; +>_FormControlName_12_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_12_6:any; +>_NgControl_12_6 : any + + _NgControlStatus_12_7:import45.NgControlStatus; +>_NgControlStatus_12_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_13:any; +>_el_13 : any + + _text_14:any; +>_text_14 : any + + _el_15:any; +>_el_15 : any + + _DefaultValueAccessor_15_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_15_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_15_4:any[]; +>_NG_VALUE_ACCESSOR_15_4 : any[] + + _FormControlName_15_5:import47.FormControlName; +>_FormControlName_15_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_15_6:any; +>_NgControl_15_6 : any + + _NgControlStatus_15_7:import45.NgControlStatus; +>_NgControlStatus_15_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_16:any; +>_el_16 : any + + _text_17:any; +>_text_17 : any + + _el_18:any; +>_el_18 : any + + _DefaultValueAccessor_18_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_18_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_18_4:any[]; +>_NG_VALUE_ACCESSOR_18_4 : any[] + + _FormControlName_18_5:import47.FormControlName; +>_FormControlName_18_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_18_6:any; +>_NgControl_18_6 : any + + _NgControlStatus_18_7:import45.NgControlStatus; +>_NgControlStatus_18_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_19:any; +>_el_19 : any + + _text_20:any; +>_text_20 : any + + _el_21:any; +>_el_21 : any + + _DefaultValueAccessor_21_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_21_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_21_4:any[]; +>_NG_VALUE_ACCESSOR_21_4 : any[] + + _FormControlName_21_5:import47.FormControlName; +>_FormControlName_21_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_21_6:any; +>_NgControl_21_6 : any + + _NgControlStatus_21_7:import45.NgControlStatus; +>_NgControlStatus_21_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_22:any; +>_el_22 : any + + _text_23:any; +>_text_23 : any + + _el_24:any; +>_el_24 : any + + _DefaultValueAccessor_24_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_24_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_24_4:any[]; +>_NG_VALUE_ACCESSOR_24_4 : any[] + + _FormControlName_24_5:import47.FormControlName; +>_FormControlName_24_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_24_6:any; +>_NgControl_24_6 : any + + _NgControlStatus_24_7:import45.NgControlStatus; +>_NgControlStatus_24_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_25:any; +>_el_25 : any + + _text_26:any; +>_text_26 : any + + _el_27:any; +>_el_27 : any + + _DefaultValueAccessor_27_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_27_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_27_4:any[]; +>_NG_VALUE_ACCESSOR_27_4 : any[] + + _FormControlName_27_5:import47.FormControlName; +>_FormControlName_27_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_27_6:any; +>_NgControl_27_6 : any + + _NgControlStatus_27_7:import45.NgControlStatus; +>_NgControlStatus_27_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_28:any; +>_el_28 : any + + _text_29:any; +>_text_29 : any + + _el_30:any; +>_el_30 : any + + _DefaultValueAccessor_30_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_30_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_30_4:any[]; +>_NG_VALUE_ACCESSOR_30_4 : any[] + + _FormControlName_30_5:import47.FormControlName; +>_FormControlName_30_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_30_6:any; +>_NgControl_30_6 : any + + _NgControlStatus_30_7:import45.NgControlStatus; +>_NgControlStatus_30_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_31:any; +>_el_31 : any + + _text_32:any; +>_text_32 : any + + _el_33:any; +>_el_33 : any + + _DefaultValueAccessor_33_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_33_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_33_4:any[]; +>_NG_VALUE_ACCESSOR_33_4 : any[] + + _FormControlName_33_5:import47.FormControlName; +>_FormControlName_33_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_33_6:any; +>_NgControl_33_6 : any + + _NgControlStatus_33_7:import45.NgControlStatus; +>_NgControlStatus_33_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_34:any; +>_el_34 : any + + _text_35:any; +>_text_35 : any + + _el_36:any; +>_el_36 : any + + _DefaultValueAccessor_36_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_36_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_36_4:any[]; +>_NG_VALUE_ACCESSOR_36_4 : any[] + + _FormControlName_36_5:import47.FormControlName; +>_FormControlName_36_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_36_6:any; +>_NgControl_36_6 : any + + _NgControlStatus_36_7:import45.NgControlStatus; +>_NgControlStatus_36_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_37:any; +>_el_37 : any + + _text_38:any; +>_text_38 : any + + _el_39:any; +>_el_39 : any + + _DefaultValueAccessor_39_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_39_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_39_4:any[]; +>_NG_VALUE_ACCESSOR_39_4 : any[] + + _FormControlName_39_5:import47.FormControlName; +>_FormControlName_39_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_39_6:any; +>_NgControl_39_6 : any + + _NgControlStatus_39_7:import45.NgControlStatus; +>_NgControlStatus_39_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_40:any; +>_el_40 : any + + _text_41:any; +>_text_41 : any + + _el_42:any; +>_el_42 : any + + _DefaultValueAccessor_42_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_42_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_42_4:any[]; +>_NG_VALUE_ACCESSOR_42_4 : any[] + + _FormControlName_42_5:import47.FormControlName; +>_FormControlName_42_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_42_6:any; +>_NgControl_42_6 : any + + _NgControlStatus_42_7:import45.NgControlStatus; +>_NgControlStatus_42_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_43:any; +>_el_43 : any + + _text_44:any; +>_text_44 : any + + _el_45:any; +>_el_45 : any + + _DefaultValueAccessor_45_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_45_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_45_4:any[]; +>_NG_VALUE_ACCESSOR_45_4 : any[] + + _FormControlName_45_5:import47.FormControlName; +>_FormControlName_45_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_45_6:any; +>_NgControl_45_6 : any + + _NgControlStatus_45_7:import45.NgControlStatus; +>_NgControlStatus_45_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_46:any; +>_el_46 : any + + _text_47:any; +>_text_47 : any + + _el_48:any; +>_el_48 : any + + _DefaultValueAccessor_48_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_48_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_48_4:any[]; +>_NG_VALUE_ACCESSOR_48_4 : any[] + + _FormControlName_48_5:import47.FormControlName; +>_FormControlName_48_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_48_6:any; +>_NgControl_48_6 : any + + _NgControlStatus_48_7:import45.NgControlStatus; +>_NgControlStatus_48_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_49:any; +>_el_49 : any + + _text_50:any; +>_text_50 : any + + _el_51:any; +>_el_51 : any + + _DefaultValueAccessor_51_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_51_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_51_4:any[]; +>_NG_VALUE_ACCESSOR_51_4 : any[] + + _FormControlName_51_5:import47.FormControlName; +>_FormControlName_51_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_51_6:any; +>_NgControl_51_6 : any + + _NgControlStatus_51_7:import45.NgControlStatus; +>_NgControlStatus_51_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_52:any; +>_el_52 : any + + _text_53:any; +>_text_53 : any + + _el_54:any; +>_el_54 : any + + _DefaultValueAccessor_54_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_54_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_54_4:any[]; +>_NG_VALUE_ACCESSOR_54_4 : any[] + + _FormControlName_54_5:import47.FormControlName; +>_FormControlName_54_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_54_6:any; +>_NgControl_54_6 : any + + _NgControlStatus_54_7:import45.NgControlStatus; +>_NgControlStatus_54_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_55:any; +>_el_55 : any + + _text_56:any; +>_text_56 : any + + _el_57:any; +>_el_57 : any + + _DefaultValueAccessor_57_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_57_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_57_4:any[]; +>_NG_VALUE_ACCESSOR_57_4 : any[] + + _FormControlName_57_5:import47.FormControlName; +>_FormControlName_57_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_57_6:any; +>_NgControl_57_6 : any + + _NgControlStatus_57_7:import45.NgControlStatus; +>_NgControlStatus_57_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_58:any; +>_el_58 : any + + _text_59:any; +>_text_59 : any + + _el_60:any; +>_el_60 : any + + _DefaultValueAccessor_60_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_60_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_60_4:any[]; +>_NG_VALUE_ACCESSOR_60_4 : any[] + + _FormControlName_60_5:import47.FormControlName; +>_FormControlName_60_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_60_6:any; +>_NgControl_60_6 : any + + _NgControlStatus_60_7:import45.NgControlStatus; +>_NgControlStatus_60_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_61:any; +>_el_61 : any + + _text_62:any; +>_text_62 : any + + _text_63:any; +>_text_63 : any + + /*private*/ _expr_2:any; +>_expr_2 : any + + /*private*/ _expr_3:any; +>_expr_3 : any + + /*private*/ _expr_4:any; +>_expr_4 : any + + /*private*/ _expr_5:any; +>_expr_5 : any + + /*private*/ _expr_6:any; +>_expr_6 : any + + /*private*/ _expr_7:any; +>_expr_7 : any + + /*private*/ _expr_8:any; +>_expr_8 : any + + /*private*/ _expr_11:any; +>_expr_11 : any + + /*private*/ _expr_12:any; +>_expr_12 : any + + /*private*/ _expr_13:any; +>_expr_13 : any + + /*private*/ _expr_14:any; +>_expr_14 : any + + /*private*/ _expr_15:any; +>_expr_15 : any + + /*private*/ _expr_16:any; +>_expr_16 : any + + /*private*/ _expr_17:any; +>_expr_17 : any + + /*private*/ _expr_20:any; +>_expr_20 : any + + /*private*/ _expr_21:any; +>_expr_21 : any + + /*private*/ _expr_22:any; +>_expr_22 : any + + /*private*/ _expr_23:any; +>_expr_23 : any + + /*private*/ _expr_24:any; +>_expr_24 : any + + /*private*/ _expr_25:any; +>_expr_25 : any + + /*private*/ _expr_26:any; +>_expr_26 : any + + /*private*/ _expr_29:any; +>_expr_29 : any + + /*private*/ _expr_30:any; +>_expr_30 : any + + /*private*/ _expr_31:any; +>_expr_31 : any + + /*private*/ _expr_32:any; +>_expr_32 : any + + /*private*/ _expr_33:any; +>_expr_33 : any + + /*private*/ _expr_34:any; +>_expr_34 : any + + /*private*/ _expr_35:any; +>_expr_35 : any + + /*private*/ _expr_38:any; +>_expr_38 : any + + /*private*/ _expr_39:any; +>_expr_39 : any + + /*private*/ _expr_40:any; +>_expr_40 : any + + /*private*/ _expr_41:any; +>_expr_41 : any + + /*private*/ _expr_42:any; +>_expr_42 : any + + /*private*/ _expr_43:any; +>_expr_43 : any + + /*private*/ _expr_44:any; +>_expr_44 : any + + /*private*/ _expr_47:any; +>_expr_47 : any + + /*private*/ _expr_48:any; +>_expr_48 : any + + /*private*/ _expr_49:any; +>_expr_49 : any + + /*private*/ _expr_50:any; +>_expr_50 : any + + /*private*/ _expr_51:any; +>_expr_51 : any + + /*private*/ _expr_52:any; +>_expr_52 : any + + /*private*/ _expr_53:any; +>_expr_53 : any + + /*private*/ _expr_56:any; +>_expr_56 : any + + /*private*/ _expr_57:any; +>_expr_57 : any + + /*private*/ _expr_58:any; +>_expr_58 : any + + /*private*/ _expr_59:any; +>_expr_59 : any + + /*private*/ _expr_60:any; +>_expr_60 : any + + /*private*/ _expr_61:any; +>_expr_61 : any + + /*private*/ _expr_62:any; +>_expr_62 : any + + /*private*/ _expr_65:any; +>_expr_65 : any + + /*private*/ _expr_66:any; +>_expr_66 : any + + /*private*/ _expr_67:any; +>_expr_67 : any + + /*private*/ _expr_68:any; +>_expr_68 : any + + /*private*/ _expr_69:any; +>_expr_69 : any + + /*private*/ _expr_70:any; +>_expr_70 : any + + /*private*/ _expr_71:any; +>_expr_71 : any + + /*private*/ _expr_74:any; +>_expr_74 : any + + /*private*/ _expr_75:any; +>_expr_75 : any + + /*private*/ _expr_76:any; +>_expr_76 : any + + /*private*/ _expr_77:any; +>_expr_77 : any + + /*private*/ _expr_78:any; +>_expr_78 : any + + /*private*/ _expr_79:any; +>_expr_79 : any + + /*private*/ _expr_80:any; +>_expr_80 : any + + /*private*/ _expr_83:any; +>_expr_83 : any + + /*private*/ _expr_84:any; +>_expr_84 : any + + /*private*/ _expr_85:any; +>_expr_85 : any + + /*private*/ _expr_86:any; +>_expr_86 : any + + /*private*/ _expr_87:any; +>_expr_87 : any + + /*private*/ _expr_88:any; +>_expr_88 : any + + /*private*/ _expr_89:any; +>_expr_89 : any + + /*private*/ _expr_92:any; +>_expr_92 : any + + /*private*/ _expr_93:any; +>_expr_93 : any + + /*private*/ _expr_94:any; +>_expr_94 : any + + /*private*/ _expr_95:any; +>_expr_95 : any + + /*private*/ _expr_96:any; +>_expr_96 : any + + /*private*/ _expr_97:any; +>_expr_97 : any + + /*private*/ _expr_98:any; +>_expr_98 : any + + /*private*/ _expr_101:any; +>_expr_101 : any + + /*private*/ _expr_102:any; +>_expr_102 : any + + /*private*/ _expr_103:any; +>_expr_103 : any + + /*private*/ _expr_104:any; +>_expr_104 : any + + /*private*/ _expr_105:any; +>_expr_105 : any + + /*private*/ _expr_106:any; +>_expr_106 : any + + /*private*/ _expr_107:any; +>_expr_107 : any + + /*private*/ _expr_110:any; +>_expr_110 : any + + /*private*/ _expr_111:any; +>_expr_111 : any + + /*private*/ _expr_112:any; +>_expr_112 : any + + /*private*/ _expr_113:any; +>_expr_113 : any + + /*private*/ _expr_114:any; +>_expr_114 : any + + /*private*/ _expr_115:any; +>_expr_115 : any + + /*private*/ _expr_116:any; +>_expr_116 : any + + /*private*/ _expr_119:any; +>_expr_119 : any + + /*private*/ _expr_120:any; +>_expr_120 : any + + /*private*/ _expr_121:any; +>_expr_121 : any + + /*private*/ _expr_122:any; +>_expr_122 : any + + /*private*/ _expr_123:any; +>_expr_123 : any + + /*private*/ _expr_124:any; +>_expr_124 : any + + /*private*/ _expr_125:any; +>_expr_125 : any + + /*private*/ _expr_128:any; +>_expr_128 : any + + /*private*/ _expr_129:any; +>_expr_129 : any + + /*private*/ _expr_130:any; +>_expr_130 : any + + /*private*/ _expr_131:any; +>_expr_131 : any + + /*private*/ _expr_132:any; +>_expr_132 : any + + /*private*/ _expr_133:any; +>_expr_133 : any + + /*private*/ _expr_134:any; +>_expr_134 : any + + /*private*/ _expr_137:any; +>_expr_137 : any + + /*private*/ _expr_138:any; +>_expr_138 : any + + /*private*/ _expr_139:any; +>_expr_139 : any + + /*private*/ _expr_140:any; +>_expr_140 : any + + /*private*/ _expr_141:any; +>_expr_141 : any + + /*private*/ _expr_142:any; +>_expr_142 : any + + /*private*/ _expr_143:any; +>_expr_143 : any + + /*private*/ _expr_146:any; +>_expr_146 : any + + /*private*/ _expr_147:any; +>_expr_147 : any + + /*private*/ _expr_148:any; +>_expr_148 : any + + /*private*/ _expr_149:any; +>_expr_149 : any + + /*private*/ _expr_150:any; +>_expr_150 : any + + /*private*/ _expr_151:any; +>_expr_151 : any + + /*private*/ _expr_152:any; +>_expr_152 : any + + /*private*/ _expr_155:any; +>_expr_155 : any + + /*private*/ _expr_156:any; +>_expr_156 : any + + /*private*/ _expr_157:any; +>_expr_157 : any + + /*private*/ _expr_158:any; +>_expr_158 : any + + /*private*/ _expr_159:any; +>_expr_159 : any + + /*private*/ _expr_160:any; +>_expr_160 : any + + /*private*/ _expr_161:any; +>_expr_161 : any + + /*private*/ _expr_164:any; +>_expr_164 : any + + /*private*/ _expr_165:any; +>_expr_165 : any + + /*private*/ _expr_166:any; +>_expr_166 : any + + /*private*/ _expr_167:any; +>_expr_167 : any + + /*private*/ _expr_168:any; +>_expr_168 : any + + /*private*/ _expr_169:any; +>_expr_169 : any + + /*private*/ _expr_170:any; +>_expr_170 : any + + /*private*/ _expr_173:any; +>_expr_173 : any + + /*private*/ _expr_174:any; +>_expr_174 : any + + /*private*/ _expr_175:any; +>_expr_175 : any + + /*private*/ _expr_176:any; +>_expr_176 : any + + /*private*/ _expr_177:any; +>_expr_177 : any + + /*private*/ _expr_178:any; +>_expr_178 : any + + /*private*/ _expr_179:any; +>_expr_179 : any + + /*private*/ _expr_182:any; +>_expr_182 : any + + /*private*/ _expr_183:any; +>_expr_183 : any + + /*private*/ _expr_184:any; +>_expr_184 : any + + /*private*/ _expr_185:any; +>_expr_185 : any + + /*private*/ _expr_186:any; +>_expr_186 : any + + /*private*/ _expr_187:any; +>_expr_187 : any + + /*private*/ _expr_188:any; +>_expr_188 : any + + constructor(viewUtils:any,parentInjector:any,declarationEl:any) { +>viewUtils : any +>parentInjector : any +>declarationEl : any + } + + injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { +>injectorGetInternal : (token: any, requestNodeIndex: number, notFoundResult: any) => any +>token : any +>requestNodeIndex : number +>notFoundResult : any + + if (((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex))) { return this._DefaultValueAccessor_3_3; } +>((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (3 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(3 === requestNodeIndex) : boolean +>3 === requestNodeIndex : boolean +>3 : 3 +>requestNodeIndex : number +>this._DefaultValueAccessor_3_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_3_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_3_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(3 === requestNodeIndex) : boolean +>3 === requestNodeIndex : boolean +>3 : 3 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_3_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_3_4 : any[] + + if (((token === import47.FormControlName) && (3 === requestNodeIndex))) { return this._FormControlName_3_5; } +>((token === import47.FormControlName) && (3 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (3 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(3 === requestNodeIndex) : boolean +>3 === requestNodeIndex : boolean +>3 : 3 +>requestNodeIndex : number +>this._FormControlName_3_5 : import47.FormControlName +>this : this +>_FormControlName_3_5 : import47.FormControlName + + if (((token === import50.NgControl) && (3 === requestNodeIndex))) { return this._NgControl_3_6; } +>((token === import50.NgControl) && (3 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (3 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(3 === requestNodeIndex) : boolean +>3 === requestNodeIndex : boolean +>3 : 3 +>requestNodeIndex : number +>this._NgControl_3_6 : any +>this : this +>_NgControl_3_6 : any + + if (((token === import45.NgControlStatus) && (3 === requestNodeIndex))) { return this._NgControlStatus_3_7; } +>((token === import45.NgControlStatus) && (3 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (3 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(3 === requestNodeIndex) : boolean +>3 === requestNodeIndex : boolean +>3 : 3 +>requestNodeIndex : number +>this._NgControlStatus_3_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_3_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex))) { return this._DefaultValueAccessor_6_3; } +>((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (6 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(6 === requestNodeIndex) : boolean +>6 === requestNodeIndex : boolean +>6 : 6 +>requestNodeIndex : number +>this._DefaultValueAccessor_6_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_6_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_6_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(6 === requestNodeIndex) : boolean +>6 === requestNodeIndex : boolean +>6 : 6 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_6_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_6_4 : any[] + + if (((token === import47.FormControlName) && (6 === requestNodeIndex))) { return this._FormControlName_6_5; } +>((token === import47.FormControlName) && (6 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (6 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(6 === requestNodeIndex) : boolean +>6 === requestNodeIndex : boolean +>6 : 6 +>requestNodeIndex : number +>this._FormControlName_6_5 : import47.FormControlName +>this : this +>_FormControlName_6_5 : import47.FormControlName + + if (((token === import50.NgControl) && (6 === requestNodeIndex))) { return this._NgControl_6_6; } +>((token === import50.NgControl) && (6 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (6 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(6 === requestNodeIndex) : boolean +>6 === requestNodeIndex : boolean +>6 : 6 +>requestNodeIndex : number +>this._NgControl_6_6 : any +>this : this +>_NgControl_6_6 : any + + if (((token === import45.NgControlStatus) && (6 === requestNodeIndex))) { return this._NgControlStatus_6_7; } +>((token === import45.NgControlStatus) && (6 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (6 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(6 === requestNodeIndex) : boolean +>6 === requestNodeIndex : boolean +>6 : 6 +>requestNodeIndex : number +>this._NgControlStatus_6_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_6_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex))) { return this._DefaultValueAccessor_9_3; } +>((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (9 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(9 === requestNodeIndex) : boolean +>9 === requestNodeIndex : boolean +>9 : 9 +>requestNodeIndex : number +>this._DefaultValueAccessor_9_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_9_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_9_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(9 === requestNodeIndex) : boolean +>9 === requestNodeIndex : boolean +>9 : 9 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_9_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_9_4 : any[] + + if (((token === import47.FormControlName) && (9 === requestNodeIndex))) { return this._FormControlName_9_5; } +>((token === import47.FormControlName) && (9 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (9 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(9 === requestNodeIndex) : boolean +>9 === requestNodeIndex : boolean +>9 : 9 +>requestNodeIndex : number +>this._FormControlName_9_5 : import47.FormControlName +>this : this +>_FormControlName_9_5 : import47.FormControlName + + if (((token === import50.NgControl) && (9 === requestNodeIndex))) { return this._NgControl_9_6; } +>((token === import50.NgControl) && (9 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (9 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(9 === requestNodeIndex) : boolean +>9 === requestNodeIndex : boolean +>9 : 9 +>requestNodeIndex : number +>this._NgControl_9_6 : any +>this : this +>_NgControl_9_6 : any + + if (((token === import45.NgControlStatus) && (9 === requestNodeIndex))) { return this._NgControlStatus_9_7; } +>((token === import45.NgControlStatus) && (9 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (9 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(9 === requestNodeIndex) : boolean +>9 === requestNodeIndex : boolean +>9 : 9 +>requestNodeIndex : number +>this._NgControlStatus_9_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_9_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex))) { return this._DefaultValueAccessor_12_3; } +>((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (12 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(12 === requestNodeIndex) : boolean +>12 === requestNodeIndex : boolean +>12 : 12 +>requestNodeIndex : number +>this._DefaultValueAccessor_12_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_12_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_12_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(12 === requestNodeIndex) : boolean +>12 === requestNodeIndex : boolean +>12 : 12 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_12_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_12_4 : any[] + + if (((token === import47.FormControlName) && (12 === requestNodeIndex))) { return this._FormControlName_12_5; } +>((token === import47.FormControlName) && (12 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (12 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(12 === requestNodeIndex) : boolean +>12 === requestNodeIndex : boolean +>12 : 12 +>requestNodeIndex : number +>this._FormControlName_12_5 : import47.FormControlName +>this : this +>_FormControlName_12_5 : import47.FormControlName + + if (((token === import50.NgControl) && (12 === requestNodeIndex))) { return this._NgControl_12_6; } +>((token === import50.NgControl) && (12 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (12 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(12 === requestNodeIndex) : boolean +>12 === requestNodeIndex : boolean +>12 : 12 +>requestNodeIndex : number +>this._NgControl_12_6 : any +>this : this +>_NgControl_12_6 : any + + if (((token === import45.NgControlStatus) && (12 === requestNodeIndex))) { return this._NgControlStatus_12_7; } +>((token === import45.NgControlStatus) && (12 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (12 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(12 === requestNodeIndex) : boolean +>12 === requestNodeIndex : boolean +>12 : 12 +>requestNodeIndex : number +>this._NgControlStatus_12_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_12_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex))) { return this._DefaultValueAccessor_15_3; } +>((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (15 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(15 === requestNodeIndex) : boolean +>15 === requestNodeIndex : boolean +>15 : 15 +>requestNodeIndex : number +>this._DefaultValueAccessor_15_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_15_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_15_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(15 === requestNodeIndex) : boolean +>15 === requestNodeIndex : boolean +>15 : 15 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_15_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_15_4 : any[] + + if (((token === import47.FormControlName) && (15 === requestNodeIndex))) { return this._FormControlName_15_5; } +>((token === import47.FormControlName) && (15 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (15 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(15 === requestNodeIndex) : boolean +>15 === requestNodeIndex : boolean +>15 : 15 +>requestNodeIndex : number +>this._FormControlName_15_5 : import47.FormControlName +>this : this +>_FormControlName_15_5 : import47.FormControlName + + if (((token === import50.NgControl) && (15 === requestNodeIndex))) { return this._NgControl_15_6; } +>((token === import50.NgControl) && (15 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (15 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(15 === requestNodeIndex) : boolean +>15 === requestNodeIndex : boolean +>15 : 15 +>requestNodeIndex : number +>this._NgControl_15_6 : any +>this : this +>_NgControl_15_6 : any + + if (((token === import45.NgControlStatus) && (15 === requestNodeIndex))) { return this._NgControlStatus_15_7; } +>((token === import45.NgControlStatus) && (15 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (15 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(15 === requestNodeIndex) : boolean +>15 === requestNodeIndex : boolean +>15 : 15 +>requestNodeIndex : number +>this._NgControlStatus_15_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_15_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex))) { return this._DefaultValueAccessor_18_3; } +>((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (18 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(18 === requestNodeIndex) : boolean +>18 === requestNodeIndex : boolean +>18 : 18 +>requestNodeIndex : number +>this._DefaultValueAccessor_18_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_18_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_18_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(18 === requestNodeIndex) : boolean +>18 === requestNodeIndex : boolean +>18 : 18 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_18_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_18_4 : any[] + + if (((token === import47.FormControlName) && (18 === requestNodeIndex))) { return this._FormControlName_18_5; } +>((token === import47.FormControlName) && (18 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (18 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(18 === requestNodeIndex) : boolean +>18 === requestNodeIndex : boolean +>18 : 18 +>requestNodeIndex : number +>this._FormControlName_18_5 : import47.FormControlName +>this : this +>_FormControlName_18_5 : import47.FormControlName + + if (((token === import50.NgControl) && (18 === requestNodeIndex))) { return this._NgControl_18_6; } +>((token === import50.NgControl) && (18 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (18 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(18 === requestNodeIndex) : boolean +>18 === requestNodeIndex : boolean +>18 : 18 +>requestNodeIndex : number +>this._NgControl_18_6 : any +>this : this +>_NgControl_18_6 : any + + if (((token === import45.NgControlStatus) && (18 === requestNodeIndex))) { return this._NgControlStatus_18_7; } +>((token === import45.NgControlStatus) && (18 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (18 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(18 === requestNodeIndex) : boolean +>18 === requestNodeIndex : boolean +>18 : 18 +>requestNodeIndex : number +>this._NgControlStatus_18_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_18_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex))) { return this._DefaultValueAccessor_21_3; } +>((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (21 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(21 === requestNodeIndex) : boolean +>21 === requestNodeIndex : boolean +>21 : 21 +>requestNodeIndex : number +>this._DefaultValueAccessor_21_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_21_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_21_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(21 === requestNodeIndex) : boolean +>21 === requestNodeIndex : boolean +>21 : 21 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_21_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_21_4 : any[] + + if (((token === import47.FormControlName) && (21 === requestNodeIndex))) { return this._FormControlName_21_5; } +>((token === import47.FormControlName) && (21 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (21 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(21 === requestNodeIndex) : boolean +>21 === requestNodeIndex : boolean +>21 : 21 +>requestNodeIndex : number +>this._FormControlName_21_5 : import47.FormControlName +>this : this +>_FormControlName_21_5 : import47.FormControlName + + if (((token === import50.NgControl) && (21 === requestNodeIndex))) { return this._NgControl_21_6; } +>((token === import50.NgControl) && (21 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (21 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(21 === requestNodeIndex) : boolean +>21 === requestNodeIndex : boolean +>21 : 21 +>requestNodeIndex : number +>this._NgControl_21_6 : any +>this : this +>_NgControl_21_6 : any + + if (((token === import45.NgControlStatus) && (21 === requestNodeIndex))) { return this._NgControlStatus_21_7; } +>((token === import45.NgControlStatus) && (21 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (21 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(21 === requestNodeIndex) : boolean +>21 === requestNodeIndex : boolean +>21 : 21 +>requestNodeIndex : number +>this._NgControlStatus_21_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_21_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex))) { return this._DefaultValueAccessor_24_3; } +>((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (24 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(24 === requestNodeIndex) : boolean +>24 === requestNodeIndex : boolean +>24 : 24 +>requestNodeIndex : number +>this._DefaultValueAccessor_24_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_24_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_24_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(24 === requestNodeIndex) : boolean +>24 === requestNodeIndex : boolean +>24 : 24 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_24_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_24_4 : any[] + + if (((token === import47.FormControlName) && (24 === requestNodeIndex))) { return this._FormControlName_24_5; } +>((token === import47.FormControlName) && (24 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (24 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(24 === requestNodeIndex) : boolean +>24 === requestNodeIndex : boolean +>24 : 24 +>requestNodeIndex : number +>this._FormControlName_24_5 : import47.FormControlName +>this : this +>_FormControlName_24_5 : import47.FormControlName + + if (((token === import50.NgControl) && (24 === requestNodeIndex))) { return this._NgControl_24_6; } +>((token === import50.NgControl) && (24 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (24 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(24 === requestNodeIndex) : boolean +>24 === requestNodeIndex : boolean +>24 : 24 +>requestNodeIndex : number +>this._NgControl_24_6 : any +>this : this +>_NgControl_24_6 : any + + if (((token === import45.NgControlStatus) && (24 === requestNodeIndex))) { return this._NgControlStatus_24_7; } +>((token === import45.NgControlStatus) && (24 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (24 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(24 === requestNodeIndex) : boolean +>24 === requestNodeIndex : boolean +>24 : 24 +>requestNodeIndex : number +>this._NgControlStatus_24_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_24_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex))) { return this._DefaultValueAccessor_27_3; } +>((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (27 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(27 === requestNodeIndex) : boolean +>27 === requestNodeIndex : boolean +>27 : 27 +>requestNodeIndex : number +>this._DefaultValueAccessor_27_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_27_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_27_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(27 === requestNodeIndex) : boolean +>27 === requestNodeIndex : boolean +>27 : 27 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_27_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_27_4 : any[] + + if (((token === import47.FormControlName) && (27 === requestNodeIndex))) { return this._FormControlName_27_5; } +>((token === import47.FormControlName) && (27 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (27 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(27 === requestNodeIndex) : boolean +>27 === requestNodeIndex : boolean +>27 : 27 +>requestNodeIndex : number +>this._FormControlName_27_5 : import47.FormControlName +>this : this +>_FormControlName_27_5 : import47.FormControlName + + if (((token === import50.NgControl) && (27 === requestNodeIndex))) { return this._NgControl_27_6; } +>((token === import50.NgControl) && (27 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (27 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(27 === requestNodeIndex) : boolean +>27 === requestNodeIndex : boolean +>27 : 27 +>requestNodeIndex : number +>this._NgControl_27_6 : any +>this : this +>_NgControl_27_6 : any + + if (((token === import45.NgControlStatus) && (27 === requestNodeIndex))) { return this._NgControlStatus_27_7; } +>((token === import45.NgControlStatus) && (27 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (27 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(27 === requestNodeIndex) : boolean +>27 === requestNodeIndex : boolean +>27 : 27 +>requestNodeIndex : number +>this._NgControlStatus_27_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_27_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex))) { return this._DefaultValueAccessor_30_3; } +>((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (30 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(30 === requestNodeIndex) : boolean +>30 === requestNodeIndex : boolean +>30 : 30 +>requestNodeIndex : number +>this._DefaultValueAccessor_30_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_30_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_30_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(30 === requestNodeIndex) : boolean +>30 === requestNodeIndex : boolean +>30 : 30 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_30_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_30_4 : any[] + + if (((token === import47.FormControlName) && (30 === requestNodeIndex))) { return this._FormControlName_30_5; } +>((token === import47.FormControlName) && (30 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (30 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(30 === requestNodeIndex) : boolean +>30 === requestNodeIndex : boolean +>30 : 30 +>requestNodeIndex : number +>this._FormControlName_30_5 : import47.FormControlName +>this : this +>_FormControlName_30_5 : import47.FormControlName + + if (((token === import50.NgControl) && (30 === requestNodeIndex))) { return this._NgControl_30_6; } +>((token === import50.NgControl) && (30 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (30 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(30 === requestNodeIndex) : boolean +>30 === requestNodeIndex : boolean +>30 : 30 +>requestNodeIndex : number +>this._NgControl_30_6 : any +>this : this +>_NgControl_30_6 : any + + if (((token === import45.NgControlStatus) && (30 === requestNodeIndex))) { return this._NgControlStatus_30_7; } +>((token === import45.NgControlStatus) && (30 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (30 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(30 === requestNodeIndex) : boolean +>30 === requestNodeIndex : boolean +>30 : 30 +>requestNodeIndex : number +>this._NgControlStatus_30_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_30_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex))) { return this._DefaultValueAccessor_33_3; } +>((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (33 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(33 === requestNodeIndex) : boolean +>33 === requestNodeIndex : boolean +>33 : 33 +>requestNodeIndex : number +>this._DefaultValueAccessor_33_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_33_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_33_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(33 === requestNodeIndex) : boolean +>33 === requestNodeIndex : boolean +>33 : 33 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_33_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_33_4 : any[] + + if (((token === import47.FormControlName) && (33 === requestNodeIndex))) { return this._FormControlName_33_5; } +>((token === import47.FormControlName) && (33 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (33 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(33 === requestNodeIndex) : boolean +>33 === requestNodeIndex : boolean +>33 : 33 +>requestNodeIndex : number +>this._FormControlName_33_5 : import47.FormControlName +>this : this +>_FormControlName_33_5 : import47.FormControlName + + if (((token === import50.NgControl) && (33 === requestNodeIndex))) { return this._NgControl_33_6; } +>((token === import50.NgControl) && (33 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (33 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(33 === requestNodeIndex) : boolean +>33 === requestNodeIndex : boolean +>33 : 33 +>requestNodeIndex : number +>this._NgControl_33_6 : any +>this : this +>_NgControl_33_6 : any + + if (((token === import45.NgControlStatus) && (33 === requestNodeIndex))) { return this._NgControlStatus_33_7; } +>((token === import45.NgControlStatus) && (33 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (33 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(33 === requestNodeIndex) : boolean +>33 === requestNodeIndex : boolean +>33 : 33 +>requestNodeIndex : number +>this._NgControlStatus_33_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_33_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex))) { return this._DefaultValueAccessor_36_3; } +>((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (36 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(36 === requestNodeIndex) : boolean +>36 === requestNodeIndex : boolean +>36 : 36 +>requestNodeIndex : number +>this._DefaultValueAccessor_36_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_36_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_36_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(36 === requestNodeIndex) : boolean +>36 === requestNodeIndex : boolean +>36 : 36 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_36_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_36_4 : any[] + + if (((token === import47.FormControlName) && (36 === requestNodeIndex))) { return this._FormControlName_36_5; } +>((token === import47.FormControlName) && (36 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (36 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(36 === requestNodeIndex) : boolean +>36 === requestNodeIndex : boolean +>36 : 36 +>requestNodeIndex : number +>this._FormControlName_36_5 : import47.FormControlName +>this : this +>_FormControlName_36_5 : import47.FormControlName + + if (((token === import50.NgControl) && (36 === requestNodeIndex))) { return this._NgControl_36_6; } +>((token === import50.NgControl) && (36 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (36 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(36 === requestNodeIndex) : boolean +>36 === requestNodeIndex : boolean +>36 : 36 +>requestNodeIndex : number +>this._NgControl_36_6 : any +>this : this +>_NgControl_36_6 : any + + if (((token === import45.NgControlStatus) && (36 === requestNodeIndex))) { return this._NgControlStatus_36_7; } +>((token === import45.NgControlStatus) && (36 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (36 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(36 === requestNodeIndex) : boolean +>36 === requestNodeIndex : boolean +>36 : 36 +>requestNodeIndex : number +>this._NgControlStatus_36_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_36_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex))) { return this._DefaultValueAccessor_39_3; } +>((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (39 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(39 === requestNodeIndex) : boolean +>39 === requestNodeIndex : boolean +>39 : 39 +>requestNodeIndex : number +>this._DefaultValueAccessor_39_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_39_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_39_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(39 === requestNodeIndex) : boolean +>39 === requestNodeIndex : boolean +>39 : 39 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_39_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_39_4 : any[] + + if (((token === import47.FormControlName) && (39 === requestNodeIndex))) { return this._FormControlName_39_5; } +>((token === import47.FormControlName) && (39 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (39 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(39 === requestNodeIndex) : boolean +>39 === requestNodeIndex : boolean +>39 : 39 +>requestNodeIndex : number +>this._FormControlName_39_5 : import47.FormControlName +>this : this +>_FormControlName_39_5 : import47.FormControlName + + if (((token === import50.NgControl) && (39 === requestNodeIndex))) { return this._NgControl_39_6; } +>((token === import50.NgControl) && (39 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (39 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(39 === requestNodeIndex) : boolean +>39 === requestNodeIndex : boolean +>39 : 39 +>requestNodeIndex : number +>this._NgControl_39_6 : any +>this : this +>_NgControl_39_6 : any + + if (((token === import45.NgControlStatus) && (39 === requestNodeIndex))) { return this._NgControlStatus_39_7; } +>((token === import45.NgControlStatus) && (39 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (39 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(39 === requestNodeIndex) : boolean +>39 === requestNodeIndex : boolean +>39 : 39 +>requestNodeIndex : number +>this._NgControlStatus_39_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_39_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex))) { return this._DefaultValueAccessor_42_3; } +>((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (42 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(42 === requestNodeIndex) : boolean +>42 === requestNodeIndex : boolean +>42 : 42 +>requestNodeIndex : number +>this._DefaultValueAccessor_42_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_42_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_42_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(42 === requestNodeIndex) : boolean +>42 === requestNodeIndex : boolean +>42 : 42 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_42_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_42_4 : any[] + + if (((token === import47.FormControlName) && (42 === requestNodeIndex))) { return this._FormControlName_42_5; } +>((token === import47.FormControlName) && (42 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (42 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(42 === requestNodeIndex) : boolean +>42 === requestNodeIndex : boolean +>42 : 42 +>requestNodeIndex : number +>this._FormControlName_42_5 : import47.FormControlName +>this : this +>_FormControlName_42_5 : import47.FormControlName + + if (((token === import50.NgControl) && (42 === requestNodeIndex))) { return this._NgControl_42_6; } +>((token === import50.NgControl) && (42 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (42 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(42 === requestNodeIndex) : boolean +>42 === requestNodeIndex : boolean +>42 : 42 +>requestNodeIndex : number +>this._NgControl_42_6 : any +>this : this +>_NgControl_42_6 : any + + if (((token === import45.NgControlStatus) && (42 === requestNodeIndex))) { return this._NgControlStatus_42_7; } +>((token === import45.NgControlStatus) && (42 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (42 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(42 === requestNodeIndex) : boolean +>42 === requestNodeIndex : boolean +>42 : 42 +>requestNodeIndex : number +>this._NgControlStatus_42_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_42_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex))) { return this._DefaultValueAccessor_45_3; } +>((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (45 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(45 === requestNodeIndex) : boolean +>45 === requestNodeIndex : boolean +>45 : 45 +>requestNodeIndex : number +>this._DefaultValueAccessor_45_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_45_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_45_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(45 === requestNodeIndex) : boolean +>45 === requestNodeIndex : boolean +>45 : 45 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_45_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_45_4 : any[] + + if (((token === import47.FormControlName) && (45 === requestNodeIndex))) { return this._FormControlName_45_5; } +>((token === import47.FormControlName) && (45 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (45 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(45 === requestNodeIndex) : boolean +>45 === requestNodeIndex : boolean +>45 : 45 +>requestNodeIndex : number +>this._FormControlName_45_5 : import47.FormControlName +>this : this +>_FormControlName_45_5 : import47.FormControlName + + if (((token === import50.NgControl) && (45 === requestNodeIndex))) { return this._NgControl_45_6; } +>((token === import50.NgControl) && (45 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (45 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(45 === requestNodeIndex) : boolean +>45 === requestNodeIndex : boolean +>45 : 45 +>requestNodeIndex : number +>this._NgControl_45_6 : any +>this : this +>_NgControl_45_6 : any + + if (((token === import45.NgControlStatus) && (45 === requestNodeIndex))) { return this._NgControlStatus_45_7; } +>((token === import45.NgControlStatus) && (45 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (45 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(45 === requestNodeIndex) : boolean +>45 === requestNodeIndex : boolean +>45 : 45 +>requestNodeIndex : number +>this._NgControlStatus_45_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_45_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex))) { return this._DefaultValueAccessor_48_3; } +>((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (48 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(48 === requestNodeIndex) : boolean +>48 === requestNodeIndex : boolean +>48 : 48 +>requestNodeIndex : number +>this._DefaultValueAccessor_48_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_48_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_48_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(48 === requestNodeIndex) : boolean +>48 === requestNodeIndex : boolean +>48 : 48 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_48_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_48_4 : any[] + + if (((token === import47.FormControlName) && (48 === requestNodeIndex))) { return this._FormControlName_48_5; } +>((token === import47.FormControlName) && (48 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (48 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(48 === requestNodeIndex) : boolean +>48 === requestNodeIndex : boolean +>48 : 48 +>requestNodeIndex : number +>this._FormControlName_48_5 : import47.FormControlName +>this : this +>_FormControlName_48_5 : import47.FormControlName + + if (((token === import50.NgControl) && (48 === requestNodeIndex))) { return this._NgControl_48_6; } +>((token === import50.NgControl) && (48 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (48 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(48 === requestNodeIndex) : boolean +>48 === requestNodeIndex : boolean +>48 : 48 +>requestNodeIndex : number +>this._NgControl_48_6 : any +>this : this +>_NgControl_48_6 : any + + if (((token === import45.NgControlStatus) && (48 === requestNodeIndex))) { return this._NgControlStatus_48_7; } +>((token === import45.NgControlStatus) && (48 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (48 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(48 === requestNodeIndex) : boolean +>48 === requestNodeIndex : boolean +>48 : 48 +>requestNodeIndex : number +>this._NgControlStatus_48_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_48_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex))) { return this._DefaultValueAccessor_51_3; } +>((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (51 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(51 === requestNodeIndex) : boolean +>51 === requestNodeIndex : boolean +>51 : 51 +>requestNodeIndex : number +>this._DefaultValueAccessor_51_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_51_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_51_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(51 === requestNodeIndex) : boolean +>51 === requestNodeIndex : boolean +>51 : 51 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_51_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_51_4 : any[] + + if (((token === import47.FormControlName) && (51 === requestNodeIndex))) { return this._FormControlName_51_5; } +>((token === import47.FormControlName) && (51 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (51 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(51 === requestNodeIndex) : boolean +>51 === requestNodeIndex : boolean +>51 : 51 +>requestNodeIndex : number +>this._FormControlName_51_5 : import47.FormControlName +>this : this +>_FormControlName_51_5 : import47.FormControlName + + if (((token === import50.NgControl) && (51 === requestNodeIndex))) { return this._NgControl_51_6; } +>((token === import50.NgControl) && (51 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (51 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(51 === requestNodeIndex) : boolean +>51 === requestNodeIndex : boolean +>51 : 51 +>requestNodeIndex : number +>this._NgControl_51_6 : any +>this : this +>_NgControl_51_6 : any + + if (((token === import45.NgControlStatus) && (51 === requestNodeIndex))) { return this._NgControlStatus_51_7; } +>((token === import45.NgControlStatus) && (51 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (51 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(51 === requestNodeIndex) : boolean +>51 === requestNodeIndex : boolean +>51 : 51 +>requestNodeIndex : number +>this._NgControlStatus_51_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_51_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex))) { return this._DefaultValueAccessor_54_3; } +>((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (54 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(54 === requestNodeIndex) : boolean +>54 === requestNodeIndex : boolean +>54 : 54 +>requestNodeIndex : number +>this._DefaultValueAccessor_54_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_54_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_54_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(54 === requestNodeIndex) : boolean +>54 === requestNodeIndex : boolean +>54 : 54 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_54_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_54_4 : any[] + + if (((token === import47.FormControlName) && (54 === requestNodeIndex))) { return this._FormControlName_54_5; } +>((token === import47.FormControlName) && (54 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (54 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(54 === requestNodeIndex) : boolean +>54 === requestNodeIndex : boolean +>54 : 54 +>requestNodeIndex : number +>this._FormControlName_54_5 : import47.FormControlName +>this : this +>_FormControlName_54_5 : import47.FormControlName + + if (((token === import50.NgControl) && (54 === requestNodeIndex))) { return this._NgControl_54_6; } +>((token === import50.NgControl) && (54 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (54 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(54 === requestNodeIndex) : boolean +>54 === requestNodeIndex : boolean +>54 : 54 +>requestNodeIndex : number +>this._NgControl_54_6 : any +>this : this +>_NgControl_54_6 : any + + if (((token === import45.NgControlStatus) && (54 === requestNodeIndex))) { return this._NgControlStatus_54_7; } +>((token === import45.NgControlStatus) && (54 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (54 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(54 === requestNodeIndex) : boolean +>54 === requestNodeIndex : boolean +>54 : 54 +>requestNodeIndex : number +>this._NgControlStatus_54_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_54_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex))) { return this._DefaultValueAccessor_57_3; } +>((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (57 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(57 === requestNodeIndex) : boolean +>57 === requestNodeIndex : boolean +>57 : 57 +>requestNodeIndex : number +>this._DefaultValueAccessor_57_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_57_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_57_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(57 === requestNodeIndex) : boolean +>57 === requestNodeIndex : boolean +>57 : 57 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_57_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_57_4 : any[] + + if (((token === import47.FormControlName) && (57 === requestNodeIndex))) { return this._FormControlName_57_5; } +>((token === import47.FormControlName) && (57 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (57 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(57 === requestNodeIndex) : boolean +>57 === requestNodeIndex : boolean +>57 : 57 +>requestNodeIndex : number +>this._FormControlName_57_5 : import47.FormControlName +>this : this +>_FormControlName_57_5 : import47.FormControlName + + if (((token === import50.NgControl) && (57 === requestNodeIndex))) { return this._NgControl_57_6; } +>((token === import50.NgControl) && (57 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (57 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(57 === requestNodeIndex) : boolean +>57 === requestNodeIndex : boolean +>57 : 57 +>requestNodeIndex : number +>this._NgControl_57_6 : any +>this : this +>_NgControl_57_6 : any + + if (((token === import45.NgControlStatus) && (57 === requestNodeIndex))) { return this._NgControlStatus_57_7; } +>((token === import45.NgControlStatus) && (57 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (57 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(57 === requestNodeIndex) : boolean +>57 === requestNodeIndex : boolean +>57 : 57 +>requestNodeIndex : number +>this._NgControlStatus_57_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_57_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex))) { return this._DefaultValueAccessor_60_3; } +>((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (60 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(60 === requestNodeIndex) : boolean +>60 === requestNodeIndex : boolean +>60 : 60 +>requestNodeIndex : number +>this._DefaultValueAccessor_60_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_60_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_60_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(60 === requestNodeIndex) : boolean +>60 === requestNodeIndex : boolean +>60 : 60 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_60_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_60_4 : any[] + + if (((token === import47.FormControlName) && (60 === requestNodeIndex))) { return this._FormControlName_60_5; } +>((token === import47.FormControlName) && (60 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (60 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(60 === requestNodeIndex) : boolean +>60 === requestNodeIndex : boolean +>60 : 60 +>requestNodeIndex : number +>this._FormControlName_60_5 : import47.FormControlName +>this : this +>_FormControlName_60_5 : import47.FormControlName + + if (((token === import50.NgControl) && (60 === requestNodeIndex))) { return this._NgControl_60_6; } +>((token === import50.NgControl) && (60 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (60 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(60 === requestNodeIndex) : boolean +>60 === requestNodeIndex : boolean +>60 : 60 +>requestNodeIndex : number +>this._NgControl_60_6 : any +>this : this +>_NgControl_60_6 : any + + if (((token === import45.NgControlStatus) && (60 === requestNodeIndex))) { return this._NgControlStatus_60_7; } +>((token === import45.NgControlStatus) && (60 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (60 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(60 === requestNodeIndex) : boolean +>60 === requestNodeIndex : boolean +>60 : 60 +>requestNodeIndex : number +>this._NgControlStatus_60_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_60_7 : import45.NgControlStatus + + if (((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._FormGroupDirective_1_3; } +>((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62))) : boolean +>(token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(token === import44.FormGroupDirective) : boolean +>token === import44.FormGroupDirective : boolean +>token : any +>import44.FormGroupDirective : typeof import44.FormGroupDirective +>import44 : typeof import44 +>FormGroupDirective : typeof import44.FormGroupDirective +>((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(1 <= requestNodeIndex) && (requestNodeIndex <= 62) : boolean +>(1 <= requestNodeIndex) : boolean +>1 <= requestNodeIndex : boolean +>1 : 1 +>requestNodeIndex : number +>(requestNodeIndex <= 62) : boolean +>requestNodeIndex <= 62 : boolean +>requestNodeIndex : number +>62 : 62 +>this._FormGroupDirective_1_3 : import44.FormGroupDirective +>this : this +>_FormGroupDirective_1_3 : import44.FormGroupDirective + + if (((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._ControlContainer_1_4; } +>((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62))) : boolean +>(token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(token === import51.ControlContainer) : boolean +>token === import51.ControlContainer : boolean +>token : any +>import51.ControlContainer : typeof import51.ControlContainer +>import51 : typeof import51 +>ControlContainer : typeof import51.ControlContainer +>((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(1 <= requestNodeIndex) && (requestNodeIndex <= 62) : boolean +>(1 <= requestNodeIndex) : boolean +>1 <= requestNodeIndex : boolean +>1 : 1 +>requestNodeIndex : number +>(requestNodeIndex <= 62) : boolean +>requestNodeIndex <= 62 : boolean +>requestNodeIndex : number +>62 : 62 +>this._ControlContainer_1_4 : any +>this : this +>_ControlContainer_1_4 : any + + if (((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._NgControlStatusGroup_1_5; } +>((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62))) : boolean +>(token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(token === import45.NgControlStatusGroup) : boolean +>token === import45.NgControlStatusGroup : boolean +>token : any +>import45.NgControlStatusGroup : typeof import45.NgControlStatusGroup +>import45 : typeof import45 +>NgControlStatusGroup : typeof import45.NgControlStatusGroup +>((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(1 <= requestNodeIndex) && (requestNodeIndex <= 62) : boolean +>(1 <= requestNodeIndex) : boolean +>1 <= requestNodeIndex : boolean +>1 : 1 +>requestNodeIndex : number +>(requestNodeIndex <= 62) : boolean +>requestNodeIndex <= 62 : boolean +>requestNodeIndex : number +>62 : 62 +>this._NgControlStatusGroup_1_5 : import45.NgControlStatusGroup +>this : this +>_NgControlStatusGroup_1_5 : import45.NgControlStatusGroup + + return notFoundResult; +>notFoundResult : any + } +} +export function viewFactory_AppComponent0(viewUtils:any,parentInjector:any,declarationEl:any):any { +>viewFactory_AppComponent0 : (viewUtils: any, parentInjector: any, declarationEl: any) => any +>viewUtils : any +>parentInjector : any +>declarationEl : any + + return new _View_AppComponent0(viewUtils,parentInjector,declarationEl); +>new _View_AppComponent0(viewUtils,parentInjector,declarationEl) : _View_AppComponent0 +>_View_AppComponent0 : typeof _View_AppComponent0 +>viewUtils : any +>parentInjector : any +>declarationEl : any +} + diff --git a/tests/cases/compiler/complexNarrowingWithAny.ts b/tests/cases/compiler/complexNarrowingWithAny.ts new file mode 100644 index 00000000000..746e2ef031f --- /dev/null +++ b/tests/cases/compiler/complexNarrowingWithAny.ts @@ -0,0 +1,558 @@ +// Repro from #10869 + +/** + * This file is generated by the Angular 2 template compiler. + * Do not edit. + */ + /* tslint:disable */ + +// import * as import0 from '@angular/core/src/linker/ng_module_factory'; +// import * as import1 from '../../app'; +// import * as import2 from '@angular/common/src/common_module'; +// import * as import3 from '@angular/core/src/application_module'; +// import * as import4 from '@angular/platform-browser/src/browser'; +// import * as import5 from '@angular/forms/src/directives'; +// import * as import6 from '@angular/forms/src/form_providers'; +// import * as import7 from '@angular/common/src/localization'; +// import * as import8 from '@angular/core/src/application_init'; +// import * as import9 from '@angular/core/src/testability/testability'; +// import * as import10 from '@angular/core/src/application_ref'; +// import * as import11 from '@angular/core/src/linker/compiler'; +// import * as import12 from '@angular/platform-browser/src/dom/events/hammer_gestures'; +// import * as import13 from '@angular/platform-browser/src/dom/events/event_manager'; +// import * as import14 from '@angular/platform-browser/src/dom/shared_styles_host'; +// import * as import15 from '@angular/platform-browser/src/dom/dom_renderer'; +// import * as import16 from '@angular/platform-browser/src/security/dom_sanitization_service'; +// import * as import17 from '@angular/core/src/linker/view_utils'; +// import * as import18 from '@angular/forms/src/form_builder'; +// import * as import19 from '@angular/forms/src/directives/radio_control_value_accessor'; +// import * as import20 from '@angular/core/src/di/injector'; +// import * as import21 from '@angular/core/src/application_tokens'; +// import * as import22 from '@angular/platform-browser/src/dom/events/dom_events'; +// import * as import23 from '@angular/platform-browser/src/dom/events/key_events'; +// import * as import24 from '@angular/core/src/zone/ng_zone'; +// import * as import25 from '@angular/platform-browser/src/dom/debug/ng_probe'; +// import * as import26 from '@angular/core/src/console'; +// import * as import27 from '@angular/core/src/i18n/tokens'; +// import * as import28 from '@angular/core/src/error_handler'; +// import * as import29 from '@angular/platform-browser/src/dom/dom_tokens'; +// import * as import30 from '@angular/platform-browser/src/dom/animation_driver'; +// import * as import31 from '@angular/core/src/render/api'; +// import * as import32 from '@angular/core/src/security'; +// import * as import33 from '@angular/core/src/change_detection/differs/iterable_differs'; +// import * as import34 from '@angular/core/src/change_detection/differs/keyvalue_differs'; +// import * as import35 from '@angular/core/src/i18n/tokens'; +// import * as import36 from '@angular/core/src/render/api'; +// import * as import37 from '@angular/core/src/linker/view'; +// import * as import38 from '@angular/core/src/linker/element'; +// import * as import39 from '@angular/core/src/linker/view_utils'; +// import * as import40 from '@angular/core/src/linker/view_type'; +// import * as import41 from '@angular/core/src/change_detection/change_detection'; +// import * as import42 from '@angular/core/src/metadata/view'; +// import * as import43 from '@angular/core/src/linker/component_factory'; +// import * as import44 from '@angular/forms/src/directives/reactive_directives/form_group_directive'; +// import * as import45 from '@angular/forms/src/directives/ng_control_status'; +// import * as import46 from '@angular/forms/src/directives/default_value_accessor'; +// import * as import47 from '@angular/forms/src/directives/reactive_directives/form_control_name'; +// import * as import48 from '@angular/core/src/linker/element_ref'; +// import * as import49 from '@angular/forms/src/directives/control_value_accessor'; +// import * as import50 from '@angular/forms/src/directives/ng_control'; +// import * as import51 from '@angular/forms/src/directives/control_container'; + +//stubbed out imports + +namespace import44 { + export class FormGroupDirective { + constructor(any){} + } +} + +namespace import45 { + export class NgControlStatus { + constructor(any){} + } + export class NgControlStatusGroup { + constructor(any){} + } +} + +namespace import46 { + export class DefaultValueAccessor { + constructor(any){} + } +} + +namespace import47 { + export class FormControlName { + constructor(any){} + } +} + +namespace import48 { + export class FormControlName { + constructor(any){} + } +} + + +//HERE BE DRAGONS + +//Using a value here - 65+ seconds to typecheck +namespace import49 { + //real code uses an opaque token, using new String() to simulate. + //export var NG_VALUE_ACCESSOR = new OpaqueToken('ngValueAccessor') + export var NG_VALUE_ACCESSOR = new String('foo') +} + +//using a class - < 1 sec typecheck +// namespace import49 { +// export class NG_VALUE_ACCESSOR { +// constructor(any){} +// } +// } + +//END DRAGONS + + +namespace import50 { + export class NgControl { + constructor(any){} + } +} + +namespace import51 { + export class ControlContainer { + constructor(any){} + } +} + + + +class _View_AppComponent0 { + _text_0:any; + _el_1:any; + _FormGroupDirective_1_3:import44.FormGroupDirective; + _ControlContainer_1_4:any; + _NgControlStatusGroup_1_5:import45.NgControlStatusGroup; + _text_2:any; + _el_3:any; + _DefaultValueAccessor_3_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_3_4:any[]; + _FormControlName_3_5:import47.FormControlName; + _NgControl_3_6:any; + _NgControlStatus_3_7:import45.NgControlStatus; + _el_4:any; + _text_5:any; + _el_6:any; + _DefaultValueAccessor_6_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_6_4:any[]; + _FormControlName_6_5:import47.FormControlName; + _NgControl_6_6:any; + _NgControlStatus_6_7:import45.NgControlStatus; + _el_7:any; + _text_8:any; + _el_9:any; + _DefaultValueAccessor_9_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_9_4:any[]; + _FormControlName_9_5:import47.FormControlName; + _NgControl_9_6:any; + _NgControlStatus_9_7:import45.NgControlStatus; + _el_10:any; + _text_11:any; + _el_12:any; + _DefaultValueAccessor_12_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_12_4:any[]; + _FormControlName_12_5:import47.FormControlName; + _NgControl_12_6:any; + _NgControlStatus_12_7:import45.NgControlStatus; + _el_13:any; + _text_14:any; + _el_15:any; + _DefaultValueAccessor_15_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_15_4:any[]; + _FormControlName_15_5:import47.FormControlName; + _NgControl_15_6:any; + _NgControlStatus_15_7:import45.NgControlStatus; + _el_16:any; + _text_17:any; + _el_18:any; + _DefaultValueAccessor_18_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_18_4:any[]; + _FormControlName_18_5:import47.FormControlName; + _NgControl_18_6:any; + _NgControlStatus_18_7:import45.NgControlStatus; + _el_19:any; + _text_20:any; + _el_21:any; + _DefaultValueAccessor_21_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_21_4:any[]; + _FormControlName_21_5:import47.FormControlName; + _NgControl_21_6:any; + _NgControlStatus_21_7:import45.NgControlStatus; + _el_22:any; + _text_23:any; + _el_24:any; + _DefaultValueAccessor_24_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_24_4:any[]; + _FormControlName_24_5:import47.FormControlName; + _NgControl_24_6:any; + _NgControlStatus_24_7:import45.NgControlStatus; + _el_25:any; + _text_26:any; + _el_27:any; + _DefaultValueAccessor_27_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_27_4:any[]; + _FormControlName_27_5:import47.FormControlName; + _NgControl_27_6:any; + _NgControlStatus_27_7:import45.NgControlStatus; + _el_28:any; + _text_29:any; + _el_30:any; + _DefaultValueAccessor_30_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_30_4:any[]; + _FormControlName_30_5:import47.FormControlName; + _NgControl_30_6:any; + _NgControlStatus_30_7:import45.NgControlStatus; + _el_31:any; + _text_32:any; + _el_33:any; + _DefaultValueAccessor_33_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_33_4:any[]; + _FormControlName_33_5:import47.FormControlName; + _NgControl_33_6:any; + _NgControlStatus_33_7:import45.NgControlStatus; + _el_34:any; + _text_35:any; + _el_36:any; + _DefaultValueAccessor_36_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_36_4:any[]; + _FormControlName_36_5:import47.FormControlName; + _NgControl_36_6:any; + _NgControlStatus_36_7:import45.NgControlStatus; + _el_37:any; + _text_38:any; + _el_39:any; + _DefaultValueAccessor_39_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_39_4:any[]; + _FormControlName_39_5:import47.FormControlName; + _NgControl_39_6:any; + _NgControlStatus_39_7:import45.NgControlStatus; + _el_40:any; + _text_41:any; + _el_42:any; + _DefaultValueAccessor_42_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_42_4:any[]; + _FormControlName_42_5:import47.FormControlName; + _NgControl_42_6:any; + _NgControlStatus_42_7:import45.NgControlStatus; + _el_43:any; + _text_44:any; + _el_45:any; + _DefaultValueAccessor_45_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_45_4:any[]; + _FormControlName_45_5:import47.FormControlName; + _NgControl_45_6:any; + _NgControlStatus_45_7:import45.NgControlStatus; + _el_46:any; + _text_47:any; + _el_48:any; + _DefaultValueAccessor_48_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_48_4:any[]; + _FormControlName_48_5:import47.FormControlName; + _NgControl_48_6:any; + _NgControlStatus_48_7:import45.NgControlStatus; + _el_49:any; + _text_50:any; + _el_51:any; + _DefaultValueAccessor_51_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_51_4:any[]; + _FormControlName_51_5:import47.FormControlName; + _NgControl_51_6:any; + _NgControlStatus_51_7:import45.NgControlStatus; + _el_52:any; + _text_53:any; + _el_54:any; + _DefaultValueAccessor_54_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_54_4:any[]; + _FormControlName_54_5:import47.FormControlName; + _NgControl_54_6:any; + _NgControlStatus_54_7:import45.NgControlStatus; + _el_55:any; + _text_56:any; + _el_57:any; + _DefaultValueAccessor_57_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_57_4:any[]; + _FormControlName_57_5:import47.FormControlName; + _NgControl_57_6:any; + _NgControlStatus_57_7:import45.NgControlStatus; + _el_58:any; + _text_59:any; + _el_60:any; + _DefaultValueAccessor_60_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_60_4:any[]; + _FormControlName_60_5:import47.FormControlName; + _NgControl_60_6:any; + _NgControlStatus_60_7:import45.NgControlStatus; + _el_61:any; + _text_62:any; + _text_63:any; + /*private*/ _expr_2:any; + /*private*/ _expr_3:any; + /*private*/ _expr_4:any; + /*private*/ _expr_5:any; + /*private*/ _expr_6:any; + /*private*/ _expr_7:any; + /*private*/ _expr_8:any; + /*private*/ _expr_11:any; + /*private*/ _expr_12:any; + /*private*/ _expr_13:any; + /*private*/ _expr_14:any; + /*private*/ _expr_15:any; + /*private*/ _expr_16:any; + /*private*/ _expr_17:any; + /*private*/ _expr_20:any; + /*private*/ _expr_21:any; + /*private*/ _expr_22:any; + /*private*/ _expr_23:any; + /*private*/ _expr_24:any; + /*private*/ _expr_25:any; + /*private*/ _expr_26:any; + /*private*/ _expr_29:any; + /*private*/ _expr_30:any; + /*private*/ _expr_31:any; + /*private*/ _expr_32:any; + /*private*/ _expr_33:any; + /*private*/ _expr_34:any; + /*private*/ _expr_35:any; + /*private*/ _expr_38:any; + /*private*/ _expr_39:any; + /*private*/ _expr_40:any; + /*private*/ _expr_41:any; + /*private*/ _expr_42:any; + /*private*/ _expr_43:any; + /*private*/ _expr_44:any; + /*private*/ _expr_47:any; + /*private*/ _expr_48:any; + /*private*/ _expr_49:any; + /*private*/ _expr_50:any; + /*private*/ _expr_51:any; + /*private*/ _expr_52:any; + /*private*/ _expr_53:any; + /*private*/ _expr_56:any; + /*private*/ _expr_57:any; + /*private*/ _expr_58:any; + /*private*/ _expr_59:any; + /*private*/ _expr_60:any; + /*private*/ _expr_61:any; + /*private*/ _expr_62:any; + /*private*/ _expr_65:any; + /*private*/ _expr_66:any; + /*private*/ _expr_67:any; + /*private*/ _expr_68:any; + /*private*/ _expr_69:any; + /*private*/ _expr_70:any; + /*private*/ _expr_71:any; + /*private*/ _expr_74:any; + /*private*/ _expr_75:any; + /*private*/ _expr_76:any; + /*private*/ _expr_77:any; + /*private*/ _expr_78:any; + /*private*/ _expr_79:any; + /*private*/ _expr_80:any; + /*private*/ _expr_83:any; + /*private*/ _expr_84:any; + /*private*/ _expr_85:any; + /*private*/ _expr_86:any; + /*private*/ _expr_87:any; + /*private*/ _expr_88:any; + /*private*/ _expr_89:any; + /*private*/ _expr_92:any; + /*private*/ _expr_93:any; + /*private*/ _expr_94:any; + /*private*/ _expr_95:any; + /*private*/ _expr_96:any; + /*private*/ _expr_97:any; + /*private*/ _expr_98:any; + /*private*/ _expr_101:any; + /*private*/ _expr_102:any; + /*private*/ _expr_103:any; + /*private*/ _expr_104:any; + /*private*/ _expr_105:any; + /*private*/ _expr_106:any; + /*private*/ _expr_107:any; + /*private*/ _expr_110:any; + /*private*/ _expr_111:any; + /*private*/ _expr_112:any; + /*private*/ _expr_113:any; + /*private*/ _expr_114:any; + /*private*/ _expr_115:any; + /*private*/ _expr_116:any; + /*private*/ _expr_119:any; + /*private*/ _expr_120:any; + /*private*/ _expr_121:any; + /*private*/ _expr_122:any; + /*private*/ _expr_123:any; + /*private*/ _expr_124:any; + /*private*/ _expr_125:any; + /*private*/ _expr_128:any; + /*private*/ _expr_129:any; + /*private*/ _expr_130:any; + /*private*/ _expr_131:any; + /*private*/ _expr_132:any; + /*private*/ _expr_133:any; + /*private*/ _expr_134:any; + /*private*/ _expr_137:any; + /*private*/ _expr_138:any; + /*private*/ _expr_139:any; + /*private*/ _expr_140:any; + /*private*/ _expr_141:any; + /*private*/ _expr_142:any; + /*private*/ _expr_143:any; + /*private*/ _expr_146:any; + /*private*/ _expr_147:any; + /*private*/ _expr_148:any; + /*private*/ _expr_149:any; + /*private*/ _expr_150:any; + /*private*/ _expr_151:any; + /*private*/ _expr_152:any; + /*private*/ _expr_155:any; + /*private*/ _expr_156:any; + /*private*/ _expr_157:any; + /*private*/ _expr_158:any; + /*private*/ _expr_159:any; + /*private*/ _expr_160:any; + /*private*/ _expr_161:any; + /*private*/ _expr_164:any; + /*private*/ _expr_165:any; + /*private*/ _expr_166:any; + /*private*/ _expr_167:any; + /*private*/ _expr_168:any; + /*private*/ _expr_169:any; + /*private*/ _expr_170:any; + /*private*/ _expr_173:any; + /*private*/ _expr_174:any; + /*private*/ _expr_175:any; + /*private*/ _expr_176:any; + /*private*/ _expr_177:any; + /*private*/ _expr_178:any; + /*private*/ _expr_179:any; + /*private*/ _expr_182:any; + /*private*/ _expr_183:any; + /*private*/ _expr_184:any; + /*private*/ _expr_185:any; + /*private*/ _expr_186:any; + /*private*/ _expr_187:any; + /*private*/ _expr_188:any; + constructor(viewUtils:any,parentInjector:any,declarationEl:any) { + } + + injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { + if (((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex))) { return this._DefaultValueAccessor_3_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_3_4; } + if (((token === import47.FormControlName) && (3 === requestNodeIndex))) { return this._FormControlName_3_5; } + if (((token === import50.NgControl) && (3 === requestNodeIndex))) { return this._NgControl_3_6; } + if (((token === import45.NgControlStatus) && (3 === requestNodeIndex))) { return this._NgControlStatus_3_7; } + if (((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex))) { return this._DefaultValueAccessor_6_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_6_4; } + if (((token === import47.FormControlName) && (6 === requestNodeIndex))) { return this._FormControlName_6_5; } + if (((token === import50.NgControl) && (6 === requestNodeIndex))) { return this._NgControl_6_6; } + if (((token === import45.NgControlStatus) && (6 === requestNodeIndex))) { return this._NgControlStatus_6_7; } + if (((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex))) { return this._DefaultValueAccessor_9_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_9_4; } + if (((token === import47.FormControlName) && (9 === requestNodeIndex))) { return this._FormControlName_9_5; } + if (((token === import50.NgControl) && (9 === requestNodeIndex))) { return this._NgControl_9_6; } + if (((token === import45.NgControlStatus) && (9 === requestNodeIndex))) { return this._NgControlStatus_9_7; } + if (((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex))) { return this._DefaultValueAccessor_12_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_12_4; } + if (((token === import47.FormControlName) && (12 === requestNodeIndex))) { return this._FormControlName_12_5; } + if (((token === import50.NgControl) && (12 === requestNodeIndex))) { return this._NgControl_12_6; } + if (((token === import45.NgControlStatus) && (12 === requestNodeIndex))) { return this._NgControlStatus_12_7; } + if (((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex))) { return this._DefaultValueAccessor_15_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_15_4; } + if (((token === import47.FormControlName) && (15 === requestNodeIndex))) { return this._FormControlName_15_5; } + if (((token === import50.NgControl) && (15 === requestNodeIndex))) { return this._NgControl_15_6; } + if (((token === import45.NgControlStatus) && (15 === requestNodeIndex))) { return this._NgControlStatus_15_7; } + if (((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex))) { return this._DefaultValueAccessor_18_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_18_4; } + if (((token === import47.FormControlName) && (18 === requestNodeIndex))) { return this._FormControlName_18_5; } + if (((token === import50.NgControl) && (18 === requestNodeIndex))) { return this._NgControl_18_6; } + if (((token === import45.NgControlStatus) && (18 === requestNodeIndex))) { return this._NgControlStatus_18_7; } + if (((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex))) { return this._DefaultValueAccessor_21_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_21_4; } + if (((token === import47.FormControlName) && (21 === requestNodeIndex))) { return this._FormControlName_21_5; } + if (((token === import50.NgControl) && (21 === requestNodeIndex))) { return this._NgControl_21_6; } + if (((token === import45.NgControlStatus) && (21 === requestNodeIndex))) { return this._NgControlStatus_21_7; } + if (((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex))) { return this._DefaultValueAccessor_24_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_24_4; } + if (((token === import47.FormControlName) && (24 === requestNodeIndex))) { return this._FormControlName_24_5; } + if (((token === import50.NgControl) && (24 === requestNodeIndex))) { return this._NgControl_24_6; } + if (((token === import45.NgControlStatus) && (24 === requestNodeIndex))) { return this._NgControlStatus_24_7; } + if (((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex))) { return this._DefaultValueAccessor_27_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_27_4; } + if (((token === import47.FormControlName) && (27 === requestNodeIndex))) { return this._FormControlName_27_5; } + if (((token === import50.NgControl) && (27 === requestNodeIndex))) { return this._NgControl_27_6; } + if (((token === import45.NgControlStatus) && (27 === requestNodeIndex))) { return this._NgControlStatus_27_7; } + if (((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex))) { return this._DefaultValueAccessor_30_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_30_4; } + if (((token === import47.FormControlName) && (30 === requestNodeIndex))) { return this._FormControlName_30_5; } + if (((token === import50.NgControl) && (30 === requestNodeIndex))) { return this._NgControl_30_6; } + if (((token === import45.NgControlStatus) && (30 === requestNodeIndex))) { return this._NgControlStatus_30_7; } + if (((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex))) { return this._DefaultValueAccessor_33_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_33_4; } + if (((token === import47.FormControlName) && (33 === requestNodeIndex))) { return this._FormControlName_33_5; } + if (((token === import50.NgControl) && (33 === requestNodeIndex))) { return this._NgControl_33_6; } + if (((token === import45.NgControlStatus) && (33 === requestNodeIndex))) { return this._NgControlStatus_33_7; } + if (((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex))) { return this._DefaultValueAccessor_36_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_36_4; } + if (((token === import47.FormControlName) && (36 === requestNodeIndex))) { return this._FormControlName_36_5; } + if (((token === import50.NgControl) && (36 === requestNodeIndex))) { return this._NgControl_36_6; } + if (((token === import45.NgControlStatus) && (36 === requestNodeIndex))) { return this._NgControlStatus_36_7; } + if (((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex))) { return this._DefaultValueAccessor_39_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_39_4; } + if (((token === import47.FormControlName) && (39 === requestNodeIndex))) { return this._FormControlName_39_5; } + if (((token === import50.NgControl) && (39 === requestNodeIndex))) { return this._NgControl_39_6; } + if (((token === import45.NgControlStatus) && (39 === requestNodeIndex))) { return this._NgControlStatus_39_7; } + if (((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex))) { return this._DefaultValueAccessor_42_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_42_4; } + if (((token === import47.FormControlName) && (42 === requestNodeIndex))) { return this._FormControlName_42_5; } + if (((token === import50.NgControl) && (42 === requestNodeIndex))) { return this._NgControl_42_6; } + if (((token === import45.NgControlStatus) && (42 === requestNodeIndex))) { return this._NgControlStatus_42_7; } + if (((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex))) { return this._DefaultValueAccessor_45_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_45_4; } + if (((token === import47.FormControlName) && (45 === requestNodeIndex))) { return this._FormControlName_45_5; } + if (((token === import50.NgControl) && (45 === requestNodeIndex))) { return this._NgControl_45_6; } + if (((token === import45.NgControlStatus) && (45 === requestNodeIndex))) { return this._NgControlStatus_45_7; } + if (((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex))) { return this._DefaultValueAccessor_48_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_48_4; } + if (((token === import47.FormControlName) && (48 === requestNodeIndex))) { return this._FormControlName_48_5; } + if (((token === import50.NgControl) && (48 === requestNodeIndex))) { return this._NgControl_48_6; } + if (((token === import45.NgControlStatus) && (48 === requestNodeIndex))) { return this._NgControlStatus_48_7; } + if (((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex))) { return this._DefaultValueAccessor_51_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_51_4; } + if (((token === import47.FormControlName) && (51 === requestNodeIndex))) { return this._FormControlName_51_5; } + if (((token === import50.NgControl) && (51 === requestNodeIndex))) { return this._NgControl_51_6; } + if (((token === import45.NgControlStatus) && (51 === requestNodeIndex))) { return this._NgControlStatus_51_7; } + if (((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex))) { return this._DefaultValueAccessor_54_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_54_4; } + if (((token === import47.FormControlName) && (54 === requestNodeIndex))) { return this._FormControlName_54_5; } + if (((token === import50.NgControl) && (54 === requestNodeIndex))) { return this._NgControl_54_6; } + if (((token === import45.NgControlStatus) && (54 === requestNodeIndex))) { return this._NgControlStatus_54_7; } + if (((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex))) { return this._DefaultValueAccessor_57_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_57_4; } + if (((token === import47.FormControlName) && (57 === requestNodeIndex))) { return this._FormControlName_57_5; } + if (((token === import50.NgControl) && (57 === requestNodeIndex))) { return this._NgControl_57_6; } + if (((token === import45.NgControlStatus) && (57 === requestNodeIndex))) { return this._NgControlStatus_57_7; } + if (((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex))) { return this._DefaultValueAccessor_60_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_60_4; } + if (((token === import47.FormControlName) && (60 === requestNodeIndex))) { return this._FormControlName_60_5; } + if (((token === import50.NgControl) && (60 === requestNodeIndex))) { return this._NgControl_60_6; } + if (((token === import45.NgControlStatus) && (60 === requestNodeIndex))) { return this._NgControlStatus_60_7; } + if (((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._FormGroupDirective_1_3; } + if (((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._ControlContainer_1_4; } + if (((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._NgControlStatusGroup_1_5; } + return notFoundResult; + } +} +export function viewFactory_AppComponent0(viewUtils:any,parentInjector:any,declarationEl:any):any { + return new _View_AppComponent0(viewUtils,parentInjector,declarationEl); +} From b3bb39db3e34917b2dd1e9318a54afe27acb1267 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 13 Sep 2016 09:19:51 -0700 Subject: [PATCH 19/44] Update baseline --- .../reference/complexNarrowingWithAny.types | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/baselines/reference/complexNarrowingWithAny.types b/tests/baselines/reference/complexNarrowingWithAny.types index 656621b7a7a..592a6b7b350 100644 --- a/tests/baselines/reference/complexNarrowingWithAny.types +++ b/tests/baselines/reference/complexNarrowingWithAny.types @@ -136,7 +136,7 @@ namespace import49 { >NG_VALUE_ACCESSOR : String >new String('foo') : String >String : StringConstructor ->'foo' : "foo" +>'foo' : string } //using a class - < 1 sec typecheck @@ -2967,12 +2967,12 @@ class _View_AppComponent0 { >(1 <= requestNodeIndex) && (requestNodeIndex <= 62) : boolean >(1 <= requestNodeIndex) : boolean >1 <= requestNodeIndex : boolean ->1 : 1 +>1 : number >requestNodeIndex : number >(requestNodeIndex <= 62) : boolean >requestNodeIndex <= 62 : boolean >requestNodeIndex : number ->62 : 62 +>62 : number >this._FormGroupDirective_1_3 : import44.FormGroupDirective >this : this >_FormGroupDirective_1_3 : import44.FormGroupDirective @@ -2990,12 +2990,12 @@ class _View_AppComponent0 { >(1 <= requestNodeIndex) && (requestNodeIndex <= 62) : boolean >(1 <= requestNodeIndex) : boolean >1 <= requestNodeIndex : boolean ->1 : 1 +>1 : number >requestNodeIndex : number >(requestNodeIndex <= 62) : boolean >requestNodeIndex <= 62 : boolean >requestNodeIndex : number ->62 : 62 +>62 : number >this._ControlContainer_1_4 : any >this : this >_ControlContainer_1_4 : any @@ -3013,12 +3013,12 @@ class _View_AppComponent0 { >(1 <= requestNodeIndex) && (requestNodeIndex <= 62) : boolean >(1 <= requestNodeIndex) : boolean >1 <= requestNodeIndex : boolean ->1 : 1 +>1 : number >requestNodeIndex : number >(requestNodeIndex <= 62) : boolean >requestNodeIndex <= 62 : boolean >requestNodeIndex : number ->62 : 62 +>62 : number >this._NgControlStatusGroup_1_5 : import45.NgControlStatusGroup >this : this >_NgControlStatusGroup_1_5 : import45.NgControlStatusGroup From 60d6578cb53557e1c65796a389d9fb870158b6c8 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 13 Sep 2016 09:20:05 -0700 Subject: [PATCH 20/44] Update LKG --- lib/tsc.js | 3 +++ lib/tsserver.js | 3 +++ lib/tsserverlibrary.js | 3 +++ lib/typescript.js | 3 +++ lib/typescriptServices.js | 3 +++ 5 files changed, 15 insertions(+) diff --git a/lib/tsc.js b/lib/tsc.js index 99e4d75cbf7..a406821066c 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -20057,6 +20057,9 @@ var ts; return type; } function narrowTypeByEquality(type, operator, value, assumeTrue) { + if (type.flags & 1) { + return type; + } if (operator === 31 || operator === 33) { assumeTrue = !assumeTrue; } diff --git a/lib/tsserver.js b/lib/tsserver.js index ea61f48883c..b469d67279a 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -21053,6 +21053,9 @@ var ts; return type; } function narrowTypeByEquality(type, operator, value, assumeTrue) { + if (type.flags & 1) { + return type; + } if (operator === 31 || operator === 33) { assumeTrue = !assumeTrue; } diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 88edc5dce20..2c5f0a8bf28 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -21053,6 +21053,9 @@ var ts; return type; } function narrowTypeByEquality(type, operator, value, assumeTrue) { + if (type.flags & 1) { + return type; + } if (operator === 31 || operator === 33) { assumeTrue = !assumeTrue; } diff --git a/lib/typescript.js b/lib/typescript.js index d3b32c17496..a1d387f2539 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -24324,6 +24324,9 @@ var ts; return type; } function narrowTypeByEquality(type, operator, value, assumeTrue) { + if (type.flags & 1 /* Any */) { + return type; + } if (operator === 31 /* ExclamationEqualsToken */ || operator === 33 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index d3b32c17496..a1d387f2539 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -24324,6 +24324,9 @@ var ts; return type; } function narrowTypeByEquality(type, operator, value, assumeTrue) { + if (type.flags & 1 /* Any */) { + return type; + } if (operator === 31 /* ExclamationEqualsToken */ || operator === 33 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } From dae4ec63be13b98b67198de04b549e1476045280 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 8 Sep 2016 11:16:45 -0700 Subject: [PATCH 21/44] Number is assignable to enum, even inside union Previously, numbers were not assignable to enums that were inside a union --- src/compiler/checker.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7199e4a548f..79d485cdc04 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6221,6 +6221,9 @@ namespace ts { if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & TypeFlags.Any) return true; if (source.flags & (TypeFlags.Number | TypeFlags.NumberLiteral) && target.flags & TypeFlags.Enum) return true; + if (source.flags & (TypeFlags.Number | TypeFlags.NumberLiteral) && + target.flags & TypeFlags.Union && + forEach((target as UnionType).types, t => t.flags & TypeFlags.EnumLike)) return true; if (source.flags & TypeFlags.NumberLiteral && target.flags & TypeFlags.EnumLiteral && (source).text === (target).text) return true; } return false; From 495ea0d4974a95ad304231abc3a9f94acead372f Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 8 Sep 2016 11:21:40 -0700 Subject: [PATCH 22/44] Test that number is assignable to enum in a union --- .../reference/numberAssignableToEnumInsideUnion.js | 14 ++++++++++++++ .../numberAssignableToEnumInsideUnion.symbols | 14 ++++++++++++++ .../numberAssignableToEnumInsideUnion.types | 14 ++++++++++++++ .../compiler/numberAssignableToEnumInsideUnion.ts | 3 +++ 4 files changed, 45 insertions(+) create mode 100644 tests/baselines/reference/numberAssignableToEnumInsideUnion.js create mode 100644 tests/baselines/reference/numberAssignableToEnumInsideUnion.symbols create mode 100644 tests/baselines/reference/numberAssignableToEnumInsideUnion.types create mode 100644 tests/cases/compiler/numberAssignableToEnumInsideUnion.ts diff --git a/tests/baselines/reference/numberAssignableToEnumInsideUnion.js b/tests/baselines/reference/numberAssignableToEnumInsideUnion.js new file mode 100644 index 00000000000..584b395212d --- /dev/null +++ b/tests/baselines/reference/numberAssignableToEnumInsideUnion.js @@ -0,0 +1,14 @@ +//// [numberAssignableToEnumInsideUnion.ts] +enum E { A, B } +let n: number; +let z: E | boolean = n; + + +//// [numberAssignableToEnumInsideUnion.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; +})(E || (E = {})); +var n; +var z = n; diff --git a/tests/baselines/reference/numberAssignableToEnumInsideUnion.symbols b/tests/baselines/reference/numberAssignableToEnumInsideUnion.symbols new file mode 100644 index 00000000000..4d815a99690 --- /dev/null +++ b/tests/baselines/reference/numberAssignableToEnumInsideUnion.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/numberAssignableToEnumInsideUnion.ts === +enum E { A, B } +>E : Symbol(E, Decl(numberAssignableToEnumInsideUnion.ts, 0, 0)) +>A : Symbol(E.A, Decl(numberAssignableToEnumInsideUnion.ts, 0, 8)) +>B : Symbol(E.B, Decl(numberAssignableToEnumInsideUnion.ts, 0, 11)) + +let n: number; +>n : Symbol(n, Decl(numberAssignableToEnumInsideUnion.ts, 1, 3)) + +let z: E | boolean = n; +>z : Symbol(z, Decl(numberAssignableToEnumInsideUnion.ts, 2, 3)) +>E : Symbol(E, Decl(numberAssignableToEnumInsideUnion.ts, 0, 0)) +>n : Symbol(n, Decl(numberAssignableToEnumInsideUnion.ts, 1, 3)) + diff --git a/tests/baselines/reference/numberAssignableToEnumInsideUnion.types b/tests/baselines/reference/numberAssignableToEnumInsideUnion.types new file mode 100644 index 00000000000..fd45ff17622 --- /dev/null +++ b/tests/baselines/reference/numberAssignableToEnumInsideUnion.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/numberAssignableToEnumInsideUnion.ts === +enum E { A, B } +>E : E +>A : E +>B : E + +let n: number; +>n : number + +let z: E | boolean = n; +>z : boolean | E +>E : E +>n : number + diff --git a/tests/cases/compiler/numberAssignableToEnumInsideUnion.ts b/tests/cases/compiler/numberAssignableToEnumInsideUnion.ts new file mode 100644 index 00000000000..fbefb5ac802 --- /dev/null +++ b/tests/cases/compiler/numberAssignableToEnumInsideUnion.ts @@ -0,0 +1,3 @@ +enum E { A, B } +let n: number; +let z: E | boolean = n; From 7482d5b77d1432cd56c1ec4de9cf8f3952e0f694 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 8 Sep 2016 14:41:35 -0700 Subject: [PATCH 23/44] Enum literal is assignable to enum, even inside union Previously, only number literals were assignable to enums inside unions. --- src/compiler/checker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 79d485cdc04..a98af973450 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6224,7 +6224,9 @@ namespace ts { if (source.flags & (TypeFlags.Number | TypeFlags.NumberLiteral) && target.flags & TypeFlags.Union && forEach((target as UnionType).types, t => t.flags & TypeFlags.EnumLike)) return true; - if (source.flags & TypeFlags.NumberLiteral && target.flags & TypeFlags.EnumLiteral && (source).text === (target).text) return true; + if (source.flags & (TypeFlags.NumberLiteral | TypeFlags.EnumLiteral) && + target.flags & TypeFlags.EnumLiteral && + (source).text === (target).text) return true; } return false; } From bf3941da471f52be85dda83af1ef305aaea3752c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 8 Sep 2016 14:43:17 -0700 Subject: [PATCH 24/44] Test that enum literal is assignable to an enum in a union --- .../enumLiteralAssignableToEnumInsideUnion.js | 32 ++++++++++++++++++ ...LiteralAssignableToEnumInsideUnion.symbols | 33 +++++++++++++++++++ ...umLiteralAssignableToEnumInsideUnion.types | 33 +++++++++++++++++++ .../enumLiteralAssignableToEnumInsideUnion.ts | 11 +++++++ 4 files changed, 109 insertions(+) create mode 100644 tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js create mode 100644 tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols create mode 100644 tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types create mode 100644 tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js new file mode 100644 index 00000000000..607269e06e3 --- /dev/null +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js @@ -0,0 +1,32 @@ +//// [enumLiteralAssignableToEnumInsideUnion.ts] +module X { + export enum Foo { + A, B + } +} +module Y { + export enum Foo { + A, B + } +} +const y: X.Foo | boolean = Y.Foo.A; + + +//// [enumLiteralAssignableToEnumInsideUnion.js] +var X; +(function (X) { + (function (Foo) { + Foo[Foo["A"] = 0] = "A"; + Foo[Foo["B"] = 1] = "B"; + })(X.Foo || (X.Foo = {})); + var Foo = X.Foo; +})(X || (X = {})); +var Y; +(function (Y) { + (function (Foo) { + Foo[Foo["A"] = 0] = "A"; + Foo[Foo["B"] = 1] = "B"; + })(Y.Foo || (Y.Foo = {})); + var Foo = Y.Foo; +})(Y || (Y = {})); +var y = Y.Foo.A; diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols new file mode 100644 index 00000000000..979bd516682 --- /dev/null +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts === +module X { +>X : Symbol(X, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 0)) + + export enum Foo { +>Foo : Symbol(Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) + + A, B +>A : Symbol(Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 1, 21)) +>B : Symbol(Foo.B, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 2, 10)) + } +} +module Y { +>Y : Symbol(Y, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 4, 1)) + + export enum Foo { +>Foo : Symbol(Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 5, 10)) + + A, B +>A : Symbol(Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 6, 21)) +>B : Symbol(Foo.B, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 7, 10)) + } +} +const y: X.Foo | boolean = Y.Foo.A; +>y : Symbol(y, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 10, 5)) +>X : Symbol(X, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 0)) +>Foo : Symbol(X.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) +>Y.Foo.A : Symbol(Y.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 6, 21)) +>Y.Foo : Symbol(Y.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 5, 10)) +>Y : Symbol(Y, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 4, 1)) +>Foo : Symbol(Y.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 5, 10)) +>A : Symbol(Y.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 6, 21)) + diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types new file mode 100644 index 00000000000..de57b5e92bc --- /dev/null +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types @@ -0,0 +1,33 @@ +=== tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts === +module X { +>X : typeof X + + export enum Foo { +>Foo : Foo + + A, B +>A : Foo +>B : Foo + } +} +module Y { +>Y : typeof Y + + export enum Foo { +>Foo : Foo + + A, B +>A : Foo +>B : Foo + } +} +const y: X.Foo | boolean = Y.Foo.A; +>y : boolean | X.Foo +>X : any +>Foo : X.Foo +>Y.Foo.A : Y.Foo +>Y.Foo : typeof Y.Foo +>Y : typeof Y +>Foo : typeof Y.Foo +>A : Y.Foo + diff --git a/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts b/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts new file mode 100644 index 00000000000..0c10155e48d --- /dev/null +++ b/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts @@ -0,0 +1,11 @@ +module X { + export enum Foo { + A, B + } +} +module Y { + export enum Foo { + A, B + } +} +const y: X.Foo | boolean = Y.Foo.A; From a0c3d4f3066e7d5c0290009cebb1e472fb4a85c9 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 8 Sep 2016 15:30:29 -0700 Subject: [PATCH 25/44] Fix both new enum assignability predicates And update error reporting baseline (new error is less elaborate) --- src/compiler/checker.ts | 14 ++++++++------ .../reference/enumAssignmentCompat3.errors.txt | 6 ++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a98af973450..34e61024c21 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6220,13 +6220,15 @@ namespace ts { if (source.flags & TypeFlags.Null && (!strictNullChecks || target.flags & TypeFlags.Null)) return true; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & TypeFlags.Any) return true; - if (source.flags & (TypeFlags.Number | TypeFlags.NumberLiteral) && target.flags & TypeFlags.Enum) return true; - if (source.flags & (TypeFlags.Number | TypeFlags.NumberLiteral) && - target.flags & TypeFlags.Union && - forEach((target as UnionType).types, t => t.flags & TypeFlags.EnumLike)) return true; - if (source.flags & (TypeFlags.NumberLiteral | TypeFlags.EnumLiteral) && + if (source.flags & (TypeFlags.Number | TypeFlags.NumberLiteral) && target.flags & TypeFlags.EnumLike) return true; + if (source.flags & TypeFlags.NumberLiteral && target.flags & TypeFlags.EnumLiteral && (source).text === (target).text) return true; + if (source.flags & TypeFlags.EnumLiteral && target.flags & TypeFlags.EnumLiteral && - (source).text === (target).text) return true; + (source).text === (target).text && + (source).baseType.symbol.name === (target).baseType.symbol.name && + !isConstEnumSymbol((source).baseType.symbol) && !isConstEnumSymbol((target).baseType.symbol)) { + return true; + } } return false; } diff --git a/tests/baselines/reference/enumAssignmentCompat3.errors.txt b/tests/baselines/reference/enumAssignmentCompat3.errors.txt index 02cb4314777..bfdaef96775 100644 --- a/tests/baselines/reference/enumAssignmentCompat3.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat3.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/enumAssignmentCompat3.ts(68,1): error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'. Property 'd' is missing in type 'First.E'. -tests/cases/compiler/enumAssignmentCompat3.ts(70,1): error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. - Property 'd' is missing in type 'First.E'. +tests/cases/compiler/enumAssignmentCompat3.ts(70,1): error TS2324: Property 'd' is missing in type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(71,1): error TS2322: Type 'Nope' is not assignable to type 'E'. tests/cases/compiler/enumAssignmentCompat3.ts(75,1): error TS2322: Type 'First.E' is not assignable to type 'Ab.E'. Property 'c' is missing in type 'Ab.E'. @@ -89,8 +88,7 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. abc = secondAb; // ok abc = secondCd; // missing 'd' ~~~ -!!! error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. -!!! error TS2322: Property 'd' is missing in type 'First.E'. +!!! error TS2324: Property 'd' is missing in type 'First.E'. abc = nope; // nope! ~~~ !!! error TS2322: Type 'Nope' is not assignable to type 'E'. From 64e4f6f395c7540b0766585f19ebbaf8e1ad0c49 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 12 Sep 2016 09:59:23 -0700 Subject: [PATCH 26/44] Address PR comments 1. Cache results of isEnumTypeRelatedTo 2. Make numeric literal assignment stricter again. 3. Use isEnumRelatedTo for comparing enums to each other. This provides the previous semi-structural semantics. 4. Because of the new distinction between computed enums (no union members) and union enums (no computed values => a union of enum literals), some semi-structural code moves out to the body of `isRelatedTo`. --- src/compiler/checker.ts | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 34e61024c21..3a8016f95f4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -330,6 +330,7 @@ namespace ts { const assignableRelation = createMap(); const comparableRelation = createMap(); const identityRelation = createMap(); + const enumRelation = createMap(); // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. let _displayBuilder: SymbolDisplayBuilder; @@ -6189,7 +6190,12 @@ namespace ts { if (source === target) { return true; } + const id = source.id + "," + target.id; + if (enumRelation[id] !== undefined) { + return enumRelation[id]; + } if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & SymbolFlags.RegularEnum) || !(target.symbol.flags & SymbolFlags.RegularEnum)) { + enumRelation[id] = false; return false; } const targetEnumType = getTypeOfSymbol(target.symbol); @@ -6201,10 +6207,12 @@ namespace ts { errorReporter(Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, TypeFormatFlags.UseFullyQualifiedType)); } + enumRelation[id] = false; return false; } } } + enumRelation[id] = true; return true; } @@ -6220,13 +6228,18 @@ namespace ts { if (source.flags & TypeFlags.Null && (!strictNullChecks || target.flags & TypeFlags.Null)) return true; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & TypeFlags.Any) return true; - if (source.flags & (TypeFlags.Number | TypeFlags.NumberLiteral) && target.flags & TypeFlags.EnumLike) return true; + if (source.flags & TypeFlags.Number && target.flags & TypeFlags.EnumLike) return true; + if (source.flags & TypeFlags.NumberLiteral && target.flags & TypeFlags.Enum) return true; if (source.flags & TypeFlags.NumberLiteral && target.flags & TypeFlags.EnumLiteral && (source).text === (target).text) return true; if (source.flags & TypeFlags.EnumLiteral && target.flags & TypeFlags.EnumLiteral && (source).text === (target).text && - (source).baseType.symbol.name === (target).baseType.symbol.name && - !isConstEnumSymbol((source).baseType.symbol) && !isConstEnumSymbol((target).baseType.symbol)) { + isEnumTypeRelatedTo((source).baseType, (target).baseType, errorReporter)) { + return true; + } + if (source.flags & TypeFlags.EnumLiteral && + target.flags & TypeFlags.Enum && + isEnumTypeRelatedTo(target, (source).baseType, errorReporter)) { return true; } } @@ -6404,6 +6417,14 @@ namespace ts { if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & TypeFlags.Primitive) && !(target.flags & TypeFlags.Primitive))) { return result; } + if (source.flags & TypeFlags.Enum) { + // 1. look through the target union for a literal whose base type is related to the source + let lit = find((target).types, t => t.flags & TypeFlags.EnumLiteral && isEnumTypeRelatedTo(source, (t).baseType)); + // 2. if found, the base type is only assignable to source if all its literals are in the target union. + if (lit && (result = isRelatedTo((lit as EnumLiteralType).baseType, target, false))) { + return result; + } + } } } From eb933f9567e97dc49d016e31059176def50fbfee Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 12 Sep 2016 10:05:48 -0700 Subject: [PATCH 27/44] More tests of enum assignability 1. Numeric literal <-> enum literal assignability 2. Computed enum <-> union enum assignability 3. Also rebaseline error reporting of existing enum cases. --- .../enumAssignmentCompat3.errors.txt | 24 ++++----- .../enumAssignmentCompat5.errors.txt | 33 ++++++++++++ .../reference/enumAssignmentCompat5.js | 50 +++++++++++++++++++ ...eralAssignableToEnumInsideUnion.errors.txt | 37 ++++++++++++++ .../enumLiteralAssignableToEnumInsideUnion.js | 40 ++++++++++++++- ...LiteralAssignableToEnumInsideUnion.symbols | 35 ++++++++++++- ...umLiteralAssignableToEnumInsideUnion.types | 39 +++++++++++++++ tests/cases/compiler/enumAssignmentCompat5.ts | 23 +++++++++ .../enumLiteralAssignableToEnumInsideUnion.ts | 18 ++++++- 9 files changed, 280 insertions(+), 19 deletions(-) create mode 100644 tests/baselines/reference/enumAssignmentCompat5.errors.txt create mode 100644 tests/baselines/reference/enumAssignmentCompat5.js create mode 100644 tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt create mode 100644 tests/cases/compiler/enumAssignmentCompat5.ts diff --git a/tests/baselines/reference/enumAssignmentCompat3.errors.txt b/tests/baselines/reference/enumAssignmentCompat3.errors.txt index bfdaef96775..41fa7a94fca 100644 --- a/tests/baselines/reference/enumAssignmentCompat3.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat3.errors.txt @@ -1,16 +1,13 @@ -tests/cases/compiler/enumAssignmentCompat3.ts(68,1): error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'. +tests/cases/compiler/enumAssignmentCompat3.ts(68,1): error TS2324: Property 'd' is missing in type 'First.E'. +tests/cases/compiler/enumAssignmentCompat3.ts(70,1): error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. Property 'd' is missing in type 'First.E'. -tests/cases/compiler/enumAssignmentCompat3.ts(70,1): error TS2324: Property 'd' is missing in type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(71,1): error TS2322: Type 'Nope' is not assignable to type 'E'. -tests/cases/compiler/enumAssignmentCompat3.ts(75,1): error TS2322: Type 'First.E' is not assignable to type 'Ab.E'. - Property 'c' is missing in type 'Ab.E'. +tests/cases/compiler/enumAssignmentCompat3.ts(75,1): error TS2324: Property 'c' is missing in type 'Ab.E'. tests/cases/compiler/enumAssignmentCompat3.ts(76,1): error TS2322: Type 'First.E' is not assignable to type 'Cd.E'. - Property 'a' is missing in type 'Cd.E'. tests/cases/compiler/enumAssignmentCompat3.ts(77,1): error TS2322: Type 'E' is not assignable to type 'Nope'. tests/cases/compiler/enumAssignmentCompat3.ts(82,1): error TS2322: Type 'Const.E' is not assignable to type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(83,1): error TS2322: Type 'First.E' is not assignable to type 'Const.E'. -tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged.E' is not assignable to type 'First.E'. - Property 'd' is missing in type 'First.E'. +tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2324: Property 'd' is missing in type 'First.E'. ==== tests/cases/compiler/enumAssignmentCompat3.ts (9 errors) ==== @@ -83,12 +80,12 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. abc = secondAbc; // ok abc = secondAbcd; // missing 'd' ~~~ -!!! error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'. -!!! error TS2322: Property 'd' is missing in type 'First.E'. +!!! error TS2324: Property 'd' is missing in type 'First.E'. abc = secondAb; // ok abc = secondCd; // missing 'd' ~~~ -!!! error TS2324: Property 'd' is missing in type 'First.E'. +!!! error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. +!!! error TS2322: Property 'd' is missing in type 'First.E'. abc = nope; // nope! ~~~ !!! error TS2322: Type 'Nope' is not assignable to type 'E'. @@ -97,12 +94,10 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. secondAbcd = abc; // ok secondAb = abc; // missing 'c' ~~~~~~~~ -!!! error TS2322: Type 'First.E' is not assignable to type 'Ab.E'. -!!! error TS2322: Property 'c' is missing in type 'Ab.E'. +!!! error TS2324: Property 'c' is missing in type 'Ab.E'. secondCd = abc; // missing 'a' and 'b' ~~~~~~~~ !!! error TS2322: Type 'First.E' is not assignable to type 'Cd.E'. -!!! error TS2322: Property 'a' is missing in type 'Cd.E'. nope = abc; // nope! ~~~~ !!! error TS2322: Type 'E' is not assignable to type 'Nope'. @@ -120,8 +115,7 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. // merged enums compare all their members abc = merged; // missing 'd' ~~~ -!!! error TS2322: Type 'Merged.E' is not assignable to type 'First.E'. -!!! error TS2322: Property 'd' is missing in type 'First.E'. +!!! error TS2324: Property 'd' is missing in type 'First.E'. merged = abc; // ok abc = merged2; // ok merged2 = abc; // ok \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignmentCompat5.errors.txt b/tests/baselines/reference/enumAssignmentCompat5.errors.txt new file mode 100644 index 00000000000..98c0aaccfad --- /dev/null +++ b/tests/baselines/reference/enumAssignmentCompat5.errors.txt @@ -0,0 +1,33 @@ +tests/cases/compiler/enumAssignmentCompat5.ts(14,1): error TS2322: Type '2' is not assignable to type 'E.A'. +tests/cases/compiler/enumAssignmentCompat5.ts(20,9): error TS2535: Enum type 'Computed' has members with initializers that are not literals. + + +==== tests/cases/compiler/enumAssignmentCompat5.ts (2 errors) ==== + enum E { + A, B, C + } + enum Computed { + A = 1 << 1, + B = 1 << 2, + C = 1 << 3, + } + let n: number; + let e: E = n; // ok because it's too inconvenient otherwise + e = 0; // ok, in range + e = 4; // ok, out of range, but allowed computed enums don't have all members + let a: E.A = 0; // ok, A === 0 + a = 2; // error, 2 !== 0 + ~ +!!! error TS2322: Type '2' is not assignable to type 'E.A'. + a = n; // ok + + let c: Computed = n; // ok + c = n; // ok + c = 4; // ok + let ca: Computed.A = 1; // error, Computed.A isn't a literal type because Computed has no enum literals + ~~~~~~~~~~ +!!! error TS2535: Enum type 'Computed' has members with initializers that are not literals. + + + + \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignmentCompat5.js b/tests/baselines/reference/enumAssignmentCompat5.js new file mode 100644 index 00000000000..a7c96929f08 --- /dev/null +++ b/tests/baselines/reference/enumAssignmentCompat5.js @@ -0,0 +1,50 @@ +//// [enumAssignmentCompat5.ts] +enum E { + A, B, C +} +enum Computed { + A = 1 << 1, + B = 1 << 2, + C = 1 << 3, +} +let n: number; +let e: E = n; // ok because it's too inconvenient otherwise +e = 0; // ok, in range +e = 4; // ok, out of range, but allowed computed enums don't have all members +let a: E.A = 0; // ok, A === 0 +a = 2; // error, 2 !== 0 +a = n; // ok + +let c: Computed = n; // ok +c = n; // ok +c = 4; // ok +let ca: Computed.A = 1; // error, Computed.A isn't a literal type because Computed has no enum literals + + + + + +//// [enumAssignmentCompat5.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; + E[E["C"] = 2] = "C"; +})(E || (E = {})); +var Computed; +(function (Computed) { + Computed[Computed["A"] = 2] = "A"; + Computed[Computed["B"] = 4] = "B"; + Computed[Computed["C"] = 8] = "C"; +})(Computed || (Computed = {})); +var n; +var e = n; // ok because it's too inconvenient otherwise +e = 0; // ok, in range +e = 4; // ok, out of range, but allowed computed enums don't have all members +var a = 0; // ok, A === 0 +a = 2; // error, 2 !== 0 +a = n; // ok +var c = n; // ok +c = n; // ok +c = 4; // ok +var ca = 1; // error, Computed.A isn't a literal type because Computed has no enum literals diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt new file mode 100644 index 00000000000..37bdc99a922 --- /dev/null +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt @@ -0,0 +1,37 @@ +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(25,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.B'. +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(26,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.A'. + + +==== tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts (2 errors) ==== + module X { + export enum Foo { + A, B + } + } + module Y { + export enum Foo { + A, B + } + } + module Z { + export enum Foo { + A = 1 << 1, + B = 1 << 2, + } + } + module Ka { + export enum Foo { + A = 1 << 10, + B = 1 << 11, + } + } + const e1: X.Foo | boolean = Z.Foo.A; // ok + const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // ok, X.Foo is equivalent to X.Foo.A | X.Foo.B + const e3: X.Foo.B | boolean = Z.Foo.A; // not legal + ~~ +!!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.B'. + const e4: X.Foo.A | boolean = Z.Foo.A; // not legal either because Z.Foo is computed and Z.Foo.A is not necessarily assignable to X.Foo.A + ~~ +!!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.A'. + const e5: Ka.Foo | boolean = Z.Foo.A; // ok + \ No newline at end of file diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js index 607269e06e3..1665e729719 100644 --- a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js @@ -9,7 +9,23 @@ module Y { A, B } } -const y: X.Foo | boolean = Y.Foo.A; +module Z { + export enum Foo { + A = 1 << 1, + B = 1 << 2, + } +} +module Ka { + export enum Foo { + A = 1 << 10, + B = 1 << 11, + } +} +const e1: X.Foo | boolean = Z.Foo.A; // ok +const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // ok, X.Foo is equivalent to X.Foo.A | X.Foo.B +const e3: X.Foo.B | boolean = Z.Foo.A; // not legal +const e4: X.Foo.A | boolean = Z.Foo.A; // not legal either because Z.Foo is computed and Z.Foo.A is not necessarily assignable to X.Foo.A +const e5: Ka.Foo | boolean = Z.Foo.A; // ok //// [enumLiteralAssignableToEnumInsideUnion.js] @@ -29,4 +45,24 @@ var Y; })(Y.Foo || (Y.Foo = {})); var Foo = Y.Foo; })(Y || (Y = {})); -var y = Y.Foo.A; +var Z; +(function (Z) { + (function (Foo) { + Foo[Foo["A"] = 2] = "A"; + Foo[Foo["B"] = 4] = "B"; + })(Z.Foo || (Z.Foo = {})); + var Foo = Z.Foo; +})(Z || (Z = {})); +var Ka; +(function (Ka) { + (function (Foo) { + Foo[Foo["A"] = 1024] = "A"; + Foo[Foo["B"] = 2048] = "B"; + })(Ka.Foo || (Ka.Foo = {})); + var Foo = Ka.Foo; +})(Ka || (Ka = {})); +var e1 = Z.Foo.A; // ok +var e2 = Z.Foo.A; // ok, X.Foo is equivalent to X.Foo.A | X.Foo.B +var e3 = Z.Foo.A; // not legal +var e4 = Z.Foo.A; // not legal either because Z.Foo is computed and Z.Foo.A is not necessarily assignable to X.Foo.A +var e5 = Z.Foo.A; // ok diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols index 979bd516682..8df8e21b386 100644 --- a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols @@ -21,8 +21,21 @@ module Y { >B : Symbol(Foo.B, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 7, 10)) } } +module Z { +>Z : Symbol(Z, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 9, 1)) + + export enum Foo { +>Foo : Symbol(Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 10, 10)) + + A = 1 << 1, +>A : Symbol(Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 11, 21)) + + B = 1 << 2, +>B : Symbol(Foo.B, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 12, 19)) + } +} const y: X.Foo | boolean = Y.Foo.A; ->y : Symbol(y, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 10, 5)) +>y : Symbol(y, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 16, 5)) >X : Symbol(X, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 0)) >Foo : Symbol(X.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) >Y.Foo.A : Symbol(Y.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 6, 21)) @@ -31,3 +44,23 @@ const y: X.Foo | boolean = Y.Foo.A; >Foo : Symbol(Y.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 5, 10)) >A : Symbol(Y.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 6, 21)) +const z: X.Foo | boolean = Z.Foo.A; +>z : Symbol(z, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 17, 5)) +>X : Symbol(X, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 0)) +>Foo : Symbol(X.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) +>Z.Foo.A : Symbol(Z.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 11, 21)) +>Z.Foo : Symbol(Z.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 10, 10)) +>Z : Symbol(Z, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 9, 1)) +>Foo : Symbol(Z.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 10, 10)) +>A : Symbol(Z.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 11, 21)) + +const x: Z.Foo | boolean = X.Foo.A; +>x : Symbol(x, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 18, 5)) +>Z : Symbol(Z, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 9, 1)) +>Foo : Symbol(Z.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 10, 10)) +>X.Foo.A : Symbol(X.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 1, 21)) +>X.Foo : Symbol(X.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) +>X : Symbol(X, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 0)) +>Foo : Symbol(X.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) +>A : Symbol(X.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 1, 21)) + diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types index de57b5e92bc..5dbb98bcf9c 100644 --- a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types @@ -21,6 +21,25 @@ module Y { >B : Foo } } +module Z { +>Z : typeof Z + + export enum Foo { +>Foo : Foo + + A = 1 << 1, +>A : Foo +>1 << 1 : number +>1 : number +>1 : number + + B = 1 << 2, +>B : Foo +>1 << 2 : number +>1 : number +>2 : number + } +} const y: X.Foo | boolean = Y.Foo.A; >y : boolean | X.Foo >X : any @@ -31,3 +50,23 @@ const y: X.Foo | boolean = Y.Foo.A; >Foo : typeof Y.Foo >A : Y.Foo +const z: X.Foo | boolean = Z.Foo.A; +>z : boolean | X.Foo +>X : any +>Foo : X.Foo +>Z.Foo.A : Z.Foo +>Z.Foo : typeof Z.Foo +>Z : typeof Z +>Foo : typeof Z.Foo +>A : Z.Foo + +const x: Z.Foo | boolean = X.Foo.A; +>x : boolean | Z.Foo +>Z : any +>Foo : Z.Foo +>X.Foo.A : X.Foo +>X.Foo : typeof X.Foo +>X : typeof X +>Foo : typeof X.Foo +>A : X.Foo + diff --git a/tests/cases/compiler/enumAssignmentCompat5.ts b/tests/cases/compiler/enumAssignmentCompat5.ts new file mode 100644 index 00000000000..c56db8b04f5 --- /dev/null +++ b/tests/cases/compiler/enumAssignmentCompat5.ts @@ -0,0 +1,23 @@ +enum E { + A, B, C +} +enum Computed { + A = 1 << 1, + B = 1 << 2, + C = 1 << 3, +} +let n: number; +let e: E = n; // ok because it's too inconvenient otherwise +e = 0; // ok, in range +e = 4; // ok, out of range, but allowed computed enums don't have all members +let a: E.A = 0; // ok, A === 0 +a = 2; // error, 2 !== 0 +a = n; // ok + +let c: Computed = n; // ok +c = n; // ok +c = 4; // ok +let ca: Computed.A = 1; // error, Computed.A isn't a literal type because Computed has no enum literals + + + diff --git a/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts b/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts index 0c10155e48d..c3029af0f42 100644 --- a/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts +++ b/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts @@ -8,4 +8,20 @@ module Y { A, B } } -const y: X.Foo | boolean = Y.Foo.A; +module Z { + export enum Foo { + A = 1 << 1, + B = 1 << 2, + } +} +module Ka { + export enum Foo { + A = 1 << 10, + B = 1 << 11, + } +} +const e1: X.Foo | boolean = Z.Foo.A; // ok +const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // ok, X.Foo is equivalent to X.Foo.A | X.Foo.B +const e3: X.Foo.B | boolean = Z.Foo.A; // not legal +const e4: X.Foo.A | boolean = Z.Foo.A; // not legal either because Z.Foo is computed and Z.Foo.A is not necessarily assignable to X.Foo.A +const e5: Ka.Foo | boolean = Z.Foo.A; // ok From 661c2778eed26a6ebb411c359d37b2925537652b Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 12 Sep 2016 10:07:21 -0700 Subject: [PATCH 28/44] Fix lint --- src/compiler/checker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3a8016f95f4..f2fbceb277a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6419,9 +6419,9 @@ namespace ts { } if (source.flags & TypeFlags.Enum) { // 1. look through the target union for a literal whose base type is related to the source - let lit = find((target).types, t => t.flags & TypeFlags.EnumLiteral && isEnumTypeRelatedTo(source, (t).baseType)); + const lit = find((target).types, t => t.flags & TypeFlags.EnumLiteral && isEnumTypeRelatedTo(source, (t).baseType)); // 2. if found, the base type is only assignable to source if all its literals are in the target union. - if (lit && (result = isRelatedTo((lit as EnumLiteralType).baseType, target, false))) { + if (lit && (result = isRelatedTo((lit as EnumLiteralType).baseType, target, /*reportErrors*/ false))) { return result; } } From f50a43734b7d17514802be1e5964de00457fbfc0 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 12 Sep 2016 10:14:48 -0700 Subject: [PATCH 29/44] Update baselines --- .../reference/numberAssignableToEnumInsideUnion.types | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/numberAssignableToEnumInsideUnion.types b/tests/baselines/reference/numberAssignableToEnumInsideUnion.types index fd45ff17622..56d6efb0d1e 100644 --- a/tests/baselines/reference/numberAssignableToEnumInsideUnion.types +++ b/tests/baselines/reference/numberAssignableToEnumInsideUnion.types @@ -1,8 +1,8 @@ === tests/cases/compiler/numberAssignableToEnumInsideUnion.ts === enum E { A, B } >E : E ->A : E ->B : E +>A : E.A +>B : E.B let n: number; >n : number From 85f9568a2b9edaae7f4cbbdb6350d4504f0e1f2d Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 12 Sep 2016 14:11:47 -0700 Subject: [PATCH 30/44] Enum assignability:loosen numbers+tighten computed 1. All numbers and numeric literals are assignable to all enums and enum literals. 2. Computed enums are no longer assignable to anything except themselves, even if they would otherwise be "semi-structurally" compatible. --- src/compiler/checker.ts | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f2fbceb277a..1e840e11d6b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6194,9 +6194,10 @@ namespace ts { if (enumRelation[id] !== undefined) { return enumRelation[id]; } - if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & SymbolFlags.RegularEnum) || !(target.symbol.flags & SymbolFlags.RegularEnum)) { - enumRelation[id] = false; - return false; + if (source.symbol.name !== target.symbol.name || + !(source.symbol.flags & SymbolFlags.RegularEnum) || !(target.symbol.flags & SymbolFlags.RegularEnum) || + !(source.flags & TypeFlags.Union) || !(target.flags & TypeFlags.Union)) { + return (enumRelation[id] = false); } const targetEnumType = getTypeOfSymbol(target.symbol); for (const property of getPropertiesOfType(getTypeOfSymbol(source.symbol))) { @@ -6207,13 +6208,11 @@ namespace ts { errorReporter(Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, TypeFormatFlags.UseFullyQualifiedType)); } - enumRelation[id] = false; - return false; + return (enumRelation[id] = false); } } } - enumRelation[id] = true; - return true; + return (enumRelation[id] = true); } function isSimpleTypeRelatedTo(source: Type, target: Type, relation: Map, errorReporter?: ErrorReporter) { @@ -6228,9 +6227,7 @@ namespace ts { if (source.flags & TypeFlags.Null && (!strictNullChecks || target.flags & TypeFlags.Null)) return true; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & TypeFlags.Any) return true; - if (source.flags & TypeFlags.Number && target.flags & TypeFlags.EnumLike) return true; - if (source.flags & TypeFlags.NumberLiteral && target.flags & TypeFlags.Enum) return true; - if (source.flags & TypeFlags.NumberLiteral && target.flags & TypeFlags.EnumLiteral && (source).text === (target).text) return true; + if ((source.flags & TypeFlags.Number | source.flags & TypeFlags.NumberLiteral) && target.flags & TypeFlags.EnumLike) return true; if (source.flags & TypeFlags.EnumLiteral && target.flags & TypeFlags.EnumLiteral && (source).text === (target).text && @@ -6417,14 +6414,6 @@ namespace ts { if (result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & TypeFlags.Primitive) && !(target.flags & TypeFlags.Primitive))) { return result; } - if (source.flags & TypeFlags.Enum) { - // 1. look through the target union for a literal whose base type is related to the source - const lit = find((target).types, t => t.flags & TypeFlags.EnumLiteral && isEnumTypeRelatedTo(source, (t).baseType)); - // 2. if found, the base type is only assignable to source if all its literals are in the target union. - if (lit && (result = isRelatedTo((lit as EnumLiteralType).baseType, target, /*reportErrors*/ false))) { - return result; - } - } } } From 046a37da63292384fc176230d25bf8babe9c94af Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 12 Sep 2016 14:13:17 -0700 Subject: [PATCH 31/44] Update baselines for updated enum assignability --- .../reference/enumAssignmentCompat.errors.txt | 10 +-- .../enumAssignmentCompat2.errors.txt | 10 +-- .../enumAssignmentCompat3.errors.txt | 8 ++- .../enumAssignmentCompat5.errors.txt | 5 +- ...eralAssignableToEnumInsideUnion.errors.txt | 20 ++++-- .../enumLiteralAssignableToEnumInsideUnion.js | 10 +-- ...LiteralAssignableToEnumInsideUnion.symbols | 66 ----------------- ...umLiteralAssignableToEnumInsideUnion.types | 72 ------------------- .../enumLiteralAssignableToEnumInsideUnion.ts | 5 +- 9 files changed, 42 insertions(+), 164 deletions(-) delete mode 100644 tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols delete mode 100644 tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index f1a01247146..780410dcd8c 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. -tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W.a' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type '3' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W.a' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type '5' is not assignable to type 'WStatic'. ==== tests/cases/compiler/enumAssignmentCompat.ts (5 errors) ==== @@ -53,4 +53,4 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' var i: W = W.a; i = W.a; W.D; - var p: W.D; \ No newline at end of file + var p: W.D; diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt index 4e0660eaae3..74e59e4dc39 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. -tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W.a' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type '3' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W.a' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type '5' is not assignable to type 'WStatic'. ==== tests/cases/compiler/enumAssignmentCompat2.ts (5 errors) ==== @@ -52,4 +52,4 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' var i: W = W.a; i = W.a; W.D; - var p: W.D; \ No newline at end of file + var p: W.D; diff --git a/tests/baselines/reference/enumAssignmentCompat3.errors.txt b/tests/baselines/reference/enumAssignmentCompat3.errors.txt index 41fa7a94fca..558540c32c8 100644 --- a/tests/baselines/reference/enumAssignmentCompat3.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat3.errors.txt @@ -2,15 +2,17 @@ tests/cases/compiler/enumAssignmentCompat3.ts(68,1): error TS2324: Property 'd' tests/cases/compiler/enumAssignmentCompat3.ts(70,1): error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. Property 'd' is missing in type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(71,1): error TS2322: Type 'Nope' is not assignable to type 'E'. +tests/cases/compiler/enumAssignmentCompat3.ts(72,1): error TS2322: Type 'Decl.E' is not assignable to type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(75,1): error TS2324: Property 'c' is missing in type 'Ab.E'. tests/cases/compiler/enumAssignmentCompat3.ts(76,1): error TS2322: Type 'First.E' is not assignable to type 'Cd.E'. tests/cases/compiler/enumAssignmentCompat3.ts(77,1): error TS2322: Type 'E' is not assignable to type 'Nope'. +tests/cases/compiler/enumAssignmentCompat3.ts(78,1): error TS2322: Type 'First.E' is not assignable to type 'Decl.E'. tests/cases/compiler/enumAssignmentCompat3.ts(82,1): error TS2322: Type 'Const.E' is not assignable to type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(83,1): error TS2322: Type 'First.E' is not assignable to type 'Const.E'. tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2324: Property 'd' is missing in type 'First.E'. -==== tests/cases/compiler/enumAssignmentCompat3.ts (9 errors) ==== +==== tests/cases/compiler/enumAssignmentCompat3.ts (11 errors) ==== namespace First { export enum E { a, b, c, @@ -90,6 +92,8 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2324: Property 'd' ~~~ !!! error TS2322: Type 'Nope' is not assignable to type 'E'. abc = decl; // ok + ~~~ +!!! error TS2322: Type 'Decl.E' is not assignable to type 'First.E'. secondAbc = abc; // ok secondAbcd = abc; // ok secondAb = abc; // missing 'c' @@ -102,6 +106,8 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2324: Property 'd' ~~~~ !!! error TS2322: Type 'E' is not assignable to type 'Nope'. decl = abc; // ok + ~~~~ +!!! error TS2322: Type 'First.E' is not assignable to type 'Decl.E'. // const is only assignable to itself k = k; diff --git a/tests/baselines/reference/enumAssignmentCompat5.errors.txt b/tests/baselines/reference/enumAssignmentCompat5.errors.txt index 98c0aaccfad..ef703a2ad62 100644 --- a/tests/baselines/reference/enumAssignmentCompat5.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat5.errors.txt @@ -1,8 +1,7 @@ -tests/cases/compiler/enumAssignmentCompat5.ts(14,1): error TS2322: Type '2' is not assignable to type 'E.A'. tests/cases/compiler/enumAssignmentCompat5.ts(20,9): error TS2535: Enum type 'Computed' has members with initializers that are not literals. -==== tests/cases/compiler/enumAssignmentCompat5.ts (2 errors) ==== +==== tests/cases/compiler/enumAssignmentCompat5.ts (1 errors) ==== enum E { A, B, C } @@ -17,8 +16,6 @@ tests/cases/compiler/enumAssignmentCompat5.ts(20,9): error TS2535: Enum type 'Co e = 4; // ok, out of range, but allowed computed enums don't have all members let a: E.A = 0; // ok, A === 0 a = 2; // error, 2 !== 0 - ~ -!!! error TS2322: Type '2' is not assignable to type 'E.A'. a = n; // ok let c: Computed = n; // ok diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt index 37bdc99a922..f79a9d19cd6 100644 --- a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt @@ -1,8 +1,11 @@ -tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(25,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.B'. -tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(26,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.A'. +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(24,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(25,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(26,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.B'. +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(27,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.A'. +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(28,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. -==== tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts (2 errors) ==== +==== tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts (5 errors) ==== module X { export enum Foo { A, B @@ -25,8 +28,13 @@ tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(26,7): error TS23 B = 1 << 11, } } - const e1: X.Foo | boolean = Z.Foo.A; // ok - const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // ok, X.Foo is equivalent to X.Foo.A | X.Foo.B + const e0: X.Foo | boolean = Y.Foo.A; // ok + const e1: X.Foo | boolean = Z.Foo.A; // not legal, Z is computed + ~~ +!!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. + const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // still not legal + ~~ +!!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. const e3: X.Foo.B | boolean = Z.Foo.A; // not legal ~~ !!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.B'. @@ -34,4 +42,6 @@ tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(26,7): error TS23 ~~ !!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.A'. const e5: Ka.Foo | boolean = Z.Foo.A; // ok + ~~ +!!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js index 1665e729719..8786745a504 100644 --- a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js @@ -21,8 +21,9 @@ module Ka { B = 1 << 11, } } -const e1: X.Foo | boolean = Z.Foo.A; // ok -const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // ok, X.Foo is equivalent to X.Foo.A | X.Foo.B +const e0: X.Foo | boolean = Y.Foo.A; // ok +const e1: X.Foo | boolean = Z.Foo.A; // not legal, Z is computed +const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // still not legal const e3: X.Foo.B | boolean = Z.Foo.A; // not legal const e4: X.Foo.A | boolean = Z.Foo.A; // not legal either because Z.Foo is computed and Z.Foo.A is not necessarily assignable to X.Foo.A const e5: Ka.Foo | boolean = Z.Foo.A; // ok @@ -61,8 +62,9 @@ var Ka; })(Ka.Foo || (Ka.Foo = {})); var Foo = Ka.Foo; })(Ka || (Ka = {})); -var e1 = Z.Foo.A; // ok -var e2 = Z.Foo.A; // ok, X.Foo is equivalent to X.Foo.A | X.Foo.B +var e0 = Y.Foo.A; // ok +var e1 = Z.Foo.A; // not legal, Z is computed +var e2 = Z.Foo.A; // still not legal var e3 = Z.Foo.A; // not legal var e4 = Z.Foo.A; // not legal either because Z.Foo is computed and Z.Foo.A is not necessarily assignable to X.Foo.A var e5 = Z.Foo.A; // ok diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols deleted file mode 100644 index 8df8e21b386..00000000000 --- a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.symbols +++ /dev/null @@ -1,66 +0,0 @@ -=== tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts === -module X { ->X : Symbol(X, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 0)) - - export enum Foo { ->Foo : Symbol(Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) - - A, B ->A : Symbol(Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 1, 21)) ->B : Symbol(Foo.B, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 2, 10)) - } -} -module Y { ->Y : Symbol(Y, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 4, 1)) - - export enum Foo { ->Foo : Symbol(Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 5, 10)) - - A, B ->A : Symbol(Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 6, 21)) ->B : Symbol(Foo.B, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 7, 10)) - } -} -module Z { ->Z : Symbol(Z, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 9, 1)) - - export enum Foo { ->Foo : Symbol(Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 10, 10)) - - A = 1 << 1, ->A : Symbol(Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 11, 21)) - - B = 1 << 2, ->B : Symbol(Foo.B, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 12, 19)) - } -} -const y: X.Foo | boolean = Y.Foo.A; ->y : Symbol(y, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 16, 5)) ->X : Symbol(X, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 0)) ->Foo : Symbol(X.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) ->Y.Foo.A : Symbol(Y.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 6, 21)) ->Y.Foo : Symbol(Y.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 5, 10)) ->Y : Symbol(Y, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 4, 1)) ->Foo : Symbol(Y.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 5, 10)) ->A : Symbol(Y.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 6, 21)) - -const z: X.Foo | boolean = Z.Foo.A; ->z : Symbol(z, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 17, 5)) ->X : Symbol(X, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 0)) ->Foo : Symbol(X.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) ->Z.Foo.A : Symbol(Z.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 11, 21)) ->Z.Foo : Symbol(Z.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 10, 10)) ->Z : Symbol(Z, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 9, 1)) ->Foo : Symbol(Z.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 10, 10)) ->A : Symbol(Z.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 11, 21)) - -const x: Z.Foo | boolean = X.Foo.A; ->x : Symbol(x, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 18, 5)) ->Z : Symbol(Z, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 9, 1)) ->Foo : Symbol(Z.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 10, 10)) ->X.Foo.A : Symbol(X.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 1, 21)) ->X.Foo : Symbol(X.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) ->X : Symbol(X, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 0)) ->Foo : Symbol(X.Foo, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 0, 10)) ->A : Symbol(X.Foo.A, Decl(enumLiteralAssignableToEnumInsideUnion.ts, 1, 21)) - diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types deleted file mode 100644 index 5dbb98bcf9c..00000000000 --- a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.types +++ /dev/null @@ -1,72 +0,0 @@ -=== tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts === -module X { ->X : typeof X - - export enum Foo { ->Foo : Foo - - A, B ->A : Foo ->B : Foo - } -} -module Y { ->Y : typeof Y - - export enum Foo { ->Foo : Foo - - A, B ->A : Foo ->B : Foo - } -} -module Z { ->Z : typeof Z - - export enum Foo { ->Foo : Foo - - A = 1 << 1, ->A : Foo ->1 << 1 : number ->1 : number ->1 : number - - B = 1 << 2, ->B : Foo ->1 << 2 : number ->1 : number ->2 : number - } -} -const y: X.Foo | boolean = Y.Foo.A; ->y : boolean | X.Foo ->X : any ->Foo : X.Foo ->Y.Foo.A : Y.Foo ->Y.Foo : typeof Y.Foo ->Y : typeof Y ->Foo : typeof Y.Foo ->A : Y.Foo - -const z: X.Foo | boolean = Z.Foo.A; ->z : boolean | X.Foo ->X : any ->Foo : X.Foo ->Z.Foo.A : Z.Foo ->Z.Foo : typeof Z.Foo ->Z : typeof Z ->Foo : typeof Z.Foo ->A : Z.Foo - -const x: Z.Foo | boolean = X.Foo.A; ->x : boolean | Z.Foo ->Z : any ->Foo : Z.Foo ->X.Foo.A : X.Foo ->X.Foo : typeof X.Foo ->X : typeof X ->Foo : typeof X.Foo ->A : X.Foo - diff --git a/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts b/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts index c3029af0f42..19cd98fd5e8 100644 --- a/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts +++ b/tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts @@ -20,8 +20,9 @@ module Ka { B = 1 << 11, } } -const e1: X.Foo | boolean = Z.Foo.A; // ok -const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // ok, X.Foo is equivalent to X.Foo.A | X.Foo.B +const e0: X.Foo | boolean = Y.Foo.A; // ok +const e1: X.Foo | boolean = Z.Foo.A; // not legal, Z is computed +const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // still not legal const e3: X.Foo.B | boolean = Z.Foo.A; // not legal const e4: X.Foo.A | boolean = Z.Foo.A; // not legal either because Z.Foo is computed and Z.Foo.A is not necessarily assignable to X.Foo.A const e5: Ka.Foo | boolean = Z.Foo.A; // ok From b07f2da278a95a4b06e841e437f71690c946f487 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 12 Sep 2016 14:43:24 -0700 Subject: [PATCH 32/44] Computed enum assignability is semi-structural --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1e840e11d6b..76ef41e0798 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6196,7 +6196,7 @@ namespace ts { } if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & SymbolFlags.RegularEnum) || !(target.symbol.flags & SymbolFlags.RegularEnum) || - !(source.flags & TypeFlags.Union) || !(target.flags & TypeFlags.Union)) { + (source.flags & TypeFlags.Union) !== (target.flags & TypeFlags.Union)) { return (enumRelation[id] = false); } const targetEnumType = getTypeOfSymbol(target.symbol); From 7d066fe51c723f378c8076be8b0fd3a4a40808d0 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 12 Sep 2016 14:43:44 -0700 Subject: [PATCH 33/44] Update baselines --- .../enumLiteralAssignableToEnumInsideUnion.errors.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt index f79a9d19cd6..660e1094ae9 100644 --- a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt @@ -2,10 +2,9 @@ tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(24,7): error TS23 tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(25,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(26,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.B'. tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(27,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.A'. -tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(28,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. -==== tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts (5 errors) ==== +==== tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts (4 errors) ==== module X { export enum Foo { A, B @@ -42,6 +41,4 @@ tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(28,7): error TS23 ~~ !!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.A'. const e5: Ka.Foo | boolean = Z.Foo.A; // ok - ~~ -!!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. \ No newline at end of file From 76fa7b94725aad29c41af47ba2fc21f95142107e Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 13 Sep 2016 08:48:07 -0700 Subject: [PATCH 34/44] Remove unnecessary parentheses --- src/compiler/checker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 76ef41e0798..9f1a0d49300 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6197,7 +6197,7 @@ namespace ts { if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & SymbolFlags.RegularEnum) || !(target.symbol.flags & SymbolFlags.RegularEnum) || (source.flags & TypeFlags.Union) !== (target.flags & TypeFlags.Union)) { - return (enumRelation[id] = false); + return enumRelation[id] = false; } const targetEnumType = getTypeOfSymbol(target.symbol); for (const property of getPropertiesOfType(getTypeOfSymbol(source.symbol))) { @@ -6208,11 +6208,11 @@ namespace ts { errorReporter(Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, TypeFormatFlags.UseFullyQualifiedType)); } - return (enumRelation[id] = false); + return enumRelation[id] = false; } } } - return (enumRelation[id] = true); + return enumRelation[id] = true; } function isSimpleTypeRelatedTo(source: Type, target: Type, relation: Map, errorReporter?: ErrorReporter) { From fcac9c4fc505eeef19fc1770cfd4a03e6bf58ab1 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 13 Sep 2016 13:22:49 -0700 Subject: [PATCH 35/44] Update baselines after cherry-pick to 2.0 --- .../reference/enumAssignmentCompat.errors.txt | 10 +++++----- .../reference/enumAssignmentCompat2.errors.txt | 10 +++++----- .../reference/numberAssignableToEnumInsideUnion.types | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index 780410dcd8c..f1a01247146 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W.a' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type '3' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W.a' is not assignable to type 'WStatic'. -tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type '5' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. ==== tests/cases/compiler/enumAssignmentCompat.ts (5 errors) ==== @@ -53,4 +53,4 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type '5' is no var i: W = W.a; i = W.a; W.D; - var p: W.D; + var p: W.D; \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt index 74e59e4dc39..4e0660eaae3 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W.a' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type '3' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W.a' is not assignable to type 'WStatic'. -tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type '5' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. ==== tests/cases/compiler/enumAssignmentCompat2.ts (5 errors) ==== @@ -52,4 +52,4 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type '5' is n var i: W = W.a; i = W.a; W.D; - var p: W.D; + var p: W.D; \ No newline at end of file diff --git a/tests/baselines/reference/numberAssignableToEnumInsideUnion.types b/tests/baselines/reference/numberAssignableToEnumInsideUnion.types index 56d6efb0d1e..fd45ff17622 100644 --- a/tests/baselines/reference/numberAssignableToEnumInsideUnion.types +++ b/tests/baselines/reference/numberAssignableToEnumInsideUnion.types @@ -1,8 +1,8 @@ === tests/cases/compiler/numberAssignableToEnumInsideUnion.ts === enum E { A, B } >E : E ->A : E.A ->B : E.B +>A : E +>B : E let n: number; >n : number From 332b3165c3add28bf317c115cc8fe693406f2e89 Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 14 Sep 2016 11:54:17 -0700 Subject: [PATCH 36/44] Emit declaration file which inferred type alias with its value --- src/compiler/checker.ts | 9 +++++++-- src/compiler/declarationEmitter.ts | 2 +- src/compiler/types.ts | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9f1a0d49300..e1f230ce096 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2150,8 +2150,13 @@ namespace ts { buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, SymbolFlags.Type, SymbolFormatFlags.None, nextFlags); } else if (!(flags & TypeFormatFlags.InTypeAlias) && type.flags & (TypeFlags.Anonymous | TypeFlags.UnionOrIntersection) && type.aliasSymbol) { - const typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + if (type.flags & TypeFlags.Anonymous || !(flags & TypeFormatFlags.UseTypeAliasValue)) { + const typeArguments = type.aliasTypeArguments; + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + } + else { + writeUnionOrIntersectionType(type, nextFlags); + } } else if (type.flags & TypeFlags.UnionOrIntersection) { writeUnionOrIntersectionType(type, nextFlags); diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index ab1ca518256..f519a5881b7 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -327,7 +327,7 @@ namespace ts { } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue, writer); errorNameNode = undefined; } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 50beef52bf8..4c4cf52087c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1946,6 +1946,7 @@ namespace ts { UseFullyQualifiedType = 0x00000080, // Write out the fully qualified type name (eg. Module.Type, instead of Type) InFirstTypeArgument = 0x00000100, // Writing first type argument of the instantiated type InTypeAlias = 0x00000200, // Writing type in type alias declaration + UseTypeAliasValue = 0x00000400, // Writing infered type alias as its value. This is used when we emit declaration file } export const enum SymbolFormatFlags { From ced8cf867047cf3a44e4beee68dae3cc7a0a36d4 Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 14 Sep 2016 11:55:13 -0700 Subject: [PATCH 37/44] Add tests and update baselines --- .../declarationEmitInferedTypeAlias1.js | 30 +++++++++++++++++++ .../declarationEmitInferedTypeAlias1.symbols | 19 ++++++++++++ .../declarationEmitInferedTypeAlias1.types | 23 ++++++++++++++ .../stringLiteralTypesAndTuples01.js | 2 +- .../stringLiteralTypesOverloads01.js | 2 +- .../declarationEmitInferedTypeAlias1.ts | 13 ++++++++ 6 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/declarationEmitInferedTypeAlias1.js create mode 100644 tests/baselines/reference/declarationEmitInferedTypeAlias1.symbols create mode 100644 tests/baselines/reference/declarationEmitInferedTypeAlias1.types create mode 100644 tests/cases/compiler/declarationEmitInferedTypeAlias1.ts diff --git a/tests/baselines/reference/declarationEmitInferedTypeAlias1.js b/tests/baselines/reference/declarationEmitInferedTypeAlias1.js new file mode 100644 index 00000000000..05ce74e3bad --- /dev/null +++ b/tests/baselines/reference/declarationEmitInferedTypeAlias1.js @@ -0,0 +1,30 @@ +//// [tests/cases/compiler/declarationEmitInferedTypeAlias1.ts] //// + +//// [0.ts] + +{ + type Data = string | boolean; + let obj: Data = true; +} +export { } + +//// [1.ts] +let v = "str" || true; +export { v } + +//// [0.js] +"use strict"; +{ + var obj = true; +} +//// [1.js] +"use strict"; +var v = "str" || true; +exports.v = v; + + +//// [0.d.ts] +export { }; +//// [1.d.ts] +declare let v: string | boolean; +export { v }; diff --git a/tests/baselines/reference/declarationEmitInferedTypeAlias1.symbols b/tests/baselines/reference/declarationEmitInferedTypeAlias1.symbols new file mode 100644 index 00000000000..94599418c5d --- /dev/null +++ b/tests/baselines/reference/declarationEmitInferedTypeAlias1.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/0.ts === + +{ + type Data = string | boolean; +>Data : Symbol(Data, Decl(0.ts, 1, 1)) + + let obj: Data = true; +>obj : Symbol(obj, Decl(0.ts, 3, 7)) +>Data : Symbol(Data, Decl(0.ts, 1, 1)) +} +export { } + +=== tests/cases/compiler/1.ts === +let v = "str" || true; +>v : Symbol(v, Decl(1.ts, 0, 3)) + +export { v } +>v : Symbol(v, Decl(1.ts, 1, 8)) + diff --git a/tests/baselines/reference/declarationEmitInferedTypeAlias1.types b/tests/baselines/reference/declarationEmitInferedTypeAlias1.types new file mode 100644 index 00000000000..8da9e8b291e --- /dev/null +++ b/tests/baselines/reference/declarationEmitInferedTypeAlias1.types @@ -0,0 +1,23 @@ +=== tests/cases/compiler/0.ts === + +{ + type Data = string | boolean; +>Data : Data + + let obj: Data = true; +>obj : Data +>Data : Data +>true : true +} +export { } + +=== tests/cases/compiler/1.ts === +let v = "str" || true; +>v : Data +>"str" || true : Data +>"str" : string +>true : boolean + +export { v } +>v : Data + diff --git a/tests/baselines/reference/stringLiteralTypesAndTuples01.js b/tests/baselines/reference/stringLiteralTypesAndTuples01.js index b887213c8f6..ae02d12429a 100644 --- a/tests/baselines/reference/stringLiteralTypesAndTuples01.js +++ b/tests/baselines/reference/stringLiteralTypesAndTuples01.js @@ -38,5 +38,5 @@ function rawr(dino) { //// [stringLiteralTypesAndTuples01.d.ts] declare let hello: string, brave: string, newish: string, world: string; declare type RexOrRaptor = "t-rex" | "raptor"; -declare let im: "I'm", a: "a", dinosaur: RexOrRaptor; +declare let im: "I'm", a: "a", dinosaur: "t-rex" | "raptor"; declare function rawr(dino: RexOrRaptor): string; diff --git a/tests/baselines/reference/stringLiteralTypesOverloads01.js b/tests/baselines/reference/stringLiteralTypesOverloads01.js index dd050b5e464..ef441a40985 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads01.js +++ b/tests/baselines/reference/stringLiteralTypesOverloads01.js @@ -109,6 +109,6 @@ declare const boolean: "boolean"; declare const stringOrNumber: "string" | "number"; declare const stringOrBoolean: "string" | "boolean"; declare const booleanOrNumber: "number" | "boolean"; -declare const stringOrBooleanOrNumber: PrimitiveName; +declare const stringOrBooleanOrNumber: "string" | "number" | "boolean"; declare namespace Consts2 { } diff --git a/tests/cases/compiler/declarationEmitInferedTypeAlias1.ts b/tests/cases/compiler/declarationEmitInferedTypeAlias1.ts new file mode 100644 index 00000000000..be40faa8c53 --- /dev/null +++ b/tests/cases/compiler/declarationEmitInferedTypeAlias1.ts @@ -0,0 +1,13 @@ +// @declaration: true +// @skipDefaultLibCheck: true + +// @Filename: 0.ts +{ + type Data = string | boolean; + let obj: Data = true; +} +export { } + +// @Filename: 1.ts +let v = "str" || true; +export { v } \ No newline at end of file From b6aeaab019159ec7960c8bc4ab60eeafa38115c7 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 14 Sep 2016 13:13:34 -0700 Subject: [PATCH 38/44] Update version --- package.json | 2 +- src/compiler/program.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cb535b17c72..1cc479d0603 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "http://typescriptlang.org/", - "version": "2.0.2", + "version": "2.0.3", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 9d9af0fe842..598a117645c 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -5,7 +5,7 @@ namespace ts { /** The version of the TypeScript compiler release */ - export const version = "2.0.2"; + export const version = "2.0.3"; const emptyArray: any[] = []; From 14b59b23e7f738cb50f04e133f231911846c21cc Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 14 Sep 2016 13:30:15 -0700 Subject: [PATCH 39/44] Address PR --- src/compiler/declarationEmitter.ts | 6 +++--- src/compiler/types.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index f519a5881b7..6ded3a53333 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -341,7 +341,7 @@ namespace ts { } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue, writer); errorNameNode = undefined; } } @@ -563,7 +563,7 @@ namespace ts { write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue, writer); write(";"); writeLine(); write(node.isExportEquals ? "export = " : "export default "); @@ -1025,7 +1025,7 @@ namespace ts { } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; - resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue, writer); } function getHeritageClauseVisibilityError(symbolAccessibilityResult: SymbolAccessibilityResult): SymbolAccessibilityDiagnostic { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4c4cf52087c..34f86c0d031 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1946,7 +1946,7 @@ namespace ts { UseFullyQualifiedType = 0x00000080, // Write out the fully qualified type name (eg. Module.Type, instead of Type) InFirstTypeArgument = 0x00000100, // Writing first type argument of the instantiated type InTypeAlias = 0x00000200, // Writing type in type alias declaration - UseTypeAliasValue = 0x00000400, // Writing infered type alias as its value. This is used when we emit declaration file + UseTypeAliasValue = 0x00000400, // Serialize the type instead of using type-alias. This is needed when we emit declaration file. } export const enum SymbolFormatFlags { From 0c443c256971d9d5208095df82e67776b7d0a04c Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 14 Sep 2016 13:30:16 -0700 Subject: [PATCH 40/44] Update LKG --- lib/tsc.js | 30 +++++++++++++++++++++++------- lib/tsserver.js | 30 +++++++++++++++++++++++------- lib/tsserverlibrary.js | 30 +++++++++++++++++++++++------- lib/typescript.js | 30 +++++++++++++++++++++++------- lib/typescriptServices.js | 30 +++++++++++++++++++++++------- 5 files changed, 115 insertions(+), 35 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index a406821066c..45fa034a5d8 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -13414,6 +13414,7 @@ var ts; var assignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); + var enumRelation = ts.createMap(); var _displayBuilder; var builtinGlobals = ts.createMap(); builtinGlobals[undefinedSymbol.name] = undefinedSymbol; @@ -18129,8 +18130,14 @@ var ts; if (source === target) { return true; } - if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256) || !(target.symbol.flags & 256)) { - return false; + var id = source.id + "," + target.id; + if (enumRelation[id] !== undefined) { + return enumRelation[id]; + } + if (source.symbol.name !== target.symbol.name || + !(source.symbol.flags & 256) || !(target.symbol.flags & 256) || + (source.flags & 524288) !== (target.flags & 524288)) { + return enumRelation[id] = false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -18141,11 +18148,11 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, undefined, 128)); } - return false; + return enumRelation[id] = false; } } } - return true; + return enumRelation[id] = true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192) @@ -18169,10 +18176,19 @@ var ts; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1) return true; - if (source.flags & (4 | 64) && target.flags & 16) + if ((source.flags & 4 | source.flags & 64) && target.flags & 272) return true; - if (source.flags & 64 && target.flags & 256 && source.text === target.text) + if (source.flags & 256 && + target.flags & 256 && + source.text === target.text && + isEnumTypeRelatedTo(source.baseType, target.baseType, errorReporter)) { return true; + } + if (source.flags & 256 && + target.flags & 16 && + isEnumTypeRelatedTo(target, source.baseType, errorReporter)) { + return true; + } } return false; } @@ -36543,7 +36559,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.version = "2.0.2"; + ts.version = "2.0.3"; var emptyArray = []; function findConfigFile(searchPath, fileExists) { while (true) { diff --git a/lib/tsserver.js b/lib/tsserver.js index b469d67279a..3c0cd955fcc 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -14410,6 +14410,7 @@ var ts; var assignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); + var enumRelation = ts.createMap(); var _displayBuilder; var builtinGlobals = ts.createMap(); builtinGlobals[undefinedSymbol.name] = undefinedSymbol; @@ -19125,8 +19126,14 @@ var ts; if (source === target) { return true; } - if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256) || !(target.symbol.flags & 256)) { - return false; + var id = source.id + "," + target.id; + if (enumRelation[id] !== undefined) { + return enumRelation[id]; + } + if (source.symbol.name !== target.symbol.name || + !(source.symbol.flags & 256) || !(target.symbol.flags & 256) || + (source.flags & 524288) !== (target.flags & 524288)) { + return enumRelation[id] = false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -19137,11 +19144,11 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, undefined, 128)); } - return false; + return enumRelation[id] = false; } } } - return true; + return enumRelation[id] = true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192) @@ -19165,10 +19172,19 @@ var ts; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1) return true; - if (source.flags & (4 | 64) && target.flags & 16) + if ((source.flags & 4 | source.flags & 64) && target.flags & 272) return true; - if (source.flags & 64 && target.flags & 256 && source.text === target.text) + if (source.flags & 256 && + target.flags & 256 && + source.text === target.text && + isEnumTypeRelatedTo(source.baseType, target.baseType, errorReporter)) { return true; + } + if (source.flags & 256 && + target.flags & 16 && + isEnumTypeRelatedTo(target, source.baseType, errorReporter)) { + return true; + } } return false; } @@ -37539,7 +37555,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.version = "2.0.2"; + ts.version = "2.0.3"; var emptyArray = []; function findConfigFile(searchPath, fileExists) { while (true) { diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 2c5f0a8bf28..bf90d17d542 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -14410,6 +14410,7 @@ var ts; var assignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); + var enumRelation = ts.createMap(); var _displayBuilder; var builtinGlobals = ts.createMap(); builtinGlobals[undefinedSymbol.name] = undefinedSymbol; @@ -19125,8 +19126,14 @@ var ts; if (source === target) { return true; } - if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256) || !(target.symbol.flags & 256)) { - return false; + var id = source.id + "," + target.id; + if (enumRelation[id] !== undefined) { + return enumRelation[id]; + } + if (source.symbol.name !== target.symbol.name || + !(source.symbol.flags & 256) || !(target.symbol.flags & 256) || + (source.flags & 524288) !== (target.flags & 524288)) { + return enumRelation[id] = false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -19137,11 +19144,11 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, undefined, 128)); } - return false; + return enumRelation[id] = false; } } } - return true; + return enumRelation[id] = true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192) @@ -19165,10 +19172,19 @@ var ts; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1) return true; - if (source.flags & (4 | 64) && target.flags & 16) + if ((source.flags & 4 | source.flags & 64) && target.flags & 272) return true; - if (source.flags & 64 && target.flags & 256 && source.text === target.text) + if (source.flags & 256 && + target.flags & 256 && + source.text === target.text && + isEnumTypeRelatedTo(source.baseType, target.baseType, errorReporter)) { return true; + } + if (source.flags & 256 && + target.flags & 16 && + isEnumTypeRelatedTo(target, source.baseType, errorReporter)) { + return true; + } } return false; } @@ -37539,7 +37555,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.version = "2.0.2"; + ts.version = "2.0.3"; var emptyArray = []; function findConfigFile(searchPath, fileExists) { while (true) { diff --git a/lib/typescript.js b/lib/typescript.js index a1d387f2539..4dd7530f305 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -16791,6 +16791,7 @@ var ts; var assignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); + var enumRelation = ts.createMap(); // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. var _displayBuilder; var TypeSystemPropertyName; @@ -22135,8 +22136,14 @@ var ts; if (source === target) { return true; } - if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256 /* RegularEnum */) || !(target.symbol.flags & 256 /* RegularEnum */)) { - return false; + var id = source.id + "," + target.id; + if (enumRelation[id] !== undefined) { + return enumRelation[id]; + } + if (source.symbol.name !== target.symbol.name || + !(source.symbol.flags & 256 /* RegularEnum */) || !(target.symbol.flags & 256 /* RegularEnum */) || + (source.flags & 524288 /* Union */) !== (target.flags & 524288 /* Union */)) { + return enumRelation[id] = false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -22147,11 +22154,11 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, 128 /* UseFullyQualifiedType */)); } - return false; + return enumRelation[id] = false; } } } - return true; + return enumRelation[id] = true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192 /* Never */) @@ -22175,10 +22182,19 @@ var ts; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1 /* Any */) return true; - if (source.flags & (4 /* Number */ | 64 /* NumberLiteral */) && target.flags & 16 /* Enum */) + if ((source.flags & 4 /* Number */ | source.flags & 64 /* NumberLiteral */) && target.flags & 272 /* EnumLike */) return true; - if (source.flags & 64 /* NumberLiteral */ && target.flags & 256 /* EnumLiteral */ && source.text === target.text) + if (source.flags & 256 /* EnumLiteral */ && + target.flags & 256 /* EnumLiteral */ && + source.text === target.text && + isEnumTypeRelatedTo(source.baseType, target.baseType, errorReporter)) { return true; + } + if (source.flags & 256 /* EnumLiteral */ && + target.flags & 16 /* Enum */ && + isEnumTypeRelatedTo(target, source.baseType, errorReporter)) { + return true; + } } return false; } @@ -43950,7 +43966,7 @@ var ts; var ts; (function (ts) { /** The version of the TypeScript compiler release */ - ts.version = "2.0.2"; + ts.version = "2.0.3"; var emptyArray = []; function findConfigFile(searchPath, fileExists) { while (true) { diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index a1d387f2539..4dd7530f305 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -16791,6 +16791,7 @@ var ts; var assignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); + var enumRelation = ts.createMap(); // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. var _displayBuilder; var TypeSystemPropertyName; @@ -22135,8 +22136,14 @@ var ts; if (source === target) { return true; } - if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & 256 /* RegularEnum */) || !(target.symbol.flags & 256 /* RegularEnum */)) { - return false; + var id = source.id + "," + target.id; + if (enumRelation[id] !== undefined) { + return enumRelation[id]; + } + if (source.symbol.name !== target.symbol.name || + !(source.symbol.flags & 256 /* RegularEnum */) || !(target.symbol.flags & 256 /* RegularEnum */) || + (source.flags & 524288 /* Union */) !== (target.flags & 524288 /* Union */)) { + return enumRelation[id] = false; } var targetEnumType = getTypeOfSymbol(target.symbol); for (var _i = 0, _a = getPropertiesOfType(getTypeOfSymbol(source.symbol)); _i < _a.length; _i++) { @@ -22147,11 +22154,11 @@ var ts; if (errorReporter) { errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, 128 /* UseFullyQualifiedType */)); } - return false; + return enumRelation[id] = false; } } } - return true; + return enumRelation[id] = true; } function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { if (target.flags & 8192 /* Never */) @@ -22175,10 +22182,19 @@ var ts; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & 1 /* Any */) return true; - if (source.flags & (4 /* Number */ | 64 /* NumberLiteral */) && target.flags & 16 /* Enum */) + if ((source.flags & 4 /* Number */ | source.flags & 64 /* NumberLiteral */) && target.flags & 272 /* EnumLike */) return true; - if (source.flags & 64 /* NumberLiteral */ && target.flags & 256 /* EnumLiteral */ && source.text === target.text) + if (source.flags & 256 /* EnumLiteral */ && + target.flags & 256 /* EnumLiteral */ && + source.text === target.text && + isEnumTypeRelatedTo(source.baseType, target.baseType, errorReporter)) { return true; + } + if (source.flags & 256 /* EnumLiteral */ && + target.flags & 16 /* Enum */ && + isEnumTypeRelatedTo(target, source.baseType, errorReporter)) { + return true; + } } return false; } @@ -43950,7 +43966,7 @@ var ts; var ts; (function (ts) { /** The version of the TypeScript compiler release */ - ts.version = "2.0.2"; + ts.version = "2.0.3"; var emptyArray = []; function findConfigFile(searchPath, fileExists) { while (true) { From 4ce228055926252c4f823245c49d9e3d9fc91164 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 14 Sep 2016 13:42:01 -0700 Subject: [PATCH 41/44] Update LKG --- lib/tsc.js | 17 +++++++++++------ lib/tsserver.js | 17 +++++++++++------ lib/tsserverlibrary.d.ts | 1 + lib/tsserverlibrary.js | 17 +++++++++++------ lib/typescript.d.ts | 1 + lib/typescript.js | 18 ++++++++++++------ lib/typescriptServices.d.ts | 1 + lib/typescriptServices.js | 18 ++++++++++++------ 8 files changed, 60 insertions(+), 30 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index 45fa034a5d8..4c3cda93213 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -14792,8 +14792,13 @@ var ts; buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064, 0, nextFlags); } else if (!(flags & 512) && type.flags & (2097152 | 1572864) && type.aliasSymbol) { - var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + if (type.flags & 2097152 || !(flags & 1024)) { + var typeArguments = type.aliasTypeArguments; + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + } + else { + writeUnionOrIntersectionType(type, nextFlags); + } } else if (type.flags & 1572864) { writeUnionOrIntersectionType(type, nextFlags); @@ -29039,7 +29044,7 @@ var ts; } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2, writer); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 | 1024, writer); errorNameNode = undefined; } } @@ -29051,7 +29056,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2 | 1024, writer); errorNameNode = undefined; } } @@ -29244,7 +29249,7 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 | 1024, writer); write(";"); writeLine(); write(node.isExportEquals ? "export = " : "export default "); @@ -29649,7 +29654,7 @@ var ts; } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; - resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2, writer); + resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 | 1024, writer); } function getHeritageClauseVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; diff --git a/lib/tsserver.js b/lib/tsserver.js index 3c0cd955fcc..ec61c9c87a0 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -15788,8 +15788,13 @@ var ts; buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064, 0, nextFlags); } else if (!(flags & 512) && type.flags & (2097152 | 1572864) && type.aliasSymbol) { - var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + if (type.flags & 2097152 || !(flags & 1024)) { + var typeArguments = type.aliasTypeArguments; + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + } + else { + writeUnionOrIntersectionType(type, nextFlags); + } } else if (type.flags & 1572864) { writeUnionOrIntersectionType(type, nextFlags); @@ -30035,7 +30040,7 @@ var ts; } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2, writer); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 | 1024, writer); errorNameNode = undefined; } } @@ -30047,7 +30052,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2 | 1024, writer); errorNameNode = undefined; } } @@ -30240,7 +30245,7 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 | 1024, writer); write(";"); writeLine(); write(node.isExportEquals ? "export = " : "export default "); @@ -30645,7 +30650,7 @@ var ts; } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; - resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2, writer); + resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 | 1024, writer); } function getHeritageClauseVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index c7ca800d0fe..62f22632feb 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -1319,6 +1319,7 @@ declare namespace ts { UseFullyQualifiedType = 128, InFirstTypeArgument = 256, InTypeAlias = 512, + UseTypeAliasValue = 1024, } const enum SymbolFormatFlags { None = 0, diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index bf90d17d542..ec39a42fecf 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -15788,8 +15788,13 @@ var ts; buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064, 0, nextFlags); } else if (!(flags & 512) && type.flags & (2097152 | 1572864) && type.aliasSymbol) { - var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + if (type.flags & 2097152 || !(flags & 1024)) { + var typeArguments = type.aliasTypeArguments; + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + } + else { + writeUnionOrIntersectionType(type, nextFlags); + } } else if (type.flags & 1572864) { writeUnionOrIntersectionType(type, nextFlags); @@ -30035,7 +30040,7 @@ var ts; } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2, writer); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 | 1024, writer); errorNameNode = undefined; } } @@ -30047,7 +30052,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2 | 1024, writer); errorNameNode = undefined; } } @@ -30240,7 +30245,7 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 | 1024, writer); write(";"); writeLine(); write(node.isExportEquals ? "export = " : "export default "); @@ -30645,7 +30650,7 @@ var ts; } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; - resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2, writer); + resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 | 1024, writer); } function getHeritageClauseVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 4855f1511ad..e8a6b54541e 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -1328,6 +1328,7 @@ declare namespace ts { UseFullyQualifiedType = 128, InFirstTypeArgument = 256, InTypeAlias = 512, + UseTypeAliasValue = 1024, } enum SymbolFormatFlags { None = 0, diff --git a/lib/typescript.js b/lib/typescript.js index 4dd7530f305..a4d02a9413a 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -480,6 +480,7 @@ var ts; TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 128] = "UseFullyQualifiedType"; TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 256] = "InFirstTypeArgument"; TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 512] = "InTypeAlias"; + TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 1024] = "UseTypeAliasValue"; })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var TypeFormatFlags = ts.TypeFormatFlags; (function (SymbolFormatFlags) { @@ -18432,8 +18433,13 @@ var ts; buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); } else if (!(flags & 512 /* InTypeAlias */) && type.flags & (2097152 /* Anonymous */ | 1572864 /* UnionOrIntersection */) && type.aliasSymbol) { - var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + if (type.flags & 2097152 /* Anonymous */ || !(flags & 1024 /* UseTypeAliasValue */)) { + var typeArguments = type.aliasTypeArguments; + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + } + else { + writeUnionOrIntersectionType(type, nextFlags); + } } else if (type.flags & 1572864 /* UnionOrIntersection */) { writeUnionOrIntersectionType(type, nextFlags); @@ -35233,7 +35239,7 @@ var ts; } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); errorNameNode = undefined; } } @@ -35246,7 +35252,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); errorNameNode = undefined; } } @@ -35448,7 +35454,7 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); write(";"); writeLine(); write(node.isExportEquals ? "export = " : "export default "); @@ -35869,7 +35875,7 @@ var ts; } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; - resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); } function getHeritageClauseVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index 50a2abcd887..d022520a285 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -1328,6 +1328,7 @@ declare namespace ts { UseFullyQualifiedType = 128, InFirstTypeArgument = 256, InTypeAlias = 512, + UseTypeAliasValue = 1024, } enum SymbolFormatFlags { None = 0, diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 4dd7530f305..a4d02a9413a 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -480,6 +480,7 @@ var ts; TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 128] = "UseFullyQualifiedType"; TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 256] = "InFirstTypeArgument"; TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 512] = "InTypeAlias"; + TypeFormatFlags[TypeFormatFlags["UseTypeAliasValue"] = 1024] = "UseTypeAliasValue"; })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var TypeFormatFlags = ts.TypeFormatFlags; (function (SymbolFormatFlags) { @@ -18432,8 +18433,13 @@ var ts; buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); } else if (!(flags & 512 /* InTypeAlias */) && type.flags & (2097152 /* Anonymous */ | 1572864 /* UnionOrIntersection */) && type.aliasSymbol) { - var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + if (type.flags & 2097152 /* Anonymous */ || !(flags & 1024 /* UseTypeAliasValue */)) { + var typeArguments = type.aliasTypeArguments; + writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags); + } + else { + writeUnionOrIntersectionType(type, nextFlags); + } } else if (type.flags & 1572864 /* UnionOrIntersection */) { writeUnionOrIntersectionType(type, nextFlags); @@ -35233,7 +35239,7 @@ var ts; } else { errorNameNode = declaration.name; - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); errorNameNode = undefined; } } @@ -35246,7 +35252,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); errorNameNode = undefined; } } @@ -35448,7 +35454,7 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); write(";"); writeLine(); write(node.isExportEquals ? "export = " : "export default "); @@ -35869,7 +35875,7 @@ var ts; } else { writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError; - resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + resolver.writeBaseConstructorTypeOfClass(enclosingDeclaration, enclosingDeclaration, 2 /* UseTypeOfFunction */ | 1024 /* UseTypeAliasValue */, writer); } function getHeritageClauseVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; From 48e51b5361e753994692be4a8a36baab4eb3620c Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 14 Sep 2016 15:42:53 -0700 Subject: [PATCH 42/44] Add tests and baselines --- .../declarationEmitInferedTypeAlias2.js | 31 +++++++++++++++ .../declarationEmitInferedTypeAlias2.symbols | 19 ++++++++++ .../declarationEmitInferedTypeAlias2.types | 23 +++++++++++ .../declarationEmitInferedTypeAlias3.js | 38 +++++++++++++++++++ .../declarationEmitInferedTypeAlias3.symbols | 26 +++++++++++++ .../declarationEmitInferedTypeAlias3.types | 30 +++++++++++++++ .../declarationEmitInferedTypeAlias2.ts | 13 +++++++ .../declarationEmitInferedTypeAlias3.ts | 16 ++++++++ 8 files changed, 196 insertions(+) create mode 100644 tests/baselines/reference/declarationEmitInferedTypeAlias2.js create mode 100644 tests/baselines/reference/declarationEmitInferedTypeAlias2.symbols create mode 100644 tests/baselines/reference/declarationEmitInferedTypeAlias2.types create mode 100644 tests/baselines/reference/declarationEmitInferedTypeAlias3.js create mode 100644 tests/baselines/reference/declarationEmitInferedTypeAlias3.symbols create mode 100644 tests/baselines/reference/declarationEmitInferedTypeAlias3.types create mode 100644 tests/cases/compiler/declarationEmitInferedTypeAlias2.ts create mode 100644 tests/cases/compiler/declarationEmitInferedTypeAlias3.ts diff --git a/tests/baselines/reference/declarationEmitInferedTypeAlias2.js b/tests/baselines/reference/declarationEmitInferedTypeAlias2.js new file mode 100644 index 00000000000..b0bca95dbe9 --- /dev/null +++ b/tests/baselines/reference/declarationEmitInferedTypeAlias2.js @@ -0,0 +1,31 @@ +//// [tests/cases/compiler/declarationEmitInferedTypeAlias2.ts] //// + +//// [0.ts] + +{ + type Data = string | boolean; + let obj: Data = true; +} +export { } + +//// [1.ts] +var x = "hi" || 5; +export default x; + +//// [0.js] +"use strict"; +{ + var obj = true; +} +//// [1.js] +"use strict"; +var x = "hi" || 5; +exports.__esModule = true; +exports["default"] = x; + + +//// [0.d.ts] +export { }; +//// [1.d.ts] +declare var x: string | number; +export default x; diff --git a/tests/baselines/reference/declarationEmitInferedTypeAlias2.symbols b/tests/baselines/reference/declarationEmitInferedTypeAlias2.symbols new file mode 100644 index 00000000000..8a9f7b35d18 --- /dev/null +++ b/tests/baselines/reference/declarationEmitInferedTypeAlias2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/0.ts === + +{ + type Data = string | boolean; +>Data : Symbol(Data, Decl(0.ts, 1, 1)) + + let obj: Data = true; +>obj : Symbol(obj, Decl(0.ts, 3, 7)) +>Data : Symbol(Data, Decl(0.ts, 1, 1)) +} +export { } + +=== tests/cases/compiler/1.ts === +var x = "hi" || 5; +>x : Symbol(x, Decl(1.ts, 0, 3)) + +export default x; +>x : Symbol(x, Decl(1.ts, 0, 3)) + diff --git a/tests/baselines/reference/declarationEmitInferedTypeAlias2.types b/tests/baselines/reference/declarationEmitInferedTypeAlias2.types new file mode 100644 index 00000000000..52c8f7fea2f --- /dev/null +++ b/tests/baselines/reference/declarationEmitInferedTypeAlias2.types @@ -0,0 +1,23 @@ +=== tests/cases/compiler/0.ts === + +{ + type Data = string | boolean; +>Data : Data + + let obj: Data = true; +>obj : Data +>Data : Data +>true : true +} +export { } + +=== tests/cases/compiler/1.ts === +var x = "hi" || 5; +>x : string | number +>"hi" || 5 : string | number +>"hi" : string +>5 : number + +export default x; +>x : string | number + diff --git a/tests/baselines/reference/declarationEmitInferedTypeAlias3.js b/tests/baselines/reference/declarationEmitInferedTypeAlias3.js new file mode 100644 index 00000000000..bca6a9a3028 --- /dev/null +++ b/tests/baselines/reference/declarationEmitInferedTypeAlias3.js @@ -0,0 +1,38 @@ +//// [tests/cases/compiler/declarationEmitInferedTypeAlias3.ts] //// + +//// [0.ts] + +{ + type Data = string | boolean; + let obj: Data = true; +} +export { } + +//// [1.ts] +let v = "str" || true; +function bar () { + return v; +} +export { v, bar } + +//// [0.js] +"use strict"; +{ + var obj = true; +} +//// [1.js] +"use strict"; +var v = "str" || true; +exports.v = v; +function bar() { + return v; +} +exports.bar = bar; + + +//// [0.d.ts] +export { }; +//// [1.d.ts] +declare let v: string | boolean; +declare function bar(): string | boolean; +export { v, bar }; diff --git a/tests/baselines/reference/declarationEmitInferedTypeAlias3.symbols b/tests/baselines/reference/declarationEmitInferedTypeAlias3.symbols new file mode 100644 index 00000000000..c8027397869 --- /dev/null +++ b/tests/baselines/reference/declarationEmitInferedTypeAlias3.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/0.ts === + +{ + type Data = string | boolean; +>Data : Symbol(Data, Decl(0.ts, 1, 1)) + + let obj: Data = true; +>obj : Symbol(obj, Decl(0.ts, 3, 7)) +>Data : Symbol(Data, Decl(0.ts, 1, 1)) +} +export { } + +=== tests/cases/compiler/1.ts === +let v = "str" || true; +>v : Symbol(v, Decl(1.ts, 0, 3)) + +function bar () { +>bar : Symbol(bar, Decl(1.ts, 0, 22)) + + return v; +>v : Symbol(v, Decl(1.ts, 0, 3)) +} +export { v, bar } +>v : Symbol(v, Decl(1.ts, 4, 8)) +>bar : Symbol(bar, Decl(1.ts, 4, 11)) + diff --git a/tests/baselines/reference/declarationEmitInferedTypeAlias3.types b/tests/baselines/reference/declarationEmitInferedTypeAlias3.types new file mode 100644 index 00000000000..fb2a042260d --- /dev/null +++ b/tests/baselines/reference/declarationEmitInferedTypeAlias3.types @@ -0,0 +1,30 @@ +=== tests/cases/compiler/0.ts === + +{ + type Data = string | boolean; +>Data : Data + + let obj: Data = true; +>obj : Data +>Data : Data +>true : true +} +export { } + +=== tests/cases/compiler/1.ts === +let v = "str" || true; +>v : Data +>"str" || true : Data +>"str" : string +>true : boolean + +function bar () { +>bar : () => Data + + return v; +>v : Data +} +export { v, bar } +>v : Data +>bar : () => Data + diff --git a/tests/cases/compiler/declarationEmitInferedTypeAlias2.ts b/tests/cases/compiler/declarationEmitInferedTypeAlias2.ts new file mode 100644 index 00000000000..5358aad9622 --- /dev/null +++ b/tests/cases/compiler/declarationEmitInferedTypeAlias2.ts @@ -0,0 +1,13 @@ +// @declaration: true +// @skipDefaultLibCheck: true + +// @Filename: 0.ts +{ + type Data = string | boolean; + let obj: Data = true; +} +export { } + +// @Filename: 1.ts +var x = "hi" || 5; +export default x; \ No newline at end of file diff --git a/tests/cases/compiler/declarationEmitInferedTypeAlias3.ts b/tests/cases/compiler/declarationEmitInferedTypeAlias3.ts new file mode 100644 index 00000000000..c3a5dae3f32 --- /dev/null +++ b/tests/cases/compiler/declarationEmitInferedTypeAlias3.ts @@ -0,0 +1,16 @@ +// @declaration: true +// @skipDefaultLibCheck: true + +// @Filename: 0.ts +{ + type Data = string | boolean; + let obj: Data = true; +} +export { } + +// @Filename: 1.ts +let v = "str" || true; +function bar () { + return v; +} +export { v, bar } \ No newline at end of file From d37391fcfc60da07e5fc0c4059f566f441fb4522 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Wed, 14 Sep 2016 15:52:54 -0700 Subject: [PATCH 43/44] Allow type and NS references to UMD globals from modules Fixes #10638 --- src/compiler/checker.ts | 4 +-- tests/baselines/reference/umd8.errors.txt | 25 +++++++++++++++++++ tests/baselines/reference/umd8.js | 16 +++++++++--- .../cases/conformance/externalModules/umd8.ts | 10 ++++++-- 4 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 tests/baselines/reference/umd8.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e1f230ce096..0f0680bd7aa 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -909,8 +909,8 @@ namespace ts { } } - // If we're in an external module, we can't reference symbols created from UMD export declarations - if (result && isInExternalModule) { + // If we're in an external module, we can't reference value symbols created from UMD export declarations + if (result && isInExternalModule && (meaning & SymbolFlags.Value) === SymbolFlags.Value) { const decls = result.declarations; if (decls && decls.length === 1 && decls[0].kind === SyntaxKind.NamespaceExportDeclaration) { error(errorLocation, Diagnostics.Identifier_0_must_be_imported_from_a_module, name); diff --git a/tests/baselines/reference/umd8.errors.txt b/tests/baselines/reference/umd8.errors.txt new file mode 100644 index 00000000000..9396c8c5450 --- /dev/null +++ b/tests/baselines/reference/umd8.errors.txt @@ -0,0 +1,25 @@ +tests/cases/conformance/externalModules/a.ts(7,14): error TS2686: Identifier 'Foo' must be imported from a module + + +==== tests/cases/conformance/externalModules/a.ts (1 errors) ==== + /// + import * as ff from './foo'; + + let y: Foo; // OK in type position + y.foo(); + let z: Foo.SubThing; // OK in ns position + let x: any = Foo; // Not OK in value position + ~~~ +!!! error TS2686: Identifier 'Foo' must be imported from a module + +==== tests/cases/conformance/externalModules/foo.d.ts (0 errors) ==== + + declare class Thing { + foo(): number; + } + declare namespace Thing { + interface SubThing { } + } + export = Thing; + export as namespace Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/umd8.js b/tests/baselines/reference/umd8.js index b4c6e0fa76b..e76b3902156 100644 --- a/tests/baselines/reference/umd8.js +++ b/tests/baselines/reference/umd8.js @@ -5,17 +5,25 @@ declare class Thing { foo(): number; } +declare namespace Thing { + interface SubThing { } +} export = Thing; export as namespace Foo; //// [a.ts] /// -let y: Foo; -y.foo(); +import * as ff from './foo'; +let y: Foo; // OK in type position +y.foo(); +let z: Foo.SubThing; // OK in ns position +let x: any = Foo; // Not OK in value position //// [a.js] -/// -var y; +"use strict"; +var y; // OK in type position y.foo(); +var z; // OK in ns position +var x = Foo; // Not OK in value position diff --git a/tests/cases/conformance/externalModules/umd8.ts b/tests/cases/conformance/externalModules/umd8.ts index caab734f5e0..9a8331fded3 100644 --- a/tests/cases/conformance/externalModules/umd8.ts +++ b/tests/cases/conformance/externalModules/umd8.ts @@ -5,11 +5,17 @@ declare class Thing { foo(): number; } +declare namespace Thing { + interface SubThing { } +} export = Thing; export as namespace Foo; // @filename: a.ts /// -let y: Foo; -y.foo(); +import * as ff from './foo'; +let y: Foo; // OK in type position +y.foo(); +let z: Foo.SubThing; // OK in ns position +let x: any = Foo; // Not OK in value position From 5f1336be9e2c7617a87ae27bd16c6ab47a702c62 Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Wed, 14 Sep 2016 16:38:11 -0700 Subject: [PATCH 44/44] Update LKG --- lib/tsc.js | 2 +- lib/tsserver.js | 2 +- lib/tsserverlibrary.js | 2 +- lib/typescript.js | 4 ++-- lib/typescriptServices.js | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index 4c3cda93213..1dba6cec817 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -13848,7 +13848,7 @@ var ts; checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } - if (result && isInExternalModule) { + if (result && isInExternalModule && (meaning & 107455) === 107455) { var decls = result.declarations; if (decls && decls.length === 1 && decls[0].kind === 228) { error(errorLocation, ts.Diagnostics.Identifier_0_must_be_imported_from_a_module, name); diff --git a/lib/tsserver.js b/lib/tsserver.js index ec61c9c87a0..a86fd0178f0 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -14844,7 +14844,7 @@ var ts; checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } - if (result && isInExternalModule) { + if (result && isInExternalModule && (meaning & 107455) === 107455) { var decls = result.declarations; if (decls && decls.length === 1 && decls[0].kind === 228) { error(errorLocation, ts.Diagnostics.Identifier_0_must_be_imported_from_a_module, name); diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index ec39a42fecf..a494af9cc33 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -14844,7 +14844,7 @@ var ts; checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } - if (result && isInExternalModule) { + if (result && isInExternalModule && (meaning & 107455) === 107455) { var decls = result.declarations; if (decls && decls.length === 1 && decls[0].kind === 228) { error(errorLocation, ts.Diagnostics.Identifier_0_must_be_imported_from_a_module, name); diff --git a/lib/typescript.js b/lib/typescript.js index a4d02a9413a..f4d1a6ceff6 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -17337,8 +17337,8 @@ var ts; checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } - // If we're in an external module, we can't reference symbols created from UMD export declarations - if (result && isInExternalModule) { + // If we're in an external module, we can't reference value symbols created from UMD export declarations + if (result && isInExternalModule && (meaning & 107455 /* Value */) === 107455 /* Value */) { var decls = result.declarations; if (decls && decls.length === 1 && decls[0].kind === 228 /* NamespaceExportDeclaration */) { error(errorLocation, ts.Diagnostics.Identifier_0_must_be_imported_from_a_module, name); diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index a4d02a9413a..f4d1a6ceff6 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -17337,8 +17337,8 @@ var ts; checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } - // If we're in an external module, we can't reference symbols created from UMD export declarations - if (result && isInExternalModule) { + // If we're in an external module, we can't reference value symbols created from UMD export declarations + if (result && isInExternalModule && (meaning & 107455 /* Value */) === 107455 /* Value */) { var decls = result.declarations; if (decls && decls.length === 1 && decls[0].kind === 228 /* NamespaceExportDeclaration */) { error(errorLocation, ts.Diagnostics.Identifier_0_must_be_imported_from_a_module, name);