Skip to content

Commit

Permalink
fix(typings): emit spread parameters
Browse files Browse the repository at this point in the history
Closes #3875
  • Loading branch information
alexeagle committed Aug 27, 2015
1 parent 02d9e18 commit a34d4c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/typescript-package/processors/readTypeScriptModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,21 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
' at line ' + location.start.line);
}
return declaration.parameters.map(function(parameter) {
var paramText = getText(sourceFile, parameter.name);
var paramText = '';
if (parameter.dotDotDotToken) {
paramText += '...';
}
paramText += getText(sourceFile, parameter.name);
if (parameter.questionToken || parameter.initializer) {
paramText += '?';
}
if (parameter.type) {
paramText += ':' + getType(sourceFile, parameter.type);
} else {
paramText += ': any';
if (parameter.dotDotDotToken) {
paramText += '[]';
}
}
return paramText.trim();
});
Expand Down
1 change: 1 addition & 0 deletions typing_spec/router_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_BINDINGS} from 'angular2/router';
template: '<h1>Hello</h1>',
})
class FooCmp {
constructor(a: string, b: number) {}
}


Expand Down

0 comments on commit a34d4c6

Please sign in to comment.