Fix: String methods cannot be invoked on an empty string

fixes #10191
This commit is contained in:
Gunnar Beutner 2015-09-22 11:24:00 +02:00
parent 1a6b41787a
commit ad6c8eaf7e
1 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@ public:
{ {
ScriptFrame vframe; ScriptFrame vframe;
if (!self.IsEmpty()) if (!self.IsEmpty() || self.IsString())
vframe.Self = self; vframe.Self = self;
return func->Invoke(arguments); return func->Invoke(arguments);
@ -231,7 +231,7 @@ public:
static inline Value GetField(const Value& context, const String& field, const DebugInfo& debugInfo = DebugInfo()) static inline Value GetField(const Value& context, const String& field, const DebugInfo& debugInfo = DebugInfo())
{ {
if (context.IsEmpty()) if (context.IsEmpty() && !context.IsString())
return Empty; return Empty;
if (!context.IsObject()) if (!context.IsObject())