ParseFlags.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. fscrUseStrictMode = 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. fscrIsModuleCode = 1 << 13, // Current code should be parsed as a module body
  29. fscrNoAsmJs = 1 << 14, // Disable generation of asm.js code
  30. fscrNoPreJit = 1 << 15, // ignore prejit global flag
  31. fscrAllowFunctionProxy = 1 << 16, // Allow creation of function proxies instead of function bodies
  32. fscrIsLibraryCode = 1 << 17, // Current code is engine library code written in Javascript
  33. fscrNoDeferParse = 1 << 18, // Do not defer parsing
  34. fscrJsBuiltIn = 1 << 19, // Current code is a JS built in code written in JavaScript
  35. #ifdef IR_VIEWER
  36. fscrIrDumpEnable = 1 << 20, // 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 << 21,
  41. fscrConsoleScopeEval = 1 << 22, // The eval string is console eval or debugEval, used to have top level
  42. // let/const in global scope instead of eval scope so that they can be preserved across console inputs
  43. fscrDeferredFnc = 1 << 23, // the function we are parsing is deferred
  44. fscrDeferredFncExpression = 1 << 24, // the function decl node we deferred is an expression,
  45. // i.e., not a declaration statement
  46. fscrDeferredFncIsAsync = 1 << 25,
  47. fscrDeferredFncIsMethod = 1 << 26,
  48. fscrDeferredFncIsGenerator = 1 << 27,
  49. fscrDeferredFncIsClassMember = 1 << 28,
  50. fscrDeferredFncIsClassConstructor = 1 << 29,
  51. fscrDeferredFncIsBaseClassConstructor = 1 << 30,
  52. fscrAll = (1 << 29) - 1
  53. };