repo.or.cz
/
qtwebkit.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Update ReadMe.md
[qtwebkit.git]
/
JSTests
/
microbenchmarks
/
object-closure-call.js
blob
88b1afc6056486fb4e483f34f446038da05ec194
1
function makeObjectClosure(value) {
2
function foo() {
3
return this.x;
4
}
5
return {foo:foo, x:value};
6
}
7
8
var result = 0;
9
for (var i = 0; i < 10000; ++i) {
10
var o = makeObjectClosure(i);
11
for (var j = 0; j < 100; ++j)
12
result += o.foo();
13
}
14
15
if (result != 4999500000)
16
throw "Error: bad result: " + result;