Implement the __ptr function

fixes #12205
This commit is contained in:
Gunnar Beutner 2016-07-22 09:43:59 +02:00
parent 171c137451
commit caf2812f0d
2 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,7 @@ REGISTER_SAFE_SCRIPTFUNCTION(escape_shell_arg, &Utility::EscapeShellArg);
#ifdef _WIN32
REGISTER_SAFE_SCRIPTFUNCTION(escape_create_process_arg, &Utility::EscapeCreateProcessArg);
#endif /* _WIN32 */
REGISTER_SCRIPTFUNCTION(__ptr, &ScriptUtils::Ptr);
String ScriptUtils::CastString(const Value& value)
{
@ -317,3 +318,7 @@ Array::Ptr ScriptUtils::TrackParents(const Object::Ptr& child)
return Array::FromVector(DependencyGraph::GetParents(child));
}
double ScriptUtils::Ptr(const Object::Ptr& object)
{
return reinterpret_cast<intptr_t>(object.get());
}

View File

@ -52,6 +52,7 @@ public:
static void Assert(const Value& arg);
static String MsiGetComponentPathShim(const String& component);
static Array::Ptr TrackParents(const Object::Ptr& parent);
static double Ptr(const Object::Ptr& object);
private:
ScriptUtils(void);