diff options
author | Lars Knoll <[email protected]> | 2017-08-06 12:05:39 +0200 |
---|---|---|
committer | Lars Knoll <[email protected]> | 2017-08-08 18:59:13 +0000 |
commit | 488402c2dadce673ac23f3fa44055819acc08cc9 (patch) | |
tree | 6855aa01b459382f8c35f47d23f774b4dba43004 | |
parent | 64a20f9277f5461640e531a6dc1ca28ae91afa39 (diff) |
Remove dead code
Context::getProperty and friends will never get called with 'this'
as the name.
Change-Id: I715996ce4ce6508e4734d2b3bdb1a4ad44208eeb
Reviewed-by: Simon Hausmann <[email protected]>
-rw-r--r-- | src/qml/jsruntime/qv4context.cpp | 8 | ||||
-rw-r--r-- | tests/manual/v4/fact.2.js | 2 |
2 files changed, 2 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 22278e0405..57ae10a459 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -344,7 +344,7 @@ void ExecutionContext::setProperty(String *name, const Value &value) } } - if (d()->strictMode || name->equals(engine()->id_this())) { + if (d()->strictMode) { ScopedValue n(scope, name->asReturnedValue()); engine()->throwReferenceError(n); return; @@ -358,9 +358,6 @@ ReturnedValue ExecutionContext::getProperty(String *name) ScopedValue v(scope); name->makeIdentifier(); - if (name->equals(engine()->id_this())) - return thisObject().asReturnedValue(); - ScopedContext ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { switch (ctx->d()->type) { @@ -414,9 +411,6 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Value *base) base->setM(0); name->makeIdentifier(); - if (name->equals(engine()->id_this())) - return thisObject().asReturnedValue(); - ScopedContext ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { switch (ctx->d()->type) { diff --git a/tests/manual/v4/fact.2.js b/tests/manual/v4/fact.2.js index d8f750b5a1..1696e8b80d 100644 --- a/tests/manual/v4/fact.2.js +++ b/tests/manual/v4/fact.2.js @@ -3,6 +3,6 @@ function fact(n) { return n > 1 ? n * fact(n - 1) : 1 } -for (var i = 0; i < 1000000; i = i + 1) +for (var i = 0; i < 100000; i = i + 1) fact(12) |