Skip to content

Commit

Permalink
fix(parser): moved func flags to 'common.ts'
Browse files Browse the repository at this point in the history
  • Loading branch information
KFlash committed Jun 18, 2019
1 parent b72ffe2 commit 21e771d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
12 changes: 12 additions & 0 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ export const enum Flags {
Yield = 1 << 8,
}

export const enum HoistedClassFlags {
None,
Hoisted = 1 << 0,
Export = 1 << 1
}

export const enum HoistedFunctionFlags {
None,
Hoisted = 1 << 0,
Export = 1 << 1
}

export const enum FunctionStatement {
Disallow,
Allow,
Expand Down
16 changes: 3 additions & 13 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,11 @@ import {
isPropertyWithPrivateFieldKey,
isValidLabel,
validateAndDeclareLabel,
finishNode
finishNode,
HoistedClassFlags,
HoistedFunctionFlags
} from './common';

export const enum HoistedClassFlags {
None,
Hoisted = 1 << 0,
Export = 1 << 1
}

export const enum HoistedFunctionFlags {
None,
Hoisted = 1 << 0,
Export = 1 << 1
}

/**
* Create a new parser instance
*/
Expand Down
2 changes: 1 addition & 1 deletion src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export function addFunctionName(
}
}
/**
* Check if the scope has conflicting var/let declarations from different scopes.
* Check if the scope has conflicting var/let declarations from different scopes
*
* @param parser Parser object
* @param context Context masks
Expand Down

0 comments on commit 21e771d

Please sign in to comment.