Skip to content

Commit

Permalink
fix(parser): swapped names on bitmasks for destruct and assign
Browse files Browse the repository at this point in the history
  • Loading branch information
KFlash committed May 22, 2019
1 parent f74ffa0 commit f3eb024
Show file tree
Hide file tree
Showing 2 changed files with 271 additions and 274 deletions.
27 changes: 12 additions & 15 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,20 @@ export const enum BindingOrigin {

export const enum AssignmentKind {
None = 0,
Assignable = 1 << 0,
NotAssignable = 1 << 1,
Await = 1 << 2,
Yield = 1 << 3,
IsAssignable = 1 << 0,
CannotAssign = 1 << 1
}

export const enum DestructuringKind {
None = 0,
Required = 1 << 3,
NotDestructible = 1 << 4,
None = 0,
MustDestruct = 1 << 3,
CannotDestruct = 1 << 4,
// Only destructible if assignable
Assignable = 1 << 5,
AssignableDestruct = 1 << 5,
// `__proto__` is a special case and only valid to parse if destructible
SeenProto = 1 << 6,
Await = 1 << 7,
Yield = 1 << 8,
SeenProto = 1 << 6,
Await = 1 << 7,
Yield = 1 << 8,
}

/**
Expand All @@ -101,12 +99,11 @@ export const enum DestructuringKind {
export const enum Flags {
None = 0,
NewLine = 1 << 0,
SeenYield = 1 << 2,
HasConstructor = 1 << 5,
Octals = 1 << 6,
SimpleParameterList = 1 << 7,
Await = 1 << 8,
Yield = 1 << 9,
Await = 1 << 8,
Yield = 1 << 9,
}

export const enum ParseFunctionFlag {
Expand All @@ -115,7 +112,7 @@ export const enum ParseFunctionFlag {
RequireIdentifier = 1 << 1,
}

export const enum LabelledFunctionStatement {
export const enum FunctionStatement {
Disallow,
Allow,
}
Expand Down

0 comments on commit f3eb024

Please sign in to comment.