Skip to content

Commit 938dd74

Browse files
committed
Merge branch 'master' into reachabilityChecks
2 parents ebfcd25 + c4a15d9 commit 938dd74

196 files changed

Lines changed: 13524 additions & 306 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22

33
node_js:
4+
- '4'
45
- '0.10'
56

6-
sudo: false
7+
sudo: false

lib/lib.core.es6.d.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3965,34 +3965,7 @@ interface ObjectConstructor {
39653965
* Copy the values of all of the enumerable own properties from one or more source objects to a
39663966
* target object. Returns the target object.
39673967
* @param target The target object to copy to.
3968-
* @param source The source object from which to copy properties.
3969-
*/
3970-
assign<T, U>(target: T, source: U): T & U;
3971-
3972-
/**
3973-
* Copy the values of all of the enumerable own properties from one or more source objects to a
3974-
* target object. Returns the target object.
3975-
* @param target The target object to copy to.
3976-
* @param source1 The first source object from which to copy properties.
3977-
* @param source2 The second source object from which to copy properties.
3978-
*/
3979-
assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
3980-
3981-
/**
3982-
* Copy the values of all of the enumerable own properties from one or more source objects to a
3983-
* target object. Returns the target object.
3984-
* @param target The target object to copy to.
3985-
* @param source1 The first source object from which to copy properties.
3986-
* @param source2 The second source object from which to copy properties.
3987-
* @param source3 The third source object from which to copy properties.
3988-
*/
3989-
assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
3990-
3991-
/**
3992-
* Copy the values of all of the enumerable own properties from one or more source objects to a
3993-
* target object. Returns the target object.
3994-
* @param target The target object to copy to.
3995-
* @param sources One or more source objects from which to copy properties
3968+
* @param sources One or more source objects to copy properties from.
39963969
*/
39973970
assign(target: any, ...sources: any[]): any;
39983971

src/compiler/checker.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,11 @@ namespace ts {
612612
// block - scope variable and namespace module. However, only when we
613613
// try to resolve name in /*1*/ which is used in variable position,
614614
// we want to check for block- scoped
615-
if (meaning & SymbolFlags.BlockScopedVariable && result.flags & SymbolFlags.BlockScopedVariable) {
616-
checkResolvedBlockScopedVariable(result, errorLocation);
615+
if (meaning & SymbolFlags.BlockScopedVariable) {
616+
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
617+
if (exportOrLocalSymbol.flags & SymbolFlags.BlockScopedVariable) {
618+
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
619+
}
617620
}
618621
}
619622
return result;
@@ -7982,6 +7985,11 @@ namespace ts {
79827985
return true;
79837986
}
79847987
// An instance property must be accessed through an instance of the enclosing class
7988+
if (type.flags & TypeFlags.ThisType) {
7989+
// get the original type -- represented as the type constraint of the 'this' type
7990+
type = getConstraintOfTypeParameter(<TypeParameter>type);
7991+
}
7992+
79857993
// TODO: why is the first part of this check here?
79867994
if (!(getTargetType(type).flags & (TypeFlags.Class | TypeFlags.Interface) && hasBaseType(<InterfaceType>type, enclosingClass))) {
79877995
error(node, Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass));
@@ -10051,7 +10059,9 @@ namespace ts {
1005110059
let rightType = checkExpression(right, contextualMapper);
1005210060
switch (operator) {
1005310061
case SyntaxKind.AsteriskToken:
10062+
case SyntaxKind.AsteriskAsteriskToken:
1005410063
case SyntaxKind.AsteriskEqualsToken:
10064+
case SyntaxKind.AsteriskAsteriskEqualsToken:
1005510065
case SyntaxKind.SlashToken:
1005610066
case SyntaxKind.SlashEqualsToken:
1005710067
case SyntaxKind.PercentToken:
@@ -10070,7 +10080,7 @@ namespace ts {
1007010080
case SyntaxKind.CaretEqualsToken:
1007110081
case SyntaxKind.AmpersandToken:
1007210082
case SyntaxKind.AmpersandEqualsToken:
10073-
// TypeScript 1.0 spec (April 2014): 4.15.1
10083+
// TypeScript 1.0 spec (April 2014): 4.19.1
1007410084
// These operators require their operands to be of type Any, the Number primitive type,
1007510085
// or an enum type. Operands of an enum type are treated
1007610086
// as having the primitive type Number. If one operand is the null or undefined value,
@@ -10099,7 +10109,7 @@ namespace ts {
1009910109
return numberType;
1010010110
case SyntaxKind.PlusToken:
1010110111
case SyntaxKind.PlusEqualsToken:
10102-
// TypeScript 1.0 spec (April 2014): 4.15.2
10112+
// TypeScript 1.0 spec (April 2014): 4.19.2
1010310113
// The binary + operator requires both operands to be of the Number primitive type or an enum type,
1010410114
// or at least one of the operands to be of type Any or the String primitive type.
1010510115

@@ -13889,6 +13899,7 @@ namespace ts {
1388913899
break;
1389013900
case SyntaxKind.ClassExpression:
1389113901
forEach((<ClassExpression>node).members, checkSourceElement);
13902+
forEachChild(node, checkFunctionAndClassExpressionBodies);
1389213903
break;
1389313904
case SyntaxKind.MethodDeclaration:
1389413905
case SyntaxKind.MethodSignature:

src/compiler/core.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,12 @@ namespace ts {
722722
* List of supported extensions in order of file resolution precedence.
723723
*/
724724
export const supportedExtensions = [".ts", ".tsx", ".d.ts"];
725+
/**
726+
* List of extensions that will be used to look for external modules.
727+
* This list is kept separate from supportedExtensions to for cases when we'll allow to include .js files in compilation,
728+
* but still would like to load only TypeScript files as modules
729+
*/
730+
export const moduleFileExtensions = supportedExtensions;
725731

726732
const extensionsToRemove = [".d.ts", ".ts", ".js", ".tsx", ".jsx"];
727733
export function removeFileExtension(path: string): string {

src/compiler/diagnosticMessages.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,5 +2506,13 @@
25062506
"A constructor cannot contain a 'super' call when its class extends 'null'": {
25072507
"category": "Error",
25082508
"code": 17005
2509+
},
2510+
"An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": {
2511+
"category": "Error",
2512+
"code": 17006
2513+
},
2514+
"A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.": {
2515+
"category": "Error",
2516+
"code": 17007
25092517
}
25102518
}

0 commit comments

Comments
 (0)