diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-03-14 12:51:22 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-14 16:45:30 +0100 |
commit | f91dba12746bb1675bfe3a483288e712a867dd7c (patch) | |
tree | 5a1c2bbb0d7f0b0585861cc2b362074cf7466a6f /src/qml/qml/v8 | |
parent | a06936e5037c017248a9eefa9378cebfd6b2f5c1 (diff) |
Use the same ReferenceError message wording as V8
Instead of "Can't find variable: foo", use "foo is not defined".
This is in preparation of letting V8 throw the exception when a
property lookup fails on the QML scope object (needed for
QTBUG-24448).
Change-Id: I3c747482a8ef138dad9a85530a4f6b5c4c818a03
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/qml/qml/v8')
-rw-r--r-- | src/qml/qml/v8/qv8contextwrapper.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/v8/qv8contextwrapper.cpp b/src/qml/qml/v8/qv8contextwrapper.cpp index 246b716aa0..e7c26fde9e 100644 --- a/src/qml/qml/v8/qv8contextwrapper.cpp +++ b/src/qml/qml/v8/qv8contextwrapper.cpp @@ -245,7 +245,7 @@ v8::Handle<v8::Value> QV8ContextWrapper::NullGetter(v8::Local<v8::String> proper QV8Engine *engine = resource->engine; - QString error = QLatin1String("Can't find variable: ") + engine->toString(property); + QString error = engine->toString(property) + QLatin1String(" is not defined"); v8::ThrowException(v8::Exception::ReferenceError(engine->toString(error))); return v8::Undefined(); } @@ -365,7 +365,7 @@ v8::Handle<v8::Value> QV8ContextWrapper::Getter(v8::Local<v8::String> property, expressionContext->unresolvedNames = true; - QString error = QLatin1String("Can't find variable: ") + engine->toString(property); + QString error = engine->toString(property) + QLatin1String(" is not defined"); v8::ThrowException(v8::Exception::ReferenceError(engine->toString(error))); return v8::Undefined(); } |