diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-15 07:45:49 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-15 07:45:49 (GMT) |
commit | 8183bee8498c5363ec220bf3723ed59ca3da9d72 (patch) | |
tree | 37d451ed1bb6503610da60c7be6052c65e0dd026 /src/3rdparty | |
parent | b2f0ae333dd2c7217bc56c69a6e8e4defb817946 (diff) | |
download | Qt-8183bee8498c5363ec220bf3723ed59ca3da9d72.zip Qt-8183bee8498c5363ec220bf3723ed59ca3da9d72.tar.gz Qt-8183bee8498c5363ec220bf3723ed59ca3da9d72.tar.bz2 |
Error line number property is called "lineNumber" in QtScript
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp | 6 | ||||
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/Error.cpp | 2 | ||||
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/Error.h | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp index b6ac41a..ac4ad91 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp @@ -518,7 +518,7 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV exception = createNotAnObjectError(callFrame, static_cast<JSNotAnObjectErrorStub*>(exception), bytecodeOffset, codeBlock); exceptionValue = exception; } else { - if (!exception->hasProperty(callFrame, Identifier(callFrame, "line")) && + if (!exception->hasProperty(callFrame, Identifier(callFrame, JSC_ERROR_LINENUMBER_PROPERTYNAME)) && !exception->hasProperty(callFrame, Identifier(callFrame, "sourceId")) && !exception->hasProperty(callFrame, Identifier(callFrame, "sourceURL")) && !exception->hasProperty(callFrame, Identifier(callFrame, expressionBeginOffsetPropertyName)) && @@ -529,14 +529,14 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV int endOffset = 0; int divotPoint = 0; int line = codeBlock->expressionRangeForBytecodeOffset(callFrame, bytecodeOffset, divotPoint, startOffset, endOffset); - exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, line), ReadOnly | DontDelete); + exception->putWithAttributes(callFrame, Identifier(callFrame, JSC_ERROR_LINENUMBER_PROPERTYNAME), jsNumber(callFrame, line), ReadOnly | DontDelete); // We only hit this path for error messages and throw statements, which don't have a specific failure position // So we just give the full range of the error/throw statement. exception->putWithAttributes(callFrame, Identifier(callFrame, expressionBeginOffsetPropertyName), jsNumber(callFrame, divotPoint - startOffset), ReadOnly | DontDelete); exception->putWithAttributes(callFrame, Identifier(callFrame, expressionEndOffsetPropertyName), jsNumber(callFrame, divotPoint + endOffset), ReadOnly | DontDelete); } else - exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, codeBlock->lineNumberForBytecodeOffset(callFrame, bytecodeOffset)), ReadOnly | DontDelete); + exception->putWithAttributes(callFrame, Identifier(callFrame, JSC_ERROR_LINENUMBER_PROPERTYNAME), jsNumber(callFrame, codeBlock->lineNumberForBytecodeOffset(callFrame, bytecodeOffset)), ReadOnly | DontDelete); exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceId"), jsNumber(callFrame, codeBlock->ownerNode()->sourceID()), ReadOnly | DontDelete); exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceURL"), jsOwnedString(callFrame, codeBlock->ownerNode()->sourceURL()), ReadOnly | DontDelete); } diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Error.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Error.cpp index db1d8cc..a23cb3e 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Error.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Error.cpp @@ -83,7 +83,7 @@ JSObject* Error::create(ExecState* exec, ErrorType type, const UString& message, JSObject* error = construct(exec, constructor, constructType, constructData, args); if (lineNumber != -1) - error->putWithAttributes(exec, Identifier(exec, "line"), jsNumber(exec, lineNumber), ReadOnly | DontDelete); + error->putWithAttributes(exec, Identifier(exec, JSC_ERROR_LINENUMBER_PROPERTYNAME), jsNumber(exec, lineNumber), ReadOnly | DontDelete); if (sourceID != -1) error->putWithAttributes(exec, Identifier(exec, "sourceId"), jsNumber(exec, sourceID), ReadOnly | DontDelete); if (!sourceURL.isNull()) diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Error.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Error.h index adf7fdf..8831e8e 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Error.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Error.h @@ -60,6 +60,12 @@ namespace JSC { JSObject* throwError(ExecState*, ErrorType, const char* message); JSObject* throwError(ExecState*, ErrorType); +#ifdef QT_BUILD_SCRIPT_LIB +# define JSC_ERROR_LINENUMBER_PROPERTYNAME "lineNumber" +#else +# define JSC_ERROR_LINENUMBER_PROPERTYNAME "line" +#endif + } // namespace JSC #endif // Error_h |