Bug 396574 - Javascript Speed Tests, initial pass at getting all tests correctly formatted for talos and checked in a=jresig/anodelman r=jresig

This commit is contained in:
anodelman@mozilla.com 2008-01-22 14:24:00 -08:00
Родитель e828bff9c6
Коммит 268333d927
337 изменённых файлов: 63499 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'No eval', onlyNum = 1;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Normal eval', onlyNum = 4;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'new Function', onlyNum = 4;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Pre-Compiled Function', onlyNum = 4;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'No eval', onlyNum = 8;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Normal eval', onlyNum = 8;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'new Function', onlyNum = 8;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Pre-Compiled Function', onlyNum = 8;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Normal eval', onlyNum = 1;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'new Function', onlyNum = 1;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Pre-Compiled Function', onlyNum = 1;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'No eval', onlyNum = 2;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Normal eval', onlyNum = 2;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'new Function', onlyNum = 2;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Pre-Compiled Function', onlyNum = 2;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,57 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'No eval', onlyNum = 4;
function thisTest() {
startTest("core-eval");
// Try to force real results
var ret, tmp;
// The commands that we'll be evaling
var cmd = 'var str="";for(var i=0;i<10;i++){str += "a";}ret = str;';
// TESTS: eval()
for ( var num = 1; num <= 8; num *= 2 ) (function(num){
test( "No eval", num, function(){
for ( var n = 0; n < num; n++ ) {
var str = "";
for ( var i = 0; i < 100; i++ ) {
str += "a";
}
ret = str;
}
});
tmp = cmd;
for ( var n = 0; n < num; n++ )
tmp += tmp;
test( "Normal eval", num, function(){
eval(tmp);
});
test( "new Function", num, function(){
(new Function(tmp))();
});
var fn;
try {
fn = new Function(tmp);
} catch(e){}
test( "Pre-Compiled Function", num, function(){
fn();
});
})(num);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,334 @@
% http://localhost/page_load_test/jss/core-eval-1.html
% http://localhost/page_load_test/jss/core-eval-10.html
% http://localhost/page_load_test/jss/core-eval-11.html
% http://localhost/page_load_test/jss/core-eval-12.html
% http://localhost/page_load_test/jss/core-eval-13.html
% http://localhost/page_load_test/jss/core-eval-14.html
% http://localhost/page_load_test/jss/core-eval-15.html
% http://localhost/page_load_test/jss/core-eval-16.html
% http://localhost/page_load_test/jss/core-eval-2.html
% http://localhost/page_load_test/jss/core-eval-3.html
% http://localhost/page_load_test/jss/core-eval-4.html
% http://localhost/page_load_test/jss/core-eval-5.html
% http://localhost/page_load_test/jss/core-eval-6.html
% http://localhost/page_load_test/jss/core-eval-7.html
% http://localhost/page_load_test/jss/core-eval-8.html
% http://localhost/page_load_test/jss/core-eval-9.html
% http://localhost/page_load_test/jss/object-array-1.html
% http://localhost/page_load_test/jss/object-array-10.html
% http://localhost/page_load_test/jss/object-array-11.html
% http://localhost/page_load_test/jss/object-array-12.html
% http://localhost/page_load_test/jss/object-array-13.html
% http://localhost/page_load_test/jss/object-array-14.html
% http://localhost/page_load_test/jss/object-array-15.html
% http://localhost/page_load_test/jss/object-array-16.html
% http://localhost/page_load_test/jss/object-array-17.html
% http://localhost/page_load_test/jss/object-array-18.html
% http://localhost/page_load_test/jss/object-array-19.html
% http://localhost/page_load_test/jss/object-array-2.html
% http://localhost/page_load_test/jss/object-array-20.html
% http://localhost/page_load_test/jss/object-array-21.html
% http://localhost/page_load_test/jss/object-array-22.html
% http://localhost/page_load_test/jss/object-array-23.html
% http://localhost/page_load_test/jss/object-array-24.html
% http://localhost/page_load_test/jss/object-array-25.html
% http://localhost/page_load_test/jss/object-array-26.html
% http://localhost/page_load_test/jss/object-array-27.html
% http://localhost/page_load_test/jss/object-array-28.html
% http://localhost/page_load_test/jss/object-array-29.html
% http://localhost/page_load_test/jss/object-array-3.html
% http://localhost/page_load_test/jss/object-array-30.html
% http://localhost/page_load_test/jss/object-array-31.html
% http://localhost/page_load_test/jss/object-array-32.html
% http://localhost/page_load_test/jss/object-array-4.html
% http://localhost/page_load_test/jss/object-array-5.html
% http://localhost/page_load_test/jss/object-array-6.html
% http://localhost/page_load_test/jss/object-array-7.html
% http://localhost/page_load_test/jss/object-array-8.html
% http://localhost/page_load_test/jss/object-array-9.html
% http://localhost/page_load_test/jss/object-regexp-1.html
% http://localhost/page_load_test/jss/object-regexp-10.html
% http://localhost/page_load_test/jss/object-regexp-100.html
% http://localhost/page_load_test/jss/object-regexp-101.html
% http://localhost/page_load_test/jss/object-regexp-102.html
% http://localhost/page_load_test/jss/object-regexp-103.html
% http://localhost/page_load_test/jss/object-regexp-104.html
% http://localhost/page_load_test/jss/object-regexp-105.html
% http://localhost/page_load_test/jss/object-regexp-106.html
% http://localhost/page_load_test/jss/object-regexp-107.html
% http://localhost/page_load_test/jss/object-regexp-108.html
% http://localhost/page_load_test/jss/object-regexp-109.html
% http://localhost/page_load_test/jss/object-regexp-11.html
% http://localhost/page_load_test/jss/object-regexp-110.html
% http://localhost/page_load_test/jss/object-regexp-111.html
% http://localhost/page_load_test/jss/object-regexp-112.html
% http://localhost/page_load_test/jss/object-regexp-113.html
% http://localhost/page_load_test/jss/object-regexp-114.html
% http://localhost/page_load_test/jss/object-regexp-115.html
% http://localhost/page_load_test/jss/object-regexp-116.html
% http://localhost/page_load_test/jss/object-regexp-117.html
% http://localhost/page_load_test/jss/object-regexp-118.html
% http://localhost/page_load_test/jss/object-regexp-119.html
% http://localhost/page_load_test/jss/object-regexp-12.html
% http://localhost/page_load_test/jss/object-regexp-120.html
% http://localhost/page_load_test/jss/object-regexp-121.html
% http://localhost/page_load_test/jss/object-regexp-122.html
% http://localhost/page_load_test/jss/object-regexp-123.html
% http://localhost/page_load_test/jss/object-regexp-124.html
% http://localhost/page_load_test/jss/object-regexp-125.html
% http://localhost/page_load_test/jss/object-regexp-126.html
% http://localhost/page_load_test/jss/object-regexp-127.html
% http://localhost/page_load_test/jss/object-regexp-128.html
% http://localhost/page_load_test/jss/object-regexp-129.html
% http://localhost/page_load_test/jss/object-regexp-13.html
% http://localhost/page_load_test/jss/object-regexp-130.html
% http://localhost/page_load_test/jss/object-regexp-14.html
% http://localhost/page_load_test/jss/object-regexp-15.html
% http://localhost/page_load_test/jss/object-regexp-16.html
% http://localhost/page_load_test/jss/object-regexp-17.html
% http://localhost/page_load_test/jss/object-regexp-18.html
% http://localhost/page_load_test/jss/object-regexp-19.html
% http://localhost/page_load_test/jss/object-regexp-2.html
% http://localhost/page_load_test/jss/object-regexp-20.html
% http://localhost/page_load_test/jss/object-regexp-21.html
% http://localhost/page_load_test/jss/object-regexp-22.html
% http://localhost/page_load_test/jss/object-regexp-23.html
% http://localhost/page_load_test/jss/object-regexp-24.html
% http://localhost/page_load_test/jss/object-regexp-25.html
% http://localhost/page_load_test/jss/object-regexp-26.html
% http://localhost/page_load_test/jss/object-regexp-27.html
% http://localhost/page_load_test/jss/object-regexp-28.html
% http://localhost/page_load_test/jss/object-regexp-29.html
% http://localhost/page_load_test/jss/object-regexp-3.html
% http://localhost/page_load_test/jss/object-regexp-30.html
% http://localhost/page_load_test/jss/object-regexp-31.html
% http://localhost/page_load_test/jss/object-regexp-32.html
% http://localhost/page_load_test/jss/object-regexp-33.html
% http://localhost/page_load_test/jss/object-regexp-34.html
% http://localhost/page_load_test/jss/object-regexp-35.html
% http://localhost/page_load_test/jss/object-regexp-36.html
% http://localhost/page_load_test/jss/object-regexp-37.html
% http://localhost/page_load_test/jss/object-regexp-38.html
% http://localhost/page_load_test/jss/object-regexp-39.html
% http://localhost/page_load_test/jss/object-regexp-4.html
% http://localhost/page_load_test/jss/object-regexp-40.html
% http://localhost/page_load_test/jss/object-regexp-41.html
% http://localhost/page_load_test/jss/object-regexp-42.html
% http://localhost/page_load_test/jss/object-regexp-43.html
% http://localhost/page_load_test/jss/object-regexp-44.html
% http://localhost/page_load_test/jss/object-regexp-45.html
% http://localhost/page_load_test/jss/object-regexp-46.html
% http://localhost/page_load_test/jss/object-regexp-47.html
% http://localhost/page_load_test/jss/object-regexp-48.html
% http://localhost/page_load_test/jss/object-regexp-49.html
% http://localhost/page_load_test/jss/object-regexp-5.html
% http://localhost/page_load_test/jss/object-regexp-50.html
% http://localhost/page_load_test/jss/object-regexp-51.html
% http://localhost/page_load_test/jss/object-regexp-52.html
% http://localhost/page_load_test/jss/object-regexp-53.html
% http://localhost/page_load_test/jss/object-regexp-54.html
% http://localhost/page_load_test/jss/object-regexp-55.html
% http://localhost/page_load_test/jss/object-regexp-56.html
% http://localhost/page_load_test/jss/object-regexp-57.html
% http://localhost/page_load_test/jss/object-regexp-58.html
% http://localhost/page_load_test/jss/object-regexp-59.html
% http://localhost/page_load_test/jss/object-regexp-6.html
% http://localhost/page_load_test/jss/object-regexp-60.html
% http://localhost/page_load_test/jss/object-regexp-61.html
% http://localhost/page_load_test/jss/object-regexp-62.html
% http://localhost/page_load_test/jss/object-regexp-63.html
% http://localhost/page_load_test/jss/object-regexp-64.html
% http://localhost/page_load_test/jss/object-regexp-65.html
% http://localhost/page_load_test/jss/object-regexp-66.html
% http://localhost/page_load_test/jss/object-regexp-67.html
% http://localhost/page_load_test/jss/object-regexp-68.html
% http://localhost/page_load_test/jss/object-regexp-69.html
% http://localhost/page_load_test/jss/object-regexp-7.html
% http://localhost/page_load_test/jss/object-regexp-70.html
% http://localhost/page_load_test/jss/object-regexp-71.html
% http://localhost/page_load_test/jss/object-regexp-72.html
% http://localhost/page_load_test/jss/object-regexp-73.html
% http://localhost/page_load_test/jss/object-regexp-74.html
% http://localhost/page_load_test/jss/object-regexp-75.html
% http://localhost/page_load_test/jss/object-regexp-76.html
% http://localhost/page_load_test/jss/object-regexp-77.html
% http://localhost/page_load_test/jss/object-regexp-78.html
% http://localhost/page_load_test/jss/object-regexp-79.html
% http://localhost/page_load_test/jss/object-regexp-8.html
% http://localhost/page_load_test/jss/object-regexp-80.html
% http://localhost/page_load_test/jss/object-regexp-81.html
% http://localhost/page_load_test/jss/object-regexp-82.html
% http://localhost/page_load_test/jss/object-regexp-83.html
% http://localhost/page_load_test/jss/object-regexp-84.html
% http://localhost/page_load_test/jss/object-regexp-85.html
% http://localhost/page_load_test/jss/object-regexp-86.html
% http://localhost/page_load_test/jss/object-regexp-87.html
% http://localhost/page_load_test/jss/object-regexp-88.html
% http://localhost/page_load_test/jss/object-regexp-89.html
% http://localhost/page_load_test/jss/object-regexp-9.html
% http://localhost/page_load_test/jss/object-regexp-90.html
% http://localhost/page_load_test/jss/object-regexp-91.html
% http://localhost/page_load_test/jss/object-regexp-92.html
% http://localhost/page_load_test/jss/object-regexp-93.html
% http://localhost/page_load_test/jss/object-regexp-94.html
% http://localhost/page_load_test/jss/object-regexp-95.html
% http://localhost/page_load_test/jss/object-regexp-96.html
% http://localhost/page_load_test/jss/object-regexp-97.html
% http://localhost/page_load_test/jss/object-regexp-98.html
% http://localhost/page_load_test/jss/object-regexp-99.html
% http://localhost/page_load_test/jss/object-string-1.html
% http://localhost/page_load_test/jss/object-string-10.html
% http://localhost/page_load_test/jss/object-string-11.html
% http://localhost/page_load_test/jss/object-string-12.html
% http://localhost/page_load_test/jss/object-string-13.html
% http://localhost/page_load_test/jss/object-string-14.html
% http://localhost/page_load_test/jss/object-string-15.html
% http://localhost/page_load_test/jss/object-string-16.html
% http://localhost/page_load_test/jss/object-string-17.html
% http://localhost/page_load_test/jss/object-string-18.html
% http://localhost/page_load_test/jss/object-string-19.html
% http://localhost/page_load_test/jss/object-string-2.html
% http://localhost/page_load_test/jss/object-string-20.html
% http://localhost/page_load_test/jss/object-string-21.html
% http://localhost/page_load_test/jss/object-string-22.html
% http://localhost/page_load_test/jss/object-string-23.html
% http://localhost/page_load_test/jss/object-string-24.html
% http://localhost/page_load_test/jss/object-string-25.html
% http://localhost/page_load_test/jss/object-string-26.html
% http://localhost/page_load_test/jss/object-string-27.html
% http://localhost/page_load_test/jss/object-string-28.html
% http://localhost/page_load_test/jss/object-string-29.html
% http://localhost/page_load_test/jss/object-string-3.html
% http://localhost/page_load_test/jss/object-string-30.html
% http://localhost/page_load_test/jss/object-string-31.html
% http://localhost/page_load_test/jss/object-string-32.html
% http://localhost/page_load_test/jss/object-string-33.html
% http://localhost/page_load_test/jss/object-string-34.html
% http://localhost/page_load_test/jss/object-string-35.html
% http://localhost/page_load_test/jss/object-string-36.html
% http://localhost/page_load_test/jss/object-string-37.html
% http://localhost/page_load_test/jss/object-string-38.html
% http://localhost/page_load_test/jss/object-string-39.html
% http://localhost/page_load_test/jss/object-string-4.html
% http://localhost/page_load_test/jss/object-string-40.html
% http://localhost/page_load_test/jss/object-string-41.html
% http://localhost/page_load_test/jss/object-string-42.html
% http://localhost/page_load_test/jss/object-string-43.html
% http://localhost/page_load_test/jss/object-string-44.html
% http://localhost/page_load_test/jss/object-string-45.html
% http://localhost/page_load_test/jss/object-string-46.html
% http://localhost/page_load_test/jss/object-string-47.html
% http://localhost/page_load_test/jss/object-string-48.html
% http://localhost/page_load_test/jss/object-string-49.html
% http://localhost/page_load_test/jss/object-string-5.html
% http://localhost/page_load_test/jss/object-string-50.html
% http://localhost/page_load_test/jss/object-string-51.html
% http://localhost/page_load_test/jss/object-string-52.html
% http://localhost/page_load_test/jss/object-string-53.html
% http://localhost/page_load_test/jss/object-string-54.html
% http://localhost/page_load_test/jss/object-string-55.html
% http://localhost/page_load_test/jss/object-string-56.html
% http://localhost/page_load_test/jss/object-string-57.html
% http://localhost/page_load_test/jss/object-string-58.html
% http://localhost/page_load_test/jss/object-string-59.html
% http://localhost/page_load_test/jss/object-string-6.html
% http://localhost/page_load_test/jss/object-string-60.html
% http://localhost/page_load_test/jss/object-string-61.html
% http://localhost/page_load_test/jss/object-string-62.html
% http://localhost/page_load_test/jss/object-string-63.html
% http://localhost/page_load_test/jss/object-string-64.html
% http://localhost/page_load_test/jss/object-string-65.html
% http://localhost/page_load_test/jss/object-string-66.html
% http://localhost/page_load_test/jss/object-string-67.html
% http://localhost/page_load_test/jss/object-string-68.html
% http://localhost/page_load_test/jss/object-string-69.html
% http://localhost/page_load_test/jss/object-string-7.html
% http://localhost/page_load_test/jss/object-string-70.html
% http://localhost/page_load_test/jss/object-string-71.html
% http://localhost/page_load_test/jss/object-string-72.html
% http://localhost/page_load_test/jss/object-string-73.html
% http://localhost/page_load_test/jss/object-string-74.html
% http://localhost/page_load_test/jss/object-string-75.html
% http://localhost/page_load_test/jss/object-string-76.html
% http://localhost/page_load_test/jss/object-string-77.html
% http://localhost/page_load_test/jss/object-string-78.html
% http://localhost/page_load_test/jss/object-string-79.html
% http://localhost/page_load_test/jss/object-string-8.html
% http://localhost/page_load_test/jss/object-string-80.html
% http://localhost/page_load_test/jss/object-string-81.html
% http://localhost/page_load_test/jss/object-string-82.html
% http://localhost/page_load_test/jss/object-string-83.html
% http://localhost/page_load_test/jss/object-string-84.html
% http://localhost/page_load_test/jss/object-string-9.html
% http://localhost/page_load_test/jss/real-base64-1.html
% http://localhost/page_load_test/jss/real-base64-2.html
% http://localhost/page_load_test/jss/real-base64-3.html
% http://localhost/page_load_test/jss/real-base64-4.html
% http://localhost/page_load_test/jss/real-base64-5.html
% http://localhost/page_load_test/jss/real-base64-6.html
% http://localhost/page_load_test/jss/real-base64-7.html
% http://localhost/page_load_test/jss/real-base64-8.html
% http://localhost/page_load_test/jss/real-binary-trees-1.html
% http://localhost/page_load_test/jss/real-binary-trees-2.html
% http://localhost/page_load_test/jss/real-binary-trees-3.html
% http://localhost/page_load_test/jss/real-cube-1.html
% http://localhost/page_load_test/jss/real-cube-2.html
% http://localhost/page_load_test/jss/real-cube-3.html
% http://localhost/page_load_test/jss/real-cube-4.html
% http://localhost/page_load_test/jss/real-fannkuch-1.html
% http://localhost/page_load_test/jss/real-fannkuch-2.html
% http://localhost/page_load_test/jss/real-fannkuch-3.html
% http://localhost/page_load_test/jss/real-fannkuch-4.html
% http://localhost/page_load_test/jss/real-fasta-1.html
% http://localhost/page_load_test/jss/real-fasta-10.html
% http://localhost/page_load_test/jss/real-fasta-11.html
% http://localhost/page_load_test/jss/real-fasta-12.html
% http://localhost/page_load_test/jss/real-fasta-2.html
% http://localhost/page_load_test/jss/real-fasta-3.html
% http://localhost/page_load_test/jss/real-fasta-4.html
% http://localhost/page_load_test/jss/real-fasta-5.html
% http://localhost/page_load_test/jss/real-fasta-6.html
% http://localhost/page_load_test/jss/real-fasta-7.html
% http://localhost/page_load_test/jss/real-fasta-8.html
% http://localhost/page_load_test/jss/real-fasta-9.html
% http://localhost/page_load_test/jss/real-morph-1.html
% http://localhost/page_load_test/jss/real-morph-2.html
% http://localhost/page_load_test/jss/real-morph-3.html
% http://localhost/page_load_test/jss/real-morph-4.html
% http://localhost/page_load_test/jss/real-nbody-1.html
% http://localhost/page_load_test/jss/real-nbody-2.html
% http://localhost/page_load_test/jss/real-nbody-3.html
% http://localhost/page_load_test/jss/real-nbody-4.html
% http://localhost/page_load_test/jss/real-nsieve-1.html
% http://localhost/page_load_test/jss/real-nsieve-2.html
% http://localhost/page_load_test/jss/real-nsieve-3.html
% http://localhost/page_load_test/jss/real-nsieve-4.html
% http://localhost/page_load_test/jss/real-nsieve-bits-1.html
% http://localhost/page_load_test/jss/real-nsieve-bits-2.html
% http://localhost/page_load_test/jss/real-nsieve-bits-3.html
% http://localhost/page_load_test/jss/real-nsieve-bits-4.html
% http://localhost/page_load_test/jss/real-packer-1.html
% http://localhost/page_load_test/jss/real-packer-2.html
% http://localhost/page_load_test/jss/real-packer-3.html
% http://localhost/page_load_test/jss/real-packer-4.html
% http://localhost/page_load_test/jss/real-packer-5.html
% http://localhost/page_load_test/jss/real-partial-sums-1.html
% http://localhost/page_load_test/jss/real-partial-sums-2.html
% http://localhost/page_load_test/jss/real-partial-sums-3.html
% http://localhost/page_load_test/jss/real-partial-sums-4.html
% http://localhost/page_load_test/jss/real-recursive-1.html
% http://localhost/page_load_test/jss/real-recursive-10.html
% http://localhost/page_load_test/jss/real-recursive-11.html
% http://localhost/page_load_test/jss/real-recursive-12.html
% http://localhost/page_load_test/jss/real-recursive-2.html
% http://localhost/page_load_test/jss/real-recursive-3.html
% http://localhost/page_load_test/jss/real-recursive-4.html
% http://localhost/page_load_test/jss/real-recursive-5.html
% http://localhost/page_load_test/jss/real-recursive-6.html
% http://localhost/page_load_test/jss/real-recursive-7.html
% http://localhost/page_load_test/jss/real-recursive-8.html
% http://localhost/page_load_test/jss/real-recursive-9.html
% http://localhost/page_load_test/jss/real-spectral-norm-1.html
% http://localhost/page_load_test/jss/real-spectral-norm-2.html
% http://localhost/page_load_test/jss/real-spectral-norm-3.html
% http://localhost/page_load_test/jss/real-spectral-norm-4.html

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, []', onlyNum = 16384;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, new Array()', onlyNum = 32768;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, push', onlyNum = 32768;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, pop', onlyNum = 256;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, unshift', onlyNum = 256;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, shift', onlyNum = 256;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, splice', onlyNum = 256;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, splice', onlyNum = 256;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, []', onlyNum = 65536;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, new Array()', onlyNum = 65536;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, push', onlyNum = 65536;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, new Array()', onlyNum = 16384;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, pop', onlyNum = 512;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, unshift', onlyNum = 512;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, shift', onlyNum = 512;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, splice', onlyNum = 512;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, splice', onlyNum = 512;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, []', onlyNum = 131072;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, new Array()', onlyNum = 131072;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, push', onlyNum = 131072;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, pop', onlyNum = 1024;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, unshift', onlyNum = 1024;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, push', onlyNum = 16384;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, shift', onlyNum = 1024;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, splice', onlyNum = 1024;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, splice', onlyNum = 1024;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, pop', onlyNum = 128;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, unshift', onlyNum = 128;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, shift', onlyNum = 128;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, splice', onlyNum = 128;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Deconstruction, splice', onlyNum = 128;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,68 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Array Construction, []', onlyNum = 32768;
function thisTest() {
startTest("object-array");
var ret = [], tmp, num = 500;
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: Array Building
test("Array Construction, []", i, function(){
for ( var j = 0; j < num; j++ ) {
ret = [];
ret.length = i;
}
});
test("Array Construction, new Array()", i, function(){
for ( var j = 0; j < num; j++ )
ret = new Array(i);
});
test("Array Construction, push", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.push(j);
});
i /= 128;
test("Array Deconstruction, pop", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.pop();
});
test("Array Construction, unshift", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.unshift(j);
});
test("Array Deconstruction, shift", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.shift();
});
test("Array Construction, splice", i, function(){
ret = [];
for ( var j = 0; j < i; j++ )
ret.splice(0,0,j);
});
test("Array Deconstruction, splice", i, function(){
for ( var j = 0; j < i; j++ )
tmp = ret.splice(0,1);
});
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Object Empty Split', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Object Empty Replace', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Match', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Test', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Empty Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled 12 Char Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Object Match', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Object Test', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Object Empty Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Object 12 Char Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Object 12 Char Replace Function', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Match', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Object 12 Char Replace', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Test', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Empty Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable 12 Char Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Object Match', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Object Test', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Object Empty Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Object 12 Char Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Object 12 Char Replace Function', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Capture Match', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Capture Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Object 12 Char Replace Function', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Capture Replace with Capture', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Capture Replace with Capture Function', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Capture Replace with Upperase Capture Function', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Uncompiled Match', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Uncompiled Test', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Uncompiled Empty Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Uncompiled 12 Char Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Uncompiled Object Match', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Uncompiled Object Test', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Uncompiled Object Empty Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Match', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Uncompiled Object 12 Char Replace', onlyNum = 131072;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Test', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Empty Replace', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable 12 Char Replace', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Object Match', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Object Test', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Object Empty Replace', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Object Char Split', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Object 12 Char Replace', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Variable Object 12 Char Replace Function', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Capture Match', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Capture Replace', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Capture Replace with Capture', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Capture Replace with Capture Function', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Compiled Capture Replace with Upperase Capture Function', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Просмотреть файл

@ -0,0 +1,264 @@
<html><head>
<!-- MOZ_INSERT_CONTENT_HOOK -->
<script src = runner.js></script>
<script>
var onlyName = 'Uncompiled Match', onlyNum = 16384;
function thisTest() {
startTest("object-regexp");
// Try to force real results
var str = "", tmp, ret, re;
for ( var i = 0; i < 16384; i++ )
str += String.fromCharCode( (25 * Math.random()) + 97 );
for ( var i = 16384; i <= 131072; i *= 2 ) (function(i){
// TESTS: split
// Note: These tests are really slow, so we're running them for smaller
// test sets only.
if ( i <= 32768 ) {
re = //;
tmp = str;
test( "Compiled Object Empty Split", i, function(){
ret = tmp.split( re );
});
re = /a/;
tmp = str;
test( "Compiled Object Char Split", i, function(){
ret = tmp.split( re );
});
re = /.*/;
tmp = str;
test( "Compiled Object Variable Split", i, function(){
ret = tmp.split( re );
});
}
// TESTS: Compiled RegExps
re = /aaaaaaaaaa/g;
tmp = str;
test( "Compiled Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Variable Length
re = /a.*a/;
tmp = str;
test( "Compiled Variable Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
re = new RegExp("aaaaaaaaaa", "g");
tmp = str;
test( "Compiled Variable Object Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Variable Object Test", i, function(){
ret = re.test( tmp );
});
tmp = str;
test( "Compiled Variable Object Empty Replace", i, function(){
ret = tmp.replace( re, "" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Variable Object 12 Char Replace Function", i, function(){
ret = tmp.replace( re, function(all){
return "asdfasdfasdf";
});
});
// TESTS: Capturing
re = /aa(b)aa/g;
tmp = str;
test( "Compiled Capture Match", i, function(){
ret = tmp.match( re );
});
tmp = str;
test( "Compiled Capture Replace", i, function(){
ret = tmp.replace( re, "asdfasdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture", i, function(){
ret = tmp.replace( re, "asdf\\1asdfasdf" );
});
tmp = str;
test( "Compiled Capture Replace with Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return "asdf" + capture + "asdfasdf";
});
});
tmp = str;
test( "Compiled Capture Replace with Upperase Capture Function", i, function(){
ret = tmp.replace( re, function(all,capture){
return capture.toUpperCase();
});
});
// TESTS: Uncompiled RegExps
tmp = str;
test( "Uncompiled Match", i, function(){
ret = tmp.match( /aaaaaaaaaa/g );
});
tmp = str;
test( "Uncompiled Test", i, function(){
ret = (/aaaaaaaaaa/g).test( tmp );
});
tmp = str;
test( "Uncompiled Empty Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "" );
});
tmp = str;
test( "Uncompiled 12 Char Replace", i, function(){
ret = tmp.replace( /aaaaaaaaaa/g, "asdfasdfasdf" );
});
tmp = str;
test( "Uncompiled Object Match", i, function(){
ret = tmp.match( new RegExp("aaaaaaaaaa", "g") );
});
tmp = str;
test( "Uncompiled Object Test", i, function(){
ret = (new RegExp("aaaaaaaaaa", "g")).test( tmp );
});
tmp = str;
test( "Uncompiled Object Empty Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "" );
});
tmp = str;
test( "Uncompiled Object 12 Char Replace", i, function(){
ret = tmp.replace( new RegExp("aaaaaaaaaa", "g"), "asdfasdfasdf" );
});
// Double the length of the string
str += str;
})(i);
endTest();
}
</script>
<body onload="thisTest()"></body></html>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше