Skip to content

Commit

Permalink
fix: update types definitions to fix mistakes (jashkenas#15)
Browse files Browse the repository at this point in the history
* fix: add missing `Base#locationData` property

* fix: `Literal#value` is a string, not another node

* fix: add missing `Block#expressions` property

* fix: `Parens#body` is a block
  • Loading branch information
eventualbuddha committed Dec 20, 2016
1 parent b54f759 commit 2beb50e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/coffee-script/nodes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export class CodeFragment {
* scope, and indentation level.
*/
export class Base {
locationData: LocationData;

compile(o: CompileContext, lvl: number): string;

/**
Expand Down Expand Up @@ -151,6 +153,7 @@ export class Base {
* `if`, `switch`, or `try`, and so on...
*/
export class Block extends Base {
expressions: Array<Base>;
classBody?: boolean;

children: ['expressions']
Expand Down Expand Up @@ -211,9 +214,9 @@ export class Block extends Base {
}

export class Literal extends Base {
value: Base;
value: string;

constructor(value: Base);
constructor(value: string);
}

export class Undefined extends Base {}
Expand Down Expand Up @@ -614,9 +617,9 @@ export class Existence extends Base {
* Parentheses are a good way to force any statement to become an expression.
*/
export class Parens extends Base {
body: Base;
body: Block;

constructor(body: Base);
constructor(body: Block);
}

type ForOptions = {
Expand Down

0 comments on commit 2beb50e

Please sign in to comment.