ParseFlags.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. fscrWillDeferFncParse = 1 << 3, // Heuristically choosing to defer parsing of functions
  14. fscrCanDeferFncParse = 1 << 4, // Functionally able to defer parsing of functions
  15. fscrDynamicCode = 1 << 5, // The code is being generated dynamically (eval, new Function, etc.)
  16. fscrDeferredFncIsGenerator = 1 << 6,
  17. fscrNoImplicitHandlers = 1 << 7, // same as Opt NoConnect at start of block
  18. fscrCreateParserState = 1 << 8, // The parser should expose parser state information on the parse nodes.
  19. // This parser state includes the set of names which are captured by each function
  20. // and is stored in ParseNodeFnc::capturedNames.
  21. #if DEBUG
  22. fscrEnforceJSON = 1 << 9, // used together with fscrReturnExpression
  23. // enforces JSON semantics in the parsing.
  24. #endif
  25. fscrEval = 1 << 10, // this expression has eval semantics (i.e., run in caller's context
  26. fscrEvalCode = 1 << 11, // this is an eval expression
  27. fscrGlobalCode = 1 << 12, // this is a global script
  28. fscrDeferredFncIsAsync = 1 << 13,
  29. fscrDeferredFncExpression = 1 << 14, // the function decl node we deferred is an expression,
  30. // i.e., not a declaration statement
  31. fscrDeferredFnc = 1 << 15, // the function we are parsing is deferred
  32. fscrNoPreJit = 1 << 16, // ignore prejit global flag
  33. fscrAllowFunctionProxy = 1 << 17, // Allow creation of function proxies instead of function bodies
  34. fscrIsLibraryCode = 1 << 18, // Current code is engine library code written in Javascript
  35. fscrNoDeferParse = 1 << 19, // Do not defer parsing
  36. fscrJsBuiltIn = 1 << 20, // Current code is a JS built in code written in JavaScript
  37. #ifdef IR_VIEWER
  38. fscrIrDumpEnable = 1 << 21, // Allow parseIR to generate an IR dump
  39. #endif /* IRVIEWER */
  40. // Throw a ReferenceError when the global 'this' is used (possibly in a lambda),
  41. // for debugger when broken in a lambda that doesn't capture 'this'
  42. fscrDebuggerErrorOnGlobalThis = 1 << 22,
  43. fscrDeferredClassMemberFnc = 1 << 23,
  44. fscrConsoleScopeEval = 1 << 24, // The eval string is console eval or debugEval, used to have top level
  45. // let/const in global scope instead of eval scope so that they can be preserved across console inputs
  46. fscrNoAsmJs = 1 << 25, // Disable generation of asm.js code
  47. fscrIsModuleCode = 1 << 26, // Current code should be parsed as a module body
  48. fscrDeferredFncIsMethod = 1 << 27,
  49. fscrAll = (1 << 28) - 1
  50. };