diff options
author | Lars Knoll <lars.knoll@digia.com> | 2012-12-04 10:50:25 -0800 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-12-04 20:08:43 +0100 |
commit | 944af86fca2eac90cd6528d2dfbff5316fa911a9 (patch) | |
tree | a531a734ac50dc22b933d739da856d7e6b56fa7b /qmljs_engine.cpp | |
parent | 955f5f03afd9915b7f43ff07ce4b624a86c58a1a (diff) |
Throw proper type and reference errors
Change-Id: I898017f3e63ada72fc2e50abfa1880f9fd7ffe37
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'qmljs_engine.cpp')
-rw-r--r-- | qmljs_engine.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/qmljs_engine.cpp b/qmljs_engine.cpp index 4af900549d..027cc33a9d 100644 --- a/qmljs_engine.cpp +++ b/qmljs_engine.cpp @@ -348,6 +348,20 @@ Object *ExecutionEngine::newSyntaxErrorObject(ExecutionContext *ctx, DiagnosticM return object; } +Object *ExecutionEngine::newReferenceErrorObject(ExecutionContext *ctx, const QString &message) +{ + ReferenceErrorObject *object = new ReferenceErrorObject(ctx, message); + object->prototype = referenceErrorPrototype; + return object; +} + +Object *ExecutionEngine::newTypeErrorObject(ExecutionContext *ctx, const QString &message) +{ + TypeErrorObject *object = new TypeErrorObject(ctx, message); + object->prototype = typeErrorPrototype; + return object; +} + Object *ExecutionEngine::newMathObject(ExecutionContext *ctx) { MathObject *object = new MathObject(ctx); |