RuntimeFunction.h 1.4 KB

1234567891011121314151617181920212223242526272829
  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. namespace Js
  7. {
  8. class RuntimeFunction : public JavascriptFunction
  9. {
  10. protected:
  11. DEFINE_VTABLE_CTOR(RuntimeFunction, JavascriptFunction);
  12. DEFINE_MARSHAL_OBJECT_TO_SCRIPT_CONTEXT(RuntimeFunction);
  13. RuntimeFunction(DynamicType * type);
  14. public:
  15. RuntimeFunction(DynamicType * type, FunctionInfo * functionInfo);
  16. RuntimeFunction(DynamicType * type, FunctionInfo * functionInfo, ConstructorCache* cache);
  17. void SetFunctionNameId(Var nameId);
  18. // this is for cached source string for the function. Possible values are:
  19. // NULL; initialized for anonymous methods.
  20. // propertyId in Int31 format; this is used for fastDOM function as well as library function
  21. // JavascriptString: composed using functionname from the propertyId, or fixed string for anonymous functions.
  22. Var functionNameId;
  23. virtual Var GetSourceString() const { return functionNameId; }
  24. virtual Var EnsureSourceString();
  25. };
  26. };