ParseFlags.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. // Parse flags
  7. enum
  8. {
  9. fscrNil = 0,
  10. // Unused = 1 << 0,
  11. fscrReturnExpression = 1 << 1, // call should return the last expression
  12. fscrImplicitThis = 1 << 2, // 'this.' is optional (for Call)
  13. fscrImplicitParents = 1 << 3, // the parents of 'this' are implicit
  14. // Unused = 1 << 4,
  15. fscrDynamicCode = 1 << 5, // The code is being generated dynamically (eval, new Function, etc.)
  16. // Unused = 1 << 6,
  17. fscrNoImplicitHandlers = 1 << 7, // same as Opt NoConnect at start of block
  18. // Unused = 1 << 8,
  19. #if DEBUG
  20. fscrEnforceJSON = 1 << 9, // used together with fscrReturnExpression
  21. // enforces JSON semantics in the parsing.
  22. #endif
  23. fscrEval = 1 << 10, // this expression has eval semantics (i.e., run in caller's context
  24. fscrEvalCode = 1 << 11, // this is an eval expression
  25. fscrGlobalCode = 1 << 12, // this is a global script
  26. fscrDeferFncParse = 1 << 13, // parser: defer creation of AST's for non-global code
  27. fscrDeferredFncExpression = 1 << 14, // the function decl node we deferred is an expression,
  28. // i.e., not a declaration statement
  29. fscrDeferredFnc = 1 << 15, // the function we are parsing is deferred
  30. fscrNoPreJit = 1 << 16, // ignore prejit global flag
  31. fscrAllowFunctionProxy = 1 << 17, // Allow creation of function proxies instead of function bodies
  32. fscrIsLibraryCode = 1 << 18, // Current code is engine library code written in Javascript
  33. fscrNoDeferParse = 1 << 19, // Do not defer parsing
  34. fscrJsBuiltIn = 1 << 20, // Current code is a JS built in code written in JavaScript
  35. #ifdef IR_VIEWER
  36. fscrIrDumpEnable = 1 << 21, // Allow parseIR to generate an IR dump
  37. #endif /* IRVIEWER */
  38. // Throw a ReferenceError when the global 'this' is used (possibly in a lambda),
  39. // for debugger when broken in a lambda that doesn't capture 'this'
  40. fscrDebuggerErrorOnGlobalThis = 1 << 22,
  41. fscrDeferredClassMemberFnc = 1 << 23,
  42. fscrConsoleScopeEval = 1 << 24, // The eval string is console eval or debugEval, used to have top level
  43. // let/const in global scope instead of eval scope so that they can be preserved across console inputs
  44. fscrNoAsmJs = 1 << 25, // Disable generation of asm.js code
  45. fscrIsModuleCode = 1 << 26, // Current code should be parsed as a module body
  46. fscrDeferredFncIsMethod = 1 << 27,
  47. fscrAll = (1 << 28) - 1
  48. };