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 2c5af99466
commit 11d778d881
1 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ public:
{ {
boost::shared_ptr<ScriptFrame> vframe; boost::shared_ptr<ScriptFrame> vframe;
if (!self.IsEmpty()) if (!self.IsEmpty() || self.IsString())
vframe = boost::make_shared<ScriptFrame>(self); /* passes self to the callee using a TLS variable */ vframe = boost::make_shared<ScriptFrame>(self); /* passes self to the callee using a TLS variable */
else else
vframe = boost::make_shared<ScriptFrame>(); vframe = boost::make_shared<ScriptFrame>();
@ -206,7 +206,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())