From ad6c8eaf7e10c02fe7b36b3ac96a57a8556dfb6e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 22 Sep 2015 11:24:00 +0200 Subject: [PATCH] Fix: String methods cannot be invoked on an empty string fixes #10191 --- lib/config/vmops.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config/vmops.hpp b/lib/config/vmops.hpp index e4cde9f26..8160dad8c 100644 --- a/lib/config/vmops.hpp +++ b/lib/config/vmops.hpp @@ -91,7 +91,7 @@ public: { ScriptFrame vframe; - if (!self.IsEmpty()) + if (!self.IsEmpty() || self.IsString()) vframe.Self = self; return func->Invoke(arguments); @@ -231,7 +231,7 @@ public: static inline Value GetField(const Value& context, const String& field, const DebugInfo& debugInfo = DebugInfo()) { - if (context.IsEmpty()) + if (context.IsEmpty() && !context.IsString()) return Empty; if (!context.IsObject())