if Script::Run() catches an exception return an empty Handle.
Don't try to set the array length to negative numbers.
Change-Id: Icefa3bc66d0359c0d3cffcf7c6650c8db34cc9aa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
} catch (VM::Exception &e) {
Isolate::GetCurrent()->setException(e.value());
e.accept(ctx);
+ return Local<Value>();
}
return Local<Value>::New(Value::fromVmValue(result));
Local<Array> Array::New(int length)
{
+ if (length < 0)
+ length = 0;
VM::ArrayObject *a = currentEngine()->newArrayObject(currentEngine()->current);
if (length < 0x1000)
a->arrayReserve(length);