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
/
assign-custom-setter.js
blob
63a8c903ab16258f2467549a76fc1f10ad09c7ad
1
// RegExp.input is a handy setter
2
3
var o = RegExp;
4
function test(o) {
5
var k = 0;
6
o.input = "bar";
7
for (var i = 0; i < 30000; i++)
8
o.input = "foo";
9
10
return o.input;
11
}
12
13
var result = test(o);
14
15
for (var k = 0; k < 9; k++) {
16
var start = new Date;
17
var newResult = test(o)
18
var end = new Date;
19
if (newResult != result)
20
throw "Failed at " + k + "with " +newResult + " vs. " + result
21
result = newResult;
22
o = {__proto__ : o }
23
}
24