Skip to content

Commit

Permalink
Merge pull request #5 from Microsoft/master
Browse files Browse the repository at this point in the history
fetch lastest code
  • Loading branch information
plantain-00 committed Feb 3, 2016
2 parents 2e67984 + 6cc44d1 commit cd2638e
Show file tree
Hide file tree
Showing 710 changed files with 20,370 additions and 2,808 deletions.
20 changes: 20 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ TypeScript is authored by:

* Adam Freidin
* Ahmad Farid
* Akshar Patel
* Anders Hejlsberg
* Arnav Singh
* Arthur Ozga
* Asad Saeeduddin
* Basarat Ali Syed
* Ben Duffield
* Bill Ticehurst
Expand All @@ -15,52 +17,67 @@ TypeScript is authored by:
* Colby Russell
* Colin Snover
* Cyrus Najmabadi
* Dan Corder
* Dan Quirk
* Daniel Rosenwasser
* @dashaus
* David Li
* Denis Nedelyaev
* Dick van den Brink
* Dirk Bäumer
* Dirk Holtwick
* Eyas Sharaiha
* @falsandtru
* Frank Wallis
* Gabriel Isenberg
* Gilad Peleg
* Graeme Wicksted
* Guillaume Salles
* Guy Bedford
* Harald Niesche
* Iain Monro
* Ingvar Stepanyan
* Ivo Gabe de Wolff
* James Whitney
* Jason Freeman
* Jason Killian
* Jason Ramsay
* Jed Mao
* Jeffrey Morlan
* Johannes Rieken
* John Vilk
* Jonathan Bond-Caron
* Jonathan Park
* Jonathan Turner
* Jonathon Smith
* Josh Kalderimis
* Julian Williams
* Kagami Sascha Rosylight
* Keith Mashinter
* Ken Howard
* Kenji Imamula
* Lorant Pinter
* Lucien Greathouse
* Martin Všetička
* Masahiro Wakame
* Mattias Buelens
* Max Deepfield
* Micah Zoltu
* Mohamed Hegazy
* Nathan Shively-Sanders
* Nathan Yee
* Oleg Mihailik
* Oleksandr Chekhovskyi
* Paul van Brenk
* @pcbro
* Pedro Maltez
* Philip Bulley
* piloopin
* @progre
* Punya Biswal
* Richard Sentino
* Ron Buckton
* Rowan Wyborn
* Ryan Cavanaugh
* Ryohei Ikegami
* Sébastien Arod
Expand All @@ -71,7 +88,9 @@ TypeScript is authored by:
* Solal Pirelli
* Stan Thomas
* Steve Lucco
* Thomas Loubiou
* Tien Hoanhtien
* Tim Perry
* Tingan Ho
* togru
* Tomas Grubliauskas
Expand All @@ -81,5 +100,6 @@ TypeScript is authored by:
* Wesley Wigham
* York Yao
* Yui Tanglertsampan
* Yuichi Nukiyama
* Zev Spitz
* Zhengbo Li
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can try out the nightly build of TypeScript (`npm install typescript@next`)
We also accept suggestions in the issue tracker.
Be sure to [check the FAQ](https://github.com/Microsoft/TypeScript/wiki/FAQ) and [search](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue) first.

In general, things we find useful when reviewing suggestins are:
In general, things we find useful when reviewing suggestions are:
* A description of the problem you're trying to solve
* An overview of the suggested solution
* Examples of how the suggestion would work in various places
Expand Down Expand Up @@ -71,7 +71,7 @@ Your pull request should:
* Tests should include reasonable permutations of the target fix/change
* Include baseline changes with your change
* All changed code must have 100% code coverage
* Follow the code conventions descriped in [Coding guidelines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines)
* Follow the code conventions described in [Coding guidelines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines)
* To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your git configuration

## Contributing `lib.d.ts` fixes
Expand Down
Binary file modified doc/TypeScript Language Specification.docx
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -3885,7 +3885,7 @@ function g(x: number) {
the inferred return type for 'f' and 'g' is Any because the functions reference themselves through a cycle with no return type annotations. Adding an explicit return type 'number' to either breaks the cycle and causes the return type 'number' to be inferred for the other.
An explicitly typed function whose return type isn't the Void or the Any type must have at least one return statement somewhere in its body. An exception to this rule is if the function implementation consists of a single 'throw' statement.
An explicitly typed function whose return type isn't the Void type, the Any type, or a union type containing the Void or Any type as a constituent must have at least one return statement somewhere in its body. An exception to this rule is if the function implementation consists of a single 'throw' statement.
The type of 'this' in a function implementation is the Any type.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "http://typescriptlang.org/",
"version": "1.8.0",
"version": "1.9.0",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [
Expand Down
23 changes: 16 additions & 7 deletions src/compiler/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ namespace ts {
}

function checkStrictModeNumericLiteral(node: LiteralExpression) {
if (inStrictMode && node.flags & NodeFlags.OctalLiteral) {
if (inStrictMode && node.isOctalLiteral) {
file.bindDiagnostics.push(createDiagnosticForNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
}
}
Expand Down Expand Up @@ -1384,7 +1384,7 @@ namespace ts {
// Export assignment in some sort of block construct
bindAnonymousDeclaration(node, SymbolFlags.Alias, getDeclarationName(node));
}
else if (boundExpression.kind === SyntaxKind.Identifier) {
else if (boundExpression.kind === SyntaxKind.Identifier && node.kind === SyntaxKind.ExportAssignment) {
// An export default clause with an identifier exports all meanings of that identifier
declareSymbol(container.symbol.exports, container.symbol, node, SymbolFlags.Alias, SymbolFlags.PropertyExcludes | SymbolFlags.AliasExcludes);
}
Expand Down Expand Up @@ -1435,7 +1435,8 @@ namespace ts {
// Declare a 'member' in case it turns out the container was an ES5 class
if (container.kind === SyntaxKind.FunctionExpression || container.kind === SyntaxKind.FunctionDeclaration) {
container.symbol.members = container.symbol.members || {};
declareSymbol(container.symbol.members, container.symbol, node, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
// It's acceptable for multiple 'this' assignments of the same identifier to occur
declareSymbol(container.symbol.members, container.symbol, node, SymbolFlags.Property, SymbolFlags.PropertyExcludes & ~SymbolFlags.Property);
}
}

Expand All @@ -1444,8 +1445,16 @@ namespace ts {

// Look up the function in the local scope, since prototype assignments should
// follow the function declaration
const classId = <Identifier>(<PropertyAccessExpression>(<PropertyAccessExpression>node.left).expression).expression;
const funcSymbol = container.locals[classId.text];
const leftSideOfAssignment = node.left as PropertyAccessExpression;
const classPrototype = leftSideOfAssignment.expression as PropertyAccessExpression;
const constructorFunction = classPrototype.expression as Identifier;

// Fix up parent pointers since we're going to use these nodes before we bind into them
leftSideOfAssignment.parent = node;
constructorFunction.parent = classPrototype;
classPrototype.parent = leftSideOfAssignment;

const funcSymbol = container.locals[constructorFunction.text];
if (!funcSymbol || !(funcSymbol.flags & SymbolFlags.Function)) {
return;
}
Expand All @@ -1456,13 +1465,13 @@ namespace ts {
}

// Declare the method/property
declareSymbol(funcSymbol.members, funcSymbol, <PropertyAccessExpression>node.left, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
}

function bindCallExpression(node: CallExpression) {
// We're only inspecting call expressions to detect CommonJS modules, so we can skip
// this check if we've already seen the module indicator
if (!file.commonJsModuleIndicator && isRequireCall(node)) {
if (!file.commonJsModuleIndicator && isRequireCall(node, /*checkArgumentIsStringLiteral*/false)) {
setCommonJsModuleIndicator(node);
}
}
Expand Down
Loading

0 comments on commit cd2638e

Please sign in to comment.