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