}
}
-QString ExecutionContext::currentFileName() const
-{
- const ExecutionContext *c = this;
- while (c) {
- if (const SimpleCallContext *callCtx = c->asCallContext()) {
- FunctionObject *f = callCtx->function;
- if (f && f->function)
- return f->function->sourceFile;
- }
- c = c->outer;
- }
- return QString();
-}
-
-int ExecutionContext::currentLineNumber() const
-{
- // ### FIXME: we may need to record the return address upon entering from
- // JIT code and then look up in a map from instruction pointer to line number.
- return -1;
-}
-
void ExecutionContext::setProperty(String *name, const Value& value)
{
for (ExecutionContext *ctx = this; ctx; ctx = ctx->outer) {
void mark();
- QString currentFileName() const;
- int currentLineNumber() const;
-
inline CallContext *asCallContext();
inline const CallContext *asCallContext() const;
};
return;
QQmlError retn;
retn.setDescription(description);
- retn.setLine(ctx->currentLineNumber());
- retn.setUrl(QUrl(ctx->currentFileName()));
+
+ QV4::ExecutionEngine::StackFrame frame = ctx->engine->currentStackFrame();
+
+ retn.setLine(frame.line);
+ retn.setUrl(QUrl(frame.source));
QQmlEnginePrivate::warning(engine, retn);
}
{
/* Qt containers have int (rather than uint) allowable indexes. */
if (index > INT_MAX) {
- generateWarning(ctx, QLatin1String("Index out of range during indexed put"));
+ generateWarning(ctx, QLatin1String("Index out of range during indexed set"));
return;
}