JavascriptBoolean.inl 863 B

1234567891011121314151617181920212223
  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. // These function needs to be in INL file for static lib
  9. inline bool JavascriptBoolean::Is(Var aValue)
  10. {
  11. return JavascriptOperators::GetTypeId(aValue) == TypeIds_Boolean;
  12. }
  13. inline JavascriptBoolean* JavascriptBoolean::FromVar(Js::Var aValue)
  14. {
  15. AssertMsg(Is(aValue), "Ensure var is actually a 'JavascriptBoolean'");
  16. return static_cast<JavascriptBoolean *>(RecyclableObject::FromVar(aValue));
  17. }
  18. } // namespace Js