ReturnedValue ExecutionContext::throwRangeError(const ValueRef value) { Scope scope(this); ScopedString s(scope, value->toString(this)); QString msg = s->toQString() + QStringLiteral(" out of range"); ScopedObject error(scope, engine->newRangeErrorObject(msg)); return throwError(error); }
ReturnedValue ExecutionContext::throwReferenceError(const ValueRef value) { Scope scope(this); Scoped<String> s(scope, value->toString(this)); QString msg = s->toQString() + QStringLiteral(" is not defined"); Scoped<Object> error(scope, engine->newReferenceErrorObject(msg)); return throwError(error); }