Property assignments in Typescript (#26368)

* Allow special property assignments in TS

But only for functions and constant variable declarations initialised with
functions.

This specifically excludes class declarations and class expressions,
which differs from Javascript. That's because Typescript supports
`static` properties, which are equivalent to property assignments to a
class.

* Improve contextual typing predicate

Don't think it's right yet, but probably closer?

* More fixes.

The code is still fantastically ugly, but everything works the way it
should.

Also update baselines, even where it is ill-advised.

* Cleanup

* Remove extra whitespace

* Some kind of fix to isAnyDeclarationName

It's not done yet.

Specifically, in TS:
Special property assignments are supposed to be declaration sites (but not all
top-level assignments), and I think I
got them to be. (But not sure).

In JS:
Special property assignments are supposed to be declaration sites (but not all
top-level assignments), and I'm pretty sure ALL top-level assignments
have been declaration sites for some time. This is incorrect, and
probably means the predicate needs to be the same for both dialects.

* Add fourslash and improve isAnyDeclarationName

Now JS behaves the same as TS.

* Cleanup from PR comments
This commit is contained in:
Nathan Shively-Sanders authored and GitHub committed 2018-08-15 15:25:25 -07:00
1 parent 08eb99d8ec
commit cc67ce1141
19 files changed
+887 -104

No files matched your search

+5
View File
@@ -2480,6 +2480,11 @@ namespace ts {
function bindSpecialPropertyAssignment(node: BinaryExpression) {
const lhs = node.left as PropertyAccessEntityNameExpression;
// Class declarations in Typescript do not allow property declarations
const parentSymbol = lookupSymbolForPropertyAccess(lhs.expression);
if (!isInJavaScriptFile(node) && !isFunctionSymbol(parentSymbol)) {
return;
}
// Fix up parent pointers since we're going to use these nodes before we bind into them
node.left.parent = node;
node.right.parent = node;
+57 -41
View File
@@ -4821,48 +4821,45 @@ namespace ts {
}
/** If we don't have an explicit JSDoc type, get the type from the initializer. */
function getInitializerTypeFromSpecialDeclarations(symbol: Symbol, resolvedSymbol: Symbol | undefined, expression: Expression, special: SpecialPropertyAssignmentKind) {
if (isBinaryExpression(expression)) {
const type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol) : getWidenedLiteralType(checkExpressionCached(expression.right));
if (type.flags & TypeFlags.Object &&
special === SpecialPropertyAssignmentKind.ModuleExports &&
symbol.escapedName === InternalSymbolName.ExportEquals) {
const exportedType = resolveStructuredTypeMembers(type as ObjectType);
const members = createSymbolTable();
copyEntries(exportedType.members, members);
if (resolvedSymbol && !resolvedSymbol.exports) {
resolvedSymbol.exports = createSymbolTable();
}
(resolvedSymbol || symbol).exports!.forEach((s, name) => {
if (members.has(name)) {
const exportedMember = exportedType.members.get(name)!;
const union = createSymbol(s.flags | exportedMember.flags, name);
union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
members.set(name, union);
}
else {
members.set(name, s);
}
});
const result = createAnonymousType(
exportedType.symbol,
members,
exportedType.callSignatures,
exportedType.constructSignatures,
exportedType.stringIndexInfo,
exportedType.numberIndexInfo);
result.objectFlags |= (getObjectFlags(type) & ObjectFlags.JSLiteral); // Propagate JSLiteral flag
return result;
function getInitializerTypeFromSpecialDeclarations(symbol: Symbol, resolvedSymbol: Symbol | undefined, expression: BinaryExpression, special: SpecialPropertyAssignmentKind) {
const type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol) : getWidenedLiteralType(checkExpressionCached(expression.right));
if (type.flags & TypeFlags.Object &&
special === SpecialPropertyAssignmentKind.ModuleExports &&
symbol.escapedName === InternalSymbolName.ExportEquals) {
const exportedType = resolveStructuredTypeMembers(type as ObjectType);
const members = createSymbolTable();
copyEntries(exportedType.members, members);
if (resolvedSymbol && !resolvedSymbol.exports) {
resolvedSymbol.exports = createSymbolTable();
}
if (isEmptyArrayLiteralType(type)) {
if (noImplicitAny) {
reportImplicitAnyError(expression, anyArrayType);
(resolvedSymbol || symbol).exports!.forEach((s, name) => {
if (members.has(name)) {
const exportedMember = exportedType.members.get(name)!;
const union = createSymbol(s.flags | exportedMember.flags, name);
union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
members.set(name, union);
}
return anyArrayType;
}
return type;
else {
members.set(name, s);
}
});
const result = createAnonymousType(
exportedType.symbol,
members,
exportedType.callSignatures,
exportedType.constructSignatures,
exportedType.stringIndexInfo,
exportedType.numberIndexInfo);
result.objectFlags |= (getObjectFlags(type) & ObjectFlags.JSLiteral); // Propagate JSLiteral flag
return result;
}
return neverType;
if (isEmptyArrayLiteralType(type)) {
if (noImplicitAny) {
reportImplicitAnyError(expression, anyArrayType);
}
return anyArrayType;
}
return type;
}
function isDeclarationInConstructor(expression: Expression) {
@@ -5085,7 +5082,9 @@ namespace ts {
if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)) {
return getTypeOfFuncClassEnumModule(symbol);
}
type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType;
type = isBinaryExpression(declaration.parent) ?
getWidenedTypeFromJSPropertyAssignments(symbol) :
tryGetTypeFromEffectiveTypeNode(declaration) || anyType;
}
else if (isPropertyAssignment(declaration)) {
type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration);
@@ -16025,7 +16024,24 @@ namespace ts {
case SpecialPropertyAssignmentKind.PrototypeProperty:
// If `binaryExpression.left` was assigned a symbol, then this is a new declaration; otherwise it is an assignment to an existing declaration.
// See `bindStaticPropertyAssignment` in `binder.ts`.
return !binaryExpression.left.symbol || binaryExpression.left.symbol.valueDeclaration && !!getJSDocTypeTag(binaryExpression.left.symbol.valueDeclaration);
if (!binaryExpression.left.symbol) {
return true;
}
else {
const decl = binaryExpression.left.symbol.valueDeclaration;
if (!decl) {
return false;
}
if (isInJavaScriptFile(decl)) {
return !!getJSDocTypeTag(decl);
}
else if (isIdentifier((binaryExpression.left as PropertyAccessExpression).expression)) {
const id = (binaryExpression.left as PropertyAccessExpression).expression as Identifier;
const parentSymbol = resolveName(id, id.escapedText, SymbolFlags.Value, undefined, id.escapedText, /*isUse*/ true);
return !isFunctionSymbol(parentSymbol);
}
return true;
}
case SpecialPropertyAssignmentKind.ThisProperty:
case SpecialPropertyAssignmentKind.ModuleExports:
return !binaryExpression.symbol || binaryExpression.symbol.valueDeclaration && !!getJSDocTypeTag(binaryExpression.symbol.valueDeclaration);
+22 -4
View File
@@ -1725,12 +1725,15 @@ namespace ts {
}
export function getDeclarationOfJSInitializer(node: Node): Node | undefined {
if (!isInJavaScriptFile(node) || !node.parent) {
if (!node.parent) {
return undefined;
}
let name: Expression | BindingName | undefined;
let decl: Node | undefined;
if (isVariableDeclaration(node.parent) && node.parent.initializer === node) {
if (!isInJavaScriptFile(node) && !isVarConst(node.parent)) {
return undefined;
}
name = node.parent.name;
decl = node.parent;
}
@@ -1892,8 +1895,12 @@ namespace ts {
/// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property
/// assignments we treat as special in the binder
export function getSpecialPropertyAssignmentKind(expr: BinaryExpression): SpecialPropertyAssignmentKind {
if (!isInJavaScriptFile(expr) ||
expr.operatorToken.kind !== SyntaxKind.EqualsToken ||
const special = getSpecialPropertyAssignmentKindWorker(expr);
return special === SpecialPropertyAssignmentKind.Property || isInJavaScriptFile(expr) ? special : SpecialPropertyAssignmentKind.None;
}
function getSpecialPropertyAssignmentKindWorker(expr: BinaryExpression): SpecialPropertyAssignmentKind {
if (expr.operatorToken.kind !== SyntaxKind.EqualsToken ||
!isPropertyAccessExpression(expr.left)) {
return SpecialPropertyAssignmentKind.None;
}
@@ -1954,6 +1961,14 @@ namespace ts {
!!getJSDocTypeTag(expr.parent);
}
export function isFunctionSymbol(symbol: Symbol | undefined) {
if (!symbol || !symbol.valueDeclaration) {
return false;
}
const decl = symbol.valueDeclaration;
return decl.kind === SyntaxKind.FunctionDeclaration || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
}
export function importFromModuleSpecifier(node: StringLiteralLike): AnyValidImportOrReExport {
return tryGetImportFromModuleSpecifier(node) || Debug.fail(Debug.showSyntaxKind(node.parent));
}
@@ -2354,7 +2369,10 @@ namespace ts {
}
else {
const binExp = name.parent.parent;
return isBinaryExpression(binExp) && getSpecialPropertyAssignmentKind(binExp) !== SpecialPropertyAssignmentKind.None && getNameOfDeclaration(binExp) === name;
return isBinaryExpression(binExp) &&
getSpecialPropertyAssignmentKind(binExp) !== SpecialPropertyAssignmentKind.None &&
(binExp.left.symbol || binExp.symbol) &&
getNameOfDeclaration(binExp) === name;
}
}
default:
@@ -24,7 +24,6 @@ tests/cases/conformance/fixSignatureCaching.ts(474,38): error TS2339: Property '
tests/cases/conformance/fixSignatureCaching.ts(481,22): error TS2339: Property 'findMatch' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(481,37): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(489,18): error TS2339: Property 'isMobileFallback' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(490,39): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'.
tests/cases/conformance/fixSignatureCaching.ts(492,37): error TS2339: Property 'FALLBACK_MOBILE' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(495,51): error TS2339: Property 'FALLBACK_PHONE' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(498,52): error TS2339: Property 'FALLBACK_TABLET' does not exist on type '{}'.
@@ -49,13 +48,8 @@ tests/cases/conformance/fixSignatureCaching.ts(872,25): error TS2339: Property '
tests/cases/conformance/fixSignatureCaching.ts(893,25): error TS2339: Property 'getVersionStr' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(915,36): error TS2339: Property 'findMatches' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(915,53): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(944,33): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'.
tests/cases/conformance/fixSignatureCaching.ts(955,42): error TS2339: Property 'mobileGrade' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(963,22): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'.
tests/cases/conformance/fixSignatureCaching.ts(964,57): error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'.
tests/cases/conformance/fixSignatureCaching.ts(967,22): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'.
tests/cases/conformance/fixSignatureCaching.ts(971,18): error TS2339: Property '_impl' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'.
tests/cases/conformance/fixSignatureCaching.ts(973,18): error TS2339: Property 'version' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'.
tests/cases/conformance/fixSignatureCaching.ts(978,16): error TS2304: Cannot find name 'module'.
tests/cases/conformance/fixSignatureCaching.ts(978,42): error TS2304: Cannot find name 'module'.
tests/cases/conformance/fixSignatureCaching.ts(979,37): error TS2304: Cannot find name 'module'.
@@ -65,7 +59,7 @@ tests/cases/conformance/fixSignatureCaching.ts(981,16): error TS2304: Cannot fin
tests/cases/conformance/fixSignatureCaching.ts(983,44): error TS2339: Property 'MobileDetect' does not exist on type 'Window'.
==== tests/cases/conformance/fixSignatureCaching.ts (65 errors) ====
==== tests/cases/conformance/fixSignatureCaching.ts (59 errors) ====
// Repro from #10697
(function (define, undefined) {
@@ -608,8 +602,6 @@ tests/cases/conformance/fixSignatureCaching.ts(983,44): error TS2339: Property '
~~~~~~~~~~~~~~~~
!!! 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;
~~~~~~~~~~~~~~~
@@ -1112,8 +1104,6 @@ tests/cases/conformance/fixSignatureCaching.ts(983,44): error TS2339: Property '
*/
isPhoneSized: function (maxPhoneWidth) {
return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth);
~~~~~~~~~~~~
!!! error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'.
},
/**
@@ -1135,26 +1125,18 @@ tests/cases/conformance/fixSignatureCaching.ts(983,44): error TS2339: Property '
// environment-dependent
if (typeof window !== 'undefined' && window.screen) {
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()
@@ -1183,4 +1165,5 @@ tests/cases/conformance/fixSignatureCaching.ts(983,44): error TS2339: Property '
// please file a bug if you get this error!
throw new Error('unknown environment');
}
})());
})());
@@ -986,7 +986,8 @@ define(function () {
// please file a bug if you get this error!
throw new Error('unknown environment');
}
})());
})());
//// [fixSignatureCaching.js]
// Repro from #10697
@@ -1317,7 +1317,9 @@ define(function () {
phoneSized = MobileDetect.isPhoneSized(maxPhoneWidth);
>phoneSized : Symbol(phoneSized, Decl(fixSignatureCaching.ts, 470, 26))
>MobileDetect.isPhoneSized : Symbol(MobileDetect.isPhoneSized, Decl(fixSignatureCaching.ts, 961, 57), Decl(fixSignatureCaching.ts, 965, 12))
>MobileDetect : Symbol(MobileDetect, Decl(fixSignatureCaching.ts, 644, 6))
>isPhoneSized : Symbol(MobileDetect.isPhoneSized, Decl(fixSignatureCaching.ts, 961, 57), Decl(fixSignatureCaching.ts, 965, 12))
>maxPhoneWidth : Symbol(maxPhoneWidth, Decl(fixSignatureCaching.ts, 466, 60))
if (phoneSized === undefined) {
@@ -2015,7 +2017,9 @@ define(function () {
>maxPhoneWidth : Symbol(maxPhoneWidth, Decl(fixSignatureCaching.ts, 942, 32))
return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth);
>MobileDetect.isPhoneSized : Symbol(MobileDetect.isPhoneSized, Decl(fixSignatureCaching.ts, 961, 57), Decl(fixSignatureCaching.ts, 965, 12))
>MobileDetect : Symbol(MobileDetect, Decl(fixSignatureCaching.ts, 644, 6))
>isPhoneSized : Symbol(MobileDetect.isPhoneSized, Decl(fixSignatureCaching.ts, 961, 57), Decl(fixSignatureCaching.ts, 965, 12))
>maxPhoneWidth : Symbol(maxPhoneWidth, Decl(fixSignatureCaching.ts, 942, 32))
},
@@ -2047,7 +2051,9 @@ define(function () {
>screen : Symbol(Window.screen, Decl(lib.dom.d.ts, --, --))
MobileDetect.isPhoneSized = function (maxPhoneWidth) {
>MobileDetect.isPhoneSized : Symbol(MobileDetect.isPhoneSized, Decl(fixSignatureCaching.ts, 961, 57), Decl(fixSignatureCaching.ts, 965, 12))
>MobileDetect : Symbol(MobileDetect, Decl(fixSignatureCaching.ts, 644, 6))
>isPhoneSized : Symbol(MobileDetect.isPhoneSized, Decl(fixSignatureCaching.ts, 961, 57), Decl(fixSignatureCaching.ts, 965, 12))
>maxPhoneWidth : Symbol(maxPhoneWidth, Decl(fixSignatureCaching.ts, 962, 46))
return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth;
@@ -2059,16 +2065,22 @@ define(function () {
};
} else {
MobileDetect.isPhoneSized = function () {};
>MobileDetect.isPhoneSized : Symbol(MobileDetect.isPhoneSized, Decl(fixSignatureCaching.ts, 961, 57), Decl(fixSignatureCaching.ts, 965, 12))
>MobileDetect : Symbol(MobileDetect, Decl(fixSignatureCaching.ts, 644, 6))
>isPhoneSized : Symbol(MobileDetect.isPhoneSized, Decl(fixSignatureCaching.ts, 961, 57), Decl(fixSignatureCaching.ts, 965, 12))
}
// should not be replaced by a completely new object - just overwrite existing methods
MobileDetect._impl = impl;
>MobileDetect._impl : Symbol(MobileDetect._impl, Decl(fixSignatureCaching.ts, 967, 5))
>MobileDetect : Symbol(MobileDetect, Decl(fixSignatureCaching.ts, 644, 6))
>_impl : Symbol(MobileDetect._impl, Decl(fixSignatureCaching.ts, 967, 5))
>impl : Symbol(impl, Decl(fixSignatureCaching.ts, 6, 7))
MobileDetect.version = '1.3.3 2016-07-31';
>MobileDetect.version : Symbol(MobileDetect.version, Decl(fixSignatureCaching.ts, 970, 30))
>MobileDetect : Symbol(MobileDetect, Decl(fixSignatureCaching.ts, 644, 6))
>version : Symbol(MobileDetect.version, Decl(fixSignatureCaching.ts, 970, 30))
return MobileDetect;
>MobileDetect : Symbol(MobileDetect, Decl(fixSignatureCaching.ts, 644, 6))
@@ -2098,3 +2110,4 @@ define(function () {
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
}
})());
@@ -11,7 +11,7 @@
define(function () {
>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|SGHLine truncated
>define : any
>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|SLine truncated
>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|SLine truncated
'use strict';
>'use strict' : "use strict"
@@ -1945,9 +1945,9 @@ define(function () {
>phoneSized = MobileDetect.isPhoneSized(maxPhoneWidth) : any
>phoneSized : any
>MobileDetect.isPhoneSized(maxPhoneWidth) : any
>MobileDetect.isPhoneSized : any
>MobileDetect : (userAgent: any, maxPhoneWidth: any) => void
>isPhoneSized : any
>MobileDetect.isPhoneSized : (maxPhoneWidth: any) => any
>MobileDetect : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
>isPhoneSized : (maxPhoneWidth: any) => any
>maxPhoneWidth : any
if (phoneSized === undefined) {
@@ -2783,7 +2783,7 @@ define(function () {
* @global
*/
function MobileDetect(userAgent, maxPhoneWidth) {
>MobileDetect : (userAgent: any, maxPhoneWidth: any) => void
>MobileDetect : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
>userAgent : any
>maxPhoneWidth : any
@@ -2815,15 +2815,15 @@ define(function () {
}
MobileDetect.prototype = {
>MobileDetect.prototype = { constructor: MobileDetect, /** * Returns the detected phone or tablet type or <tt>null</tt> if it is not a mobile device. * <br> * For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.<br> * <br> * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against * the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test * is positive, a value of <code>UnknownPhone</code>, <code>UnknownTablet</code> or * <code>UnknownMobile</code> is returned.<br> * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br> * <br> * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code> * and <code>UnknownMobile</code>, so you will get <code>UnknownMobile</code> here.<br> * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for: * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use. * <br> * 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 <tt>null</tt>. * <br> * The returned tablet (family or producer) is one of following keys:<br> * <br><tt>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</tt><br> * <br> * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against * the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test * is positive, a value of <code>UnknownPhone</code> or <code>UnknownMobile</code> is returned.<br> * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br> * <br> * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code> * and <code>UnknownMobile</code>, so you will get <code>null</code> here, while {@link MobileDetect#mobile} * will return <code>UnknownMobile</code>.<br> * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for: * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use. * <br> * 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 <tt>null</tt>. * <br> * The returned tablet (family or producer) is one of following keys:<br> * <br><tt>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, ModecomTabletLine truncated
>MobileDetect.prototype = { constructor: MobileDetect, /** * Returns the detected phone or tablet type or <tt>null</tt> if it is not a mobile device. * <br> * For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.<br> * <br> * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against * the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test * is positive, a value of <code>UnknownPhone</code>, <code>UnknownTablet</code> or * <code>UnknownMobile</code> is returned.<br> * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br> * <br> * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code> * and <code>UnknownMobile</code>, so you will get <code>UnknownMobile</code> here.<br> * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for: * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use. * <br> * 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 <tt>null</tt>. * <br> * The returned tablet (family or producer) is one of following keys:<br> * <br><tt>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</tt><br> * <br> * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against * the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test * is positive, a value of <code>UnknownPhone</code> or <code>UnknownMobile</code> is returned.<br> * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br> * <br> * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code> * and <code>UnknownMobile</code>, so you will get <code>null</code> here, while {@link MobileDetect#mobile} * will return <code>UnknownMobile</code>.<br> * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for: * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use. * <br> * 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 <tt>null</tt>. * <br> * The returned tablet (family or producer) is one of following keys:<br> * <br><tt>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, ModecomTabletLine truncated
>MobileDetect.prototype : any
>MobileDetect : (userAgent: any, maxPhoneWidth: any) => void
>MobileDetect : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
>prototype : any
>{ constructor: MobileDetect, /** * Returns the detected phone or tablet type or <tt>null</tt> if it is not a mobile device. * <br> * For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.<br> * <br> * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against * the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test * is positive, a value of <code>UnknownPhone</code>, <code>UnknownTablet</code> or * <code>UnknownMobile</code> is returned.<br> * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br> * <br> * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code> * and <code>UnknownMobile</code>, so you will get <code>UnknownMobile</code> here.<br> * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for: * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use. * <br> * 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 <tt>null</tt>. * <br> * The returned tablet (family or producer) is one of following keys:<br> * <br><tt>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</tt><br> * <br> * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against * the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test * is positive, a value of <code>UnknownPhone</code> or <code>UnknownMobile</code> is returned.<br> * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br> * <br> * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code> * and <code>UnknownMobile</code>, so you will get <code>null</code> here, while {@link MobileDetect#mobile} * will return <code>UnknownMobile</code>.<br> * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for: * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use. * <br> * 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 <tt>null</tt>. * <br> * The returned tablet (family or producer) is one of following keys:<br> * <br><tt>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, *Line truncated
>{ constructor: MobileDetect, /** * Returns the detected phone or tablet type or <tt>null</tt> if it is not a mobile device. * <br> * For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.<br> * <br> * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against * the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test * is positive, a value of <code>UnknownPhone</code>, <code>UnknownTablet</code> or * <code>UnknownMobile</code> is returned.<br> * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br> * <br> * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code> * and <code>UnknownMobile</code>, so you will get <code>UnknownMobile</code> here.<br> * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for: * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use. * <br> * 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 <tt>null</tt>. * <br> * The returned tablet (family or producer) is one of following keys:<br> * <br><tt>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</tt><br> * <br> * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against * the patterns of <a href="http://detectmobilebrowsers.com/">detectmobilebrowsers.com</a>. If this test * is positive, a value of <code>UnknownPhone</code> or <code>UnknownMobile</code> is returned.<br> * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br> * <br> * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code> * and <code>UnknownMobile</code>, so you will get <code>null</code> here, while {@link MobileDetect#mobile} * will return <code>UnknownMobile</code>.<br> * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for: * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}. * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use. * <br> * 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 <tt>null</tt>. * <br> * The returned tablet (family or producer) is one of following keys:<br> * <br><tt>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, *Line truncated
constructor: MobileDetect,
>constructor : (userAgent: any, maxPhoneWidth: any) => void
>MobileDetect : (userAgent: any, maxPhoneWidth: any) => void
>constructor : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
>MobileDetect : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
/**
* Returns the detected phone or tablet type or <tt>null</tt> if it is not a mobile device.
@@ -3366,9 +3366,9 @@ define(function () {
return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth);
>MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth) : any
>MobileDetect.isPhoneSized : any
>MobileDetect : (userAgent: any, maxPhoneWidth: any) => void
>isPhoneSized : any
>MobileDetect.isPhoneSized : (maxPhoneWidth: any) => any
>MobileDetect : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
>isPhoneSized : (maxPhoneWidth: any) => any
>maxPhoneWidth || this.maxPhoneWidth : any
>maxPhoneWidth : any
>this.maxPhoneWidth : any
@@ -3431,9 +3431,9 @@ define(function () {
MobileDetect.isPhoneSized = function (maxPhoneWidth) {
>MobileDetect.isPhoneSized = function (maxPhoneWidth) { return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth; } : (maxPhoneWidth: any) => any
>MobileDetect.isPhoneSized : any
>MobileDetect : (userAgent: any, maxPhoneWidth: any) => void
>isPhoneSized : any
>MobileDetect.isPhoneSized : (maxPhoneWidth: any) => any
>MobileDetect : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
>isPhoneSized : (maxPhoneWidth: any) => any
>function (maxPhoneWidth) { return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth; } : (maxPhoneWidth: any) => any
>maxPhoneWidth : any
@@ -3454,29 +3454,29 @@ define(function () {
} else {
MobileDetect.isPhoneSized = function () {};
>MobileDetect.isPhoneSized = function () {} : () => void
>MobileDetect.isPhoneSized : any
>MobileDetect : (userAgent: any, maxPhoneWidth: any) => void
>isPhoneSized : any
>MobileDetect.isPhoneSized : (maxPhoneWidth: any) => any
>MobileDetect : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
>isPhoneSized : (maxPhoneWidth: any) => any
>function () {} : () => void
}
// should not be replaced by a completely new object - just overwrite existing methods
MobileDetect._impl = impl;
>MobileDetect._impl = impl : {}
>MobileDetect._impl : any
>MobileDetect : (userAgent: any, maxPhoneWidth: any) => void
>_impl : any
>MobileDetect._impl : {}
>MobileDetect : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
>_impl : {}
>impl : {}
MobileDetect.version = '1.3.3 2016-07-31';
>MobileDetect.version = '1.3.3 2016-07-31' : "1.3.3 2016-07-31"
>MobileDetect.version : any
>MobileDetect : (userAgent: any, maxPhoneWidth: any) => void
>version : any
>MobileDetect.version : string
>MobileDetect : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
>version : string
>'1.3.3 2016-07-31' : "1.3.3 2016-07-31"
return MobileDetect;
>MobileDetect : (userAgent: any, maxPhoneWidth: any) => void
>MobileDetect : { (userAgent: any, maxPhoneWidth: any): void; isPhoneSized(maxPhoneWidth: any): any; _impl: {}; version: string; }
}); // end of call of define()
})((function (undefined) {
@@ -3542,3 +3542,4 @@ define(function () {
>'unknown environment' : "unknown environment"
}
})());
@@ -3,12 +3,11 @@ tests/cases/compiler/targetTypeTest1.ts(6,43): error TS2304: Cannot find name 'P
tests/cases/compiler/targetTypeTest1.ts(7,22): error TS2304: Cannot find name 'Point'.
tests/cases/compiler/targetTypeTest1.ts(14,10): error TS2300: Duplicate identifier 'Point'.
tests/cases/compiler/targetTypeTest1.ts(19,18): error TS2384: Overload signatures must all be ambient or non-ambient.
tests/cases/compiler/targetTypeTest1.ts(26,7): error TS2339: Property 'origin' does not exist on type '(x: any, y: any) => void'.
tests/cases/compiler/targetTypeTest1.ts(53,15): error TS2300: Duplicate identifier 'C'.
tests/cases/compiler/targetTypeTest1.ts(60,10): error TS2300: Duplicate identifier 'C'.
==== tests/cases/compiler/targetTypeTest1.ts (8 errors) ====
==== tests/cases/compiler/targetTypeTest1.ts (7 errors) ====
declare class Point
~~~~~
!!! error TS2300: Duplicate identifier 'Point'.
@@ -45,8 +44,6 @@ tests/cases/compiler/targetTypeTest1.ts(60,10): error TS2300: Duplicate identifi
// Point.origin declared as type Point
Point.origin = new Point(0, 0);
~~~~~~
!!! error TS2339: Property 'origin' does not exist on type '(x: any, y: any) => void'.
// Point.prototype declared as type Point
// this inferred as Point because of obj.prop assignment
@@ -55,7 +55,9 @@ var x = EF1(1,2);
// Point.origin declared as type Point
Point.origin = new Point(0, 0);
>Point.origin : Symbol(Point.origin, Decl(targetTypeTest1.ts, 22, 17))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 8, 1))
>origin : Symbol(Point.origin, Decl(targetTypeTest1.ts, 22, 17))
>Point : Symbol(Point, Decl(targetTypeTest1.ts, 8, 1))
// Point.prototype declared as type Point
@@ -26,7 +26,7 @@ declare class Point
// Because Point is a constructor function, this is inferred
// to be Point and return type is inferred to be void
function Point(x, y) {
>Point : (x: any, y: any) => void
>Point : { (x: any, y: any): void; origin: any; }
>x : any
>y : any
@@ -69,10 +69,10 @@ var x = EF1(1,2);
Point.origin = new Point(0, 0);
>Point.origin = new Point(0, 0) : any
>Point.origin : any
>Point : (x: any, y: any) => void
>Point : { (x: any, y: any): void; origin: any; }
>origin : any
>new Point(0, 0) : any
>Point : (x: any, y: any) => void
>Point : { (x: any, y: any): void; origin: any; }
>0 : 0
>0 : 0
@@ -83,7 +83,7 @@ Point.prototype.add = function(dx, dy) {
>Point.prototype.add = function(dx, dy) { return new Point(this.x + dx, this.y + dy);} : (dx: any, dy: any) => any
>Point.prototype.add : any
>Point.prototype : any
>Point : (x: any, y: any) => void
>Point : { (x: any, y: any): void; origin: any; }
>prototype : any
>add : any
>function(dx, dy) { return new Point(this.x + dx, this.y + dy);} : (dx: any, dy: any) => any
@@ -92,7 +92,7 @@ Point.prototype.add = function(dx, dy) {
return new Point(this.x + dx, this.y + dy);
>new Point(this.x + dx, this.y + dy) : any
>Point : (x: any, y: any) => void
>Point : { (x: any, y: any): void; origin: any; }
>this.x + dx : any
>this.x : any
>this : any
@@ -116,7 +116,7 @@ var f : number = 5;
Point.prototype = {
>Point.prototype = { x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: number; y: number; add: (dx: any, dy: any) => any; }
>Point.prototype : any
>Point : (x: any, y: any) => void
>Point : { (x: any, y: any): void; origin: any; }
>prototype : any
>{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: number; y: number; add: (dx: any, dy: any) => any; }
@@ -136,7 +136,7 @@ Point.prototype = {
return new Point(this.x + dx, this.y + dy);
>new Point(this.x + dx, this.y + dy) : any
>Point : (x: any, y: any) => void
>Point : { (x: any, y: any): void; origin: any; }
>this.x + dx : any
>this.x : any
>this : any
@@ -0,0 +1,95 @@
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(30,14): error TS2339: Property 'prop' does not exist on type '(n: number) => string'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(31,14): error TS2339: Property 'm' does not exist on type '(n: number) => string'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(34,22): error TS2339: Property 'prop' does not exist on type '(n: number) => string'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(34,42): error TS2339: Property 'm' does not exist on type '(n: number) => string'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(40,14): error TS2339: Property 'prop' does not exist on type 'typeof ExpandoClass'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(41,14): error TS2339: Property 'm' does not exist on type 'typeof ExpandoClass'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(44,22): error TS2339: Property 'prop' does not exist on type 'typeof ExpandoClass'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(44,42): error TS2339: Property 'm' does not exist on type 'typeof ExpandoClass'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(50,14): error TS2339: Property 'prop' does not exist on type 'typeof ExpandoExpr3'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(51,14): error TS2339: Property 'm' does not exist on type 'typeof ExpandoExpr3'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(54,22): error TS2339: Property 'prop' does not exist on type 'typeof ExpandoExpr3'.
tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts(54,42): error TS2339: Property 'm' does not exist on type 'typeof ExpandoExpr3'.
==== tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts (12 errors) ====
function ExpandoDecl(n: number) {
return n.toString();
}
ExpandoDecl.prop = 2
ExpandoDecl.m = function(n: number) {
return n + 1;
}
var n = ExpandoDecl.prop + ExpandoDecl.m(12) + ExpandoDecl(101).length
const ExpandoExpr = function (n: number) {
return n.toString();
}
ExpandoExpr.prop = 2
ExpandoExpr.m = function(n: number) {
return n + 1;
}
var n = ExpandoExpr.prop + ExpandoExpr.m(12) + ExpandoExpr(101).length
const ExpandoArrow = (n: number) => n.toString();
ExpandoArrow.prop = 2
ExpandoArrow.m = function(n: number) {
return n + 1;
}
// Should not work in Typescript -- must be const
var ExpandoExpr2 = function (n: number) {
return n.toString();
}
ExpandoExpr2.prop = 2
~~~~
!!! error TS2339: Property 'prop' does not exist on type '(n: number) => string'.
ExpandoExpr2.m = function(n: number) {
~
!!! error TS2339: Property 'm' does not exist on type '(n: number) => string'.
return n + 1;
}
var n = ExpandoExpr2.prop + ExpandoExpr2.m(12) + ExpandoExpr2(101).length
~~~~
!!! error TS2339: Property 'prop' does not exist on type '(n: number) => string'.
~
!!! error TS2339: Property 'm' does not exist on type '(n: number) => string'.
// Should not work in typescript -- classes already have statics
class ExpandoClass {
n = 1001;
}
ExpandoClass.prop = 2
~~~~
!!! error TS2339: Property 'prop' does not exist on type 'typeof ExpandoClass'.
ExpandoClass.m = function(n: number) {
~
!!! error TS2339: Property 'm' does not exist on type 'typeof ExpandoClass'.
return n + 1;
}
var n = ExpandoClass.prop + ExpandoClass.m(12) + new ExpandoClass().n
~~~~
!!! error TS2339: Property 'prop' does not exist on type 'typeof ExpandoClass'.
~
!!! error TS2339: Property 'm' does not exist on type 'typeof ExpandoClass'.
// Class expressions shouldn't work in typescript either
var ExpandoExpr3 = class {
n = 10001;
}
ExpandoExpr3.prop = 3
~~~~
!!! error TS2339: Property 'prop' does not exist on type 'typeof ExpandoExpr3'.
ExpandoExpr3.m = function(n: number) {
~
!!! error TS2339: Property 'm' does not exist on type 'typeof ExpandoExpr3'.
return n + 1;
}
var n = ExpandoExpr3.prop + ExpandoExpr3.m(13) + new ExpandoExpr3().n
~~~~
!!! error TS2339: Property 'prop' does not exist on type 'typeof ExpandoExpr3'.
~
!!! error TS2339: Property 'm' does not exist on type 'typeof ExpandoExpr3'.
@@ -0,0 +1,113 @@
//// [typeFromPropertyAssignment29.ts]
function ExpandoDecl(n: number) {
return n.toString();
}
ExpandoDecl.prop = 2
ExpandoDecl.m = function(n: number) {
return n + 1;
}
var n = ExpandoDecl.prop + ExpandoDecl.m(12) + ExpandoDecl(101).length
const ExpandoExpr = function (n: number) {
return n.toString();
}
ExpandoExpr.prop = 2
ExpandoExpr.m = function(n: number) {
return n + 1;
}
var n = ExpandoExpr.prop + ExpandoExpr.m(12) + ExpandoExpr(101).length
const ExpandoArrow = (n: number) => n.toString();
ExpandoArrow.prop = 2
ExpandoArrow.m = function(n: number) {
return n + 1;
}
// Should not work in Typescript -- must be const
var ExpandoExpr2 = function (n: number) {
return n.toString();
}
ExpandoExpr2.prop = 2
ExpandoExpr2.m = function(n: number) {
return n + 1;
}
var n = ExpandoExpr2.prop + ExpandoExpr2.m(12) + ExpandoExpr2(101).length
// Should not work in typescript -- classes already have statics
class ExpandoClass {
n = 1001;
}
ExpandoClass.prop = 2
ExpandoClass.m = function(n: number) {
return n + 1;
}
var n = ExpandoClass.prop + ExpandoClass.m(12) + new ExpandoClass().n
// Class expressions shouldn't work in typescript either
var ExpandoExpr3 = class {
n = 10001;
}
ExpandoExpr3.prop = 3
ExpandoExpr3.m = function(n: number) {
return n + 1;
}
var n = ExpandoExpr3.prop + ExpandoExpr3.m(13) + new ExpandoExpr3().n
//// [typeFromPropertyAssignment29.js]
function ExpandoDecl(n) {
return n.toString();
}
ExpandoDecl.prop = 2;
ExpandoDecl.m = function (n) {
return n + 1;
};
var n = ExpandoDecl.prop + ExpandoDecl.m(12) + ExpandoDecl(101).length;
var ExpandoExpr = function (n) {
return n.toString();
};
ExpandoExpr.prop = 2;
ExpandoExpr.m = function (n) {
return n + 1;
};
var n = ExpandoExpr.prop + ExpandoExpr.m(12) + ExpandoExpr(101).length;
var ExpandoArrow = function (n) { return n.toString(); };
ExpandoArrow.prop = 2;
ExpandoArrow.m = function (n) {
return n + 1;
};
// Should not work in Typescript -- must be const
var ExpandoExpr2 = function (n) {
return n.toString();
};
ExpandoExpr2.prop = 2;
ExpandoExpr2.m = function (n) {
return n + 1;
};
var n = ExpandoExpr2.prop + ExpandoExpr2.m(12) + ExpandoExpr2(101).length;
// Should not work in typescript -- classes already have statics
var ExpandoClass = /** @class */ (function () {
function ExpandoClass() {
this.n = 1001;
}
return ExpandoClass;
}());
ExpandoClass.prop = 2;
ExpandoClass.m = function (n) {
return n + 1;
};
var n = ExpandoClass.prop + ExpandoClass.m(12) + new ExpandoClass().n;
// Class expressions shouldn't work in typescript either
var ExpandoExpr3 = /** @class */ (function () {
function class_1() {
this.n = 10001;
}
return class_1;
}());
ExpandoExpr3.prop = 3;
ExpandoExpr3.m = function (n) {
return n + 1;
};
var n = ExpandoExpr3.prop + ExpandoExpr3.m(13) + new ExpandoExpr3().n;
@@ -0,0 +1,173 @@
=== tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts ===
function ExpandoDecl(n: number) {
>ExpandoDecl : Symbol(ExpandoDecl, Decl(typeFromPropertyAssignment29.ts, 0, 0), Decl(typeFromPropertyAssignment29.ts, 3, 20))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 0, 21))
return n.toString();
>n.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 0, 21))
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
}
ExpandoDecl.prop = 2
>ExpandoDecl.prop : Symbol(ExpandoDecl.prop, Decl(typeFromPropertyAssignment29.ts, 2, 1))
>ExpandoDecl : Symbol(ExpandoDecl, Decl(typeFromPropertyAssignment29.ts, 0, 0), Decl(typeFromPropertyAssignment29.ts, 3, 20))
>prop : Symbol(ExpandoDecl.prop, Decl(typeFromPropertyAssignment29.ts, 2, 1))
ExpandoDecl.m = function(n: number) {
>ExpandoDecl.m : Symbol(ExpandoDecl.m, Decl(typeFromPropertyAssignment29.ts, 3, 20))
>ExpandoDecl : Symbol(ExpandoDecl, Decl(typeFromPropertyAssignment29.ts, 0, 0), Decl(typeFromPropertyAssignment29.ts, 3, 20))
>m : Symbol(ExpandoDecl.m, Decl(typeFromPropertyAssignment29.ts, 3, 20))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 4, 25))
return n + 1;
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 4, 25))
}
var n = ExpandoDecl.prop + ExpandoDecl.m(12) + ExpandoDecl(101).length
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 7, 3), Decl(typeFromPropertyAssignment29.ts, 16, 3), Decl(typeFromPropertyAssignment29.ts, 33, 3), Decl(typeFromPropertyAssignment29.ts, 43, 3), Decl(typeFromPropertyAssignment29.ts, 53, 3))
>ExpandoDecl.prop : Symbol(ExpandoDecl.prop, Decl(typeFromPropertyAssignment29.ts, 2, 1))
>ExpandoDecl : Symbol(ExpandoDecl, Decl(typeFromPropertyAssignment29.ts, 0, 0), Decl(typeFromPropertyAssignment29.ts, 3, 20))
>prop : Symbol(ExpandoDecl.prop, Decl(typeFromPropertyAssignment29.ts, 2, 1))
>ExpandoDecl.m : Symbol(ExpandoDecl.m, Decl(typeFromPropertyAssignment29.ts, 3, 20))
>ExpandoDecl : Symbol(ExpandoDecl, Decl(typeFromPropertyAssignment29.ts, 0, 0), Decl(typeFromPropertyAssignment29.ts, 3, 20))
>m : Symbol(ExpandoDecl.m, Decl(typeFromPropertyAssignment29.ts, 3, 20))
>ExpandoDecl(101).length : Symbol(String.length, Decl(lib.es5.d.ts, --, --))
>ExpandoDecl : Symbol(ExpandoDecl, Decl(typeFromPropertyAssignment29.ts, 0, 0), Decl(typeFromPropertyAssignment29.ts, 3, 20))
>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --))
const ExpandoExpr = function (n: number) {
>ExpandoExpr : Symbol(ExpandoExpr, Decl(typeFromPropertyAssignment29.ts, 9, 5), Decl(typeFromPropertyAssignment29.ts, 12, 20))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 9, 30))
return n.toString();
>n.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 9, 30))
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
}
ExpandoExpr.prop = 2
>ExpandoExpr.prop : Symbol(ExpandoExpr.prop, Decl(typeFromPropertyAssignment29.ts, 11, 1))
>ExpandoExpr : Symbol(ExpandoExpr, Decl(typeFromPropertyAssignment29.ts, 9, 5), Decl(typeFromPropertyAssignment29.ts, 12, 20))
>prop : Symbol(ExpandoExpr.prop, Decl(typeFromPropertyAssignment29.ts, 11, 1))
ExpandoExpr.m = function(n: number) {
>ExpandoExpr.m : Symbol(ExpandoExpr.m, Decl(typeFromPropertyAssignment29.ts, 12, 20))
>ExpandoExpr : Symbol(ExpandoExpr, Decl(typeFromPropertyAssignment29.ts, 9, 5), Decl(typeFromPropertyAssignment29.ts, 12, 20))
>m : Symbol(ExpandoExpr.m, Decl(typeFromPropertyAssignment29.ts, 12, 20))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 13, 25))
return n + 1;
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 13, 25))
}
var n = ExpandoExpr.prop + ExpandoExpr.m(12) + ExpandoExpr(101).length
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 7, 3), Decl(typeFromPropertyAssignment29.ts, 16, 3), Decl(typeFromPropertyAssignment29.ts, 33, 3), Decl(typeFromPropertyAssignment29.ts, 43, 3), Decl(typeFromPropertyAssignment29.ts, 53, 3))
>ExpandoExpr.prop : Symbol(ExpandoExpr.prop, Decl(typeFromPropertyAssignment29.ts, 11, 1))
>ExpandoExpr : Symbol(ExpandoExpr, Decl(typeFromPropertyAssignment29.ts, 9, 5), Decl(typeFromPropertyAssignment29.ts, 12, 20))
>prop : Symbol(ExpandoExpr.prop, Decl(typeFromPropertyAssignment29.ts, 11, 1))
>ExpandoExpr.m : Symbol(ExpandoExpr.m, Decl(typeFromPropertyAssignment29.ts, 12, 20))
>ExpandoExpr : Symbol(ExpandoExpr, Decl(typeFromPropertyAssignment29.ts, 9, 5), Decl(typeFromPropertyAssignment29.ts, 12, 20))
>m : Symbol(ExpandoExpr.m, Decl(typeFromPropertyAssignment29.ts, 12, 20))
>ExpandoExpr(101).length : Symbol(String.length, Decl(lib.es5.d.ts, --, --))
>ExpandoExpr : Symbol(ExpandoExpr, Decl(typeFromPropertyAssignment29.ts, 9, 5), Decl(typeFromPropertyAssignment29.ts, 12, 20))
>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --))
const ExpandoArrow = (n: number) => n.toString();
>ExpandoArrow : Symbol(ExpandoArrow, Decl(typeFromPropertyAssignment29.ts, 18, 5), Decl(typeFromPropertyAssignment29.ts, 19, 21))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 18, 22))
>n.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 18, 22))
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
ExpandoArrow.prop = 2
>ExpandoArrow.prop : Symbol(ExpandoArrow.prop, Decl(typeFromPropertyAssignment29.ts, 18, 49))
>ExpandoArrow : Symbol(ExpandoArrow, Decl(typeFromPropertyAssignment29.ts, 18, 5), Decl(typeFromPropertyAssignment29.ts, 19, 21))
>prop : Symbol(ExpandoArrow.prop, Decl(typeFromPropertyAssignment29.ts, 18, 49))
ExpandoArrow.m = function(n: number) {
>ExpandoArrow.m : Symbol(ExpandoArrow.m, Decl(typeFromPropertyAssignment29.ts, 19, 21))
>ExpandoArrow : Symbol(ExpandoArrow, Decl(typeFromPropertyAssignment29.ts, 18, 5), Decl(typeFromPropertyAssignment29.ts, 19, 21))
>m : Symbol(ExpandoArrow.m, Decl(typeFromPropertyAssignment29.ts, 19, 21))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 20, 26))
return n + 1;
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 20, 26))
}
// Should not work in Typescript -- must be const
var ExpandoExpr2 = function (n: number) {
>ExpandoExpr2 : Symbol(ExpandoExpr2, Decl(typeFromPropertyAssignment29.ts, 26, 3), Decl(typeFromPropertyAssignment29.ts, 29, 21))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 26, 29))
return n.toString();
>n.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 26, 29))
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
}
ExpandoExpr2.prop = 2
>ExpandoExpr2 : Symbol(ExpandoExpr2, Decl(typeFromPropertyAssignment29.ts, 26, 3), Decl(typeFromPropertyAssignment29.ts, 29, 21))
ExpandoExpr2.m = function(n: number) {
>ExpandoExpr2 : Symbol(ExpandoExpr2, Decl(typeFromPropertyAssignment29.ts, 26, 3), Decl(typeFromPropertyAssignment29.ts, 29, 21))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 30, 26))
return n + 1;
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 30, 26))
}
var n = ExpandoExpr2.prop + ExpandoExpr2.m(12) + ExpandoExpr2(101).length
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 7, 3), Decl(typeFromPropertyAssignment29.ts, 16, 3), Decl(typeFromPropertyAssignment29.ts, 33, 3), Decl(typeFromPropertyAssignment29.ts, 43, 3), Decl(typeFromPropertyAssignment29.ts, 53, 3))
>ExpandoExpr2 : Symbol(ExpandoExpr2, Decl(typeFromPropertyAssignment29.ts, 26, 3), Decl(typeFromPropertyAssignment29.ts, 29, 21))
>ExpandoExpr2 : Symbol(ExpandoExpr2, Decl(typeFromPropertyAssignment29.ts, 26, 3), Decl(typeFromPropertyAssignment29.ts, 29, 21))
>ExpandoExpr2(101).length : Symbol(String.length, Decl(lib.es5.d.ts, --, --))
>ExpandoExpr2 : Symbol(ExpandoExpr2, Decl(typeFromPropertyAssignment29.ts, 26, 3), Decl(typeFromPropertyAssignment29.ts, 29, 21))
>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --))
// Should not work in typescript -- classes already have statics
class ExpandoClass {
>ExpandoClass : Symbol(ExpandoClass, Decl(typeFromPropertyAssignment29.ts, 33, 73))
n = 1001;
>n : Symbol(ExpandoClass.n, Decl(typeFromPropertyAssignment29.ts, 36, 20))
}
ExpandoClass.prop = 2
>ExpandoClass : Symbol(ExpandoClass, Decl(typeFromPropertyAssignment29.ts, 33, 73))
ExpandoClass.m = function(n: number) {
>ExpandoClass : Symbol(ExpandoClass, Decl(typeFromPropertyAssignment29.ts, 33, 73))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 40, 26))
return n + 1;
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 40, 26))
}
var n = ExpandoClass.prop + ExpandoClass.m(12) + new ExpandoClass().n
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 7, 3), Decl(typeFromPropertyAssignment29.ts, 16, 3), Decl(typeFromPropertyAssignment29.ts, 33, 3), Decl(typeFromPropertyAssignment29.ts, 43, 3), Decl(typeFromPropertyAssignment29.ts, 53, 3))
>ExpandoClass : Symbol(ExpandoClass, Decl(typeFromPropertyAssignment29.ts, 33, 73))
>ExpandoClass : Symbol(ExpandoClass, Decl(typeFromPropertyAssignment29.ts, 33, 73))
>new ExpandoClass().n : Symbol(ExpandoClass.n, Decl(typeFromPropertyAssignment29.ts, 36, 20))
>ExpandoClass : Symbol(ExpandoClass, Decl(typeFromPropertyAssignment29.ts, 33, 73))
>n : Symbol(ExpandoClass.n, Decl(typeFromPropertyAssignment29.ts, 36, 20))
// Class expressions shouldn't work in typescript either
var ExpandoExpr3 = class {
>ExpandoExpr3 : Symbol(ExpandoExpr3, Decl(typeFromPropertyAssignment29.ts, 46, 3))
n = 10001;
>n : Symbol(ExpandoExpr3.n, Decl(typeFromPropertyAssignment29.ts, 46, 26))
}
ExpandoExpr3.prop = 3
>ExpandoExpr3 : Symbol(ExpandoExpr3, Decl(typeFromPropertyAssignment29.ts, 46, 3))
ExpandoExpr3.m = function(n: number) {
>ExpandoExpr3 : Symbol(ExpandoExpr3, Decl(typeFromPropertyAssignment29.ts, 46, 3))
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 50, 26))
return n + 1;
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 50, 26))
}
var n = ExpandoExpr3.prop + ExpandoExpr3.m(13) + new ExpandoExpr3().n
>n : Symbol(n, Decl(typeFromPropertyAssignment29.ts, 7, 3), Decl(typeFromPropertyAssignment29.ts, 16, 3), Decl(typeFromPropertyAssignment29.ts, 33, 3), Decl(typeFromPropertyAssignment29.ts, 43, 3), Decl(typeFromPropertyAssignment29.ts, 53, 3))
>ExpandoExpr3 : Symbol(ExpandoExpr3, Decl(typeFromPropertyAssignment29.ts, 46, 3))
>ExpandoExpr3 : Symbol(ExpandoExpr3, Decl(typeFromPropertyAssignment29.ts, 46, 3))
>new ExpandoExpr3().n : Symbol(ExpandoExpr3.n, Decl(typeFromPropertyAssignment29.ts, 46, 26))
>ExpandoExpr3 : Symbol(ExpandoExpr3, Decl(typeFromPropertyAssignment29.ts, 46, 3))
>n : Symbol(ExpandoExpr3.n, Decl(typeFromPropertyAssignment29.ts, 46, 26))
@@ -0,0 +1,271 @@
=== tests/cases/conformance/salsa/typeFromPropertyAssignment29.ts ===
function ExpandoDecl(n: number) {
>ExpandoDecl : typeof ExpandoDecl
>n : number
return n.toString();
>n.toString() : string
>n.toString : (radix?: number) => string
>n : number
>toString : (radix?: number) => string
}
ExpandoDecl.prop = 2
>ExpandoDecl.prop = 2 : 2
>ExpandoDecl.prop : number
>ExpandoDecl : typeof ExpandoDecl
>prop : number
>2 : 2
ExpandoDecl.m = function(n: number) {
>ExpandoDecl.m = function(n: number) { return n + 1;} : (n: number) => number
>ExpandoDecl.m : (n: number) => number
>ExpandoDecl : typeof ExpandoDecl
>m : (n: number) => number
>function(n: number) { return n + 1;} : (n: number) => number
>n : number
return n + 1;
>n + 1 : number
>n : number
>1 : 1
}
var n = ExpandoDecl.prop + ExpandoDecl.m(12) + ExpandoDecl(101).length
>n : number
>ExpandoDecl.prop + ExpandoDecl.m(12) + ExpandoDecl(101).length : number
>ExpandoDecl.prop + ExpandoDecl.m(12) : number
>ExpandoDecl.prop : number
>ExpandoDecl : typeof ExpandoDecl
>prop : number
>ExpandoDecl.m(12) : number
>ExpandoDecl.m : (n: number) => number
>ExpandoDecl : typeof ExpandoDecl
>m : (n: number) => number
>12 : 12
>ExpandoDecl(101).length : number
>ExpandoDecl(101) : string
>ExpandoDecl : typeof ExpandoDecl
>101 : 101
>length : number
const ExpandoExpr = function (n: number) {
>ExpandoExpr : { (n: number): string; prop: number; m(n: number): number; }
>function (n: number) { return n.toString();} : { (n: number): string; prop: number; m(n: number): number; }
>n : number
return n.toString();
>n.toString() : string
>n.toString : (radix?: number) => string
>n : number
>toString : (radix?: number) => string
}
ExpandoExpr.prop = 2
>ExpandoExpr.prop = 2 : 2
>ExpandoExpr.prop : number
>ExpandoExpr : { (n: number): string; prop: number; m(n: number): number; }
>prop : number
>2 : 2
ExpandoExpr.m = function(n: number) {
>ExpandoExpr.m = function(n: number) { return n + 1;} : (n: number) => number
>ExpandoExpr.m : (n: number) => number
>ExpandoExpr : { (n: number): string; prop: number; m(n: number): number; }
>m : (n: number) => number
>function(n: number) { return n + 1;} : (n: number) => number
>n : number
return n + 1;
>n + 1 : number
>n : number
>1 : 1
}
var n = ExpandoExpr.prop + ExpandoExpr.m(12) + ExpandoExpr(101).length
>n : number
>ExpandoExpr.prop + ExpandoExpr.m(12) + ExpandoExpr(101).length : number
>ExpandoExpr.prop + ExpandoExpr.m(12) : number
>ExpandoExpr.prop : number
>ExpandoExpr : { (n: number): string; prop: number; m(n: number): number; }
>prop : number
>ExpandoExpr.m(12) : number
>ExpandoExpr.m : (n: number) => number
>ExpandoExpr : { (n: number): string; prop: number; m(n: number): number; }
>m : (n: number) => number
>12 : 12
>ExpandoExpr(101).length : number
>ExpandoExpr(101) : string
>ExpandoExpr : { (n: number): string; prop: number; m(n: number): number; }
>101 : 101
>length : number
const ExpandoArrow = (n: number) => n.toString();
>ExpandoArrow : { (n: number): string; prop: number; m(n: number): number; }
>(n: number) => n.toString() : { (n: number): string; prop: number; m(n: number): number; }
>n : number
>n.toString() : string
>n.toString : (radix?: number) => string
>n : number
>toString : (radix?: number) => string
ExpandoArrow.prop = 2
>ExpandoArrow.prop = 2 : 2
>ExpandoArrow.prop : number
>ExpandoArrow : { (n: number): string; prop: number; m(n: number): number; }
>prop : number
>2 : 2
ExpandoArrow.m = function(n: number) {
>ExpandoArrow.m = function(n: number) { return n + 1;} : (n: number) => number
>ExpandoArrow.m : (n: number) => number
>ExpandoArrow : { (n: number): string; prop: number; m(n: number): number; }
>m : (n: number) => number
>function(n: number) { return n + 1;} : (n: number) => number
>n : number
return n + 1;
>n + 1 : number
>n : number
>1 : 1
}
// Should not work in Typescript -- must be const
var ExpandoExpr2 = function (n: number) {
>ExpandoExpr2 : (n: number) => string
>function (n: number) { return n.toString();} : (n: number) => string
>n : number
return n.toString();
>n.toString() : string
>n.toString : (radix?: number) => string
>n : number
>toString : (radix?: number) => string
}
ExpandoExpr2.prop = 2
>ExpandoExpr2.prop = 2 : 2
>ExpandoExpr2.prop : any
>ExpandoExpr2 : (n: number) => string
>prop : any
>2 : 2
ExpandoExpr2.m = function(n: number) {
>ExpandoExpr2.m = function(n: number) { return n + 1;} : (n: number) => number
>ExpandoExpr2.m : any
>ExpandoExpr2 : (n: number) => string
>m : any
>function(n: number) { return n + 1;} : (n: number) => number
>n : number
return n + 1;
>n + 1 : number
>n : number
>1 : 1
}
var n = ExpandoExpr2.prop + ExpandoExpr2.m(12) + ExpandoExpr2(101).length
>n : number
>ExpandoExpr2.prop + ExpandoExpr2.m(12) + ExpandoExpr2(101).length : any
>ExpandoExpr2.prop + ExpandoExpr2.m(12) : any
>ExpandoExpr2.prop : any
>ExpandoExpr2 : (n: number) => string
>prop : any
>ExpandoExpr2.m(12) : any
>ExpandoExpr2.m : any
>ExpandoExpr2 : (n: number) => string
>m : any
>12 : 12
>ExpandoExpr2(101).length : number
>ExpandoExpr2(101) : string
>ExpandoExpr2 : (n: number) => string
>101 : 101
>length : number
// Should not work in typescript -- classes already have statics
class ExpandoClass {
>ExpandoClass : ExpandoClass
n = 1001;
>n : number
>1001 : 1001
}
ExpandoClass.prop = 2
>ExpandoClass.prop = 2 : 2
>ExpandoClass.prop : any
>ExpandoClass : typeof ExpandoClass
>prop : any
>2 : 2
ExpandoClass.m = function(n: number) {
>ExpandoClass.m = function(n: number) { return n + 1;} : (n: number) => number
>ExpandoClass.m : any
>ExpandoClass : typeof ExpandoClass
>m : any
>function(n: number) { return n + 1;} : (n: number) => number
>n : number
return n + 1;
>n + 1 : number
>n : number
>1 : 1
}
var n = ExpandoClass.prop + ExpandoClass.m(12) + new ExpandoClass().n
>n : number
>ExpandoClass.prop + ExpandoClass.m(12) + new ExpandoClass().n : any
>ExpandoClass.prop + ExpandoClass.m(12) : any
>ExpandoClass.prop : any
>ExpandoClass : typeof ExpandoClass
>prop : any
>ExpandoClass.m(12) : any
>ExpandoClass.m : any
>ExpandoClass : typeof ExpandoClass
>m : any
>12 : 12
>new ExpandoClass().n : number
>new ExpandoClass() : ExpandoClass
>ExpandoClass : typeof ExpandoClass
>n : number
// Class expressions shouldn't work in typescript either
var ExpandoExpr3 = class {
>ExpandoExpr3 : typeof ExpandoExpr3
>class { n = 10001;} : typeof ExpandoExpr3
n = 10001;
>n : number
>10001 : 10001
}
ExpandoExpr3.prop = 3
>ExpandoExpr3.prop = 3 : 3
>ExpandoExpr3.prop : any
>ExpandoExpr3 : typeof ExpandoExpr3
>prop : any
>3 : 3
ExpandoExpr3.m = function(n: number) {
>ExpandoExpr3.m = function(n: number) { return n + 1;} : (n: number) => number
>ExpandoExpr3.m : any
>ExpandoExpr3 : typeof ExpandoExpr3
>m : any
>function(n: number) { return n + 1;} : (n: number) => number
>n : number
return n + 1;
>n + 1 : number
>n : number
>1 : 1
}
var n = ExpandoExpr3.prop + ExpandoExpr3.m(13) + new ExpandoExpr3().n
>n : number
>ExpandoExpr3.prop + ExpandoExpr3.m(13) + new ExpandoExpr3().n : any
>ExpandoExpr3.prop + ExpandoExpr3.m(13) : any
>ExpandoExpr3.prop : any
>ExpandoExpr3 : typeof ExpandoExpr3
>prop : any
>ExpandoExpr3.m(13) : any
>ExpandoExpr3.m : any
>ExpandoExpr3 : typeof ExpandoExpr3
>m : any
>13 : 13
>new ExpandoExpr3().n : number
>new ExpandoExpr3() : ExpandoExpr3
>ExpandoExpr3 : typeof ExpandoExpr3
>n : number
@@ -985,4 +985,4 @@ define(function () {
// please file a bug if you get this error!
throw new Error('unknown environment');
}
})());
})());
@@ -0,0 +1,55 @@
function ExpandoDecl(n: number) {
return n.toString();
}
ExpandoDecl.prop = 2
ExpandoDecl.m = function(n: number) {
return n + 1;
}
var n = ExpandoDecl.prop + ExpandoDecl.m(12) + ExpandoDecl(101).length
const ExpandoExpr = function (n: number) {
return n.toString();
}
ExpandoExpr.prop = 2
ExpandoExpr.m = function(n: number) {
return n + 1;
}
var n = ExpandoExpr.prop + ExpandoExpr.m(12) + ExpandoExpr(101).length
const ExpandoArrow = (n: number) => n.toString();
ExpandoArrow.prop = 2
ExpandoArrow.m = function(n: number) {
return n + 1;
}
// Should not work in Typescript -- must be const
var ExpandoExpr2 = function (n: number) {
return n.toString();
}
ExpandoExpr2.prop = 2
ExpandoExpr2.m = function(n: number) {
return n + 1;
}
var n = ExpandoExpr2.prop + ExpandoExpr2.m(12) + ExpandoExpr2(101).length
// Should not work in typescript -- classes already have statics
class ExpandoClass {
n = 1001;
}
ExpandoClass.prop = 2
ExpandoClass.m = function(n: number) {
return n + 1;
}
var n = ExpandoClass.prop + ExpandoClass.m(12) + new ExpandoClass().n
// Class expressions shouldn't work in typescript either
var ExpandoExpr3 = class {
n = 10001;
}
ExpandoExpr3.prop = 3
ExpandoExpr3.m = function(n: number) {
return n + 1;
}
var n = ExpandoExpr3.prop + ExpandoExpr3.m(13) + new ExpandoExpr3().n
@@ -0,0 +1,12 @@
/// <reference path='fourslash.ts'/>
////var x = { "[|{| "isWriteAccess": true, "isDefinition": true |}someProperty|]": 0 }
////x["[|someProperty|]"] = 3;
////x.[|{| "isWriteAccess": true, "isDefinition": false |}someProperty|] = 5;
const ranges = test.ranges();
const [r0, r1, r2] = ranges;
verify.referenceGroups(r0, [{ definition: '(property) "someProperty": number', ranges }]);
verify.referenceGroups([r1, r2], [
{ definition: '(property) "someProperty": number', ranges: [r0, r1, r2] },
]);
@@ -0,0 +1,12 @@
/// <reference path='fourslash.ts'/>
////const x = function () { return 111111; }
////x.[|{| "isWriteAccess": true, "isDefinition": true |}someProperty|] = 5;
////x["[|someProperty|]"] = 3;
const ranges = test.ranges();
const [r0, r1] = ranges;
verify.referenceGroups(r0, [{ definition: '(property) x.someProperty: number', ranges }]);
verify.referenceGroups([r1], [
{ definition: '(property) x.someProperty: number', ranges: [r0, r1] },
]);
@@ -0,0 +1,16 @@
/// <reference path='fourslash.ts'/>
// @Filename: foo.js
// @noEmit: true
// @allowJs: true
// @checkJs: true
////var x = { "[|{| "isWriteAccess": true, "isDefinition": true |}someProperty|]": 0 }
////x["[|someProperty|]"] = 3;
////x.[|{| "isWriteAccess": true, "isDefinition": false |}someProperty|] = 5;
const ranges = test.ranges();
const [r0, r1, r2] = ranges;
verify.referenceGroups(r0, [{ definition: '(property) "someProperty": number', ranges }]);
verify.referenceGroups([r1, r2], [
{ definition: '(property) "someProperty": number', ranges: [r0, r1, r2] },
]);