feat: add dependency
This commit is contained in:
1
javascript-engine/external/boa/boa_engine/benches/bench_scripts/arithmetic_operations.js
vendored
Normal file
1
javascript-engine/external/boa/boa_engine/benches/bench_scripts/arithmetic_operations.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
((2 + 2) ** 3 / 100 - 5 ** 3 * -1000) ** 2 + 100 - 8;
|
||||
7
javascript-engine/external/boa/boa_engine/benches/bench_scripts/array_access.js
vendored
Normal file
7
javascript-engine/external/boa/boa_engine/benches/bench_scripts/array_access.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
(function () {
|
||||
let testArr = [1, 2, 3, 4, 5];
|
||||
|
||||
let res = testArr[2];
|
||||
|
||||
return res;
|
||||
})();
|
||||
8
javascript-engine/external/boa/boa_engine/benches/bench_scripts/array_create.js
vendored
Normal file
8
javascript-engine/external/boa/boa_engine/benches/bench_scripts/array_create.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
(function () {
|
||||
let testArr = [];
|
||||
for (let a = 0; a <= 500; a++) {
|
||||
testArr[a] = "p" + a;
|
||||
}
|
||||
|
||||
return testArr;
|
||||
})();
|
||||
22
javascript-engine/external/boa/boa_engine/benches/bench_scripts/array_pop.js
vendored
Normal file
22
javascript-engine/external/boa/boa_engine/benches/bench_scripts/array_pop.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(function () {
|
||||
let testArray = [
|
||||
83, 93, 27, 29, 2828, 234, 23, 56, 32, 56, 67, 77, 32, 45, 93, 17, 28, 83,
|
||||
62, 99, 36, 28, 93, 27, 29, 2828, 234, 23, 56, 32, 56, 67, 77, 32, 45, 93,
|
||||
17, 28, 83, 62, 99, 36, 28, 93, 27, 29, 2828, 234, 23, 56, 32, 56, 67, 77,
|
||||
32, 45, 93, 17, 28, 83, 62, 99, 36, 28, 93, 27, 29, 2828, 234, 23, 56, 32,
|
||||
56, 67, 77, 32, 45, 93, 17, 28, 83, 62, 99, 36, 28, 93, 27, 29, 2828, 234,
|
||||
23, 56, 32, 56, 67, 77, 32, 45, 93, 17, 28, 83, 62, 99, 36, 28, 93, 27, 29,
|
||||
2828, 234, 23, 56, 32, 56, 67, 77, 32, 45, 93, 17, 28, 83, 62, 99, 36, 28,
|
||||
93, 27, 29, 2828, 234, 23, 56, 32, 56, 67, 77, 32, 45, 93, 17, 28, 83, 62,
|
||||
99, 36, 28, 93, 27, 29, 2828, 234, 23, 56, 32, 56, 67, 77, 32, 45, 93, 17,
|
||||
28, 83, 62, 99, 36, 28, 93, 27, 29, 2828, 234, 23, 56, 32, 56, 67, 77, 32,
|
||||
45, 93, 17, 28, 83, 62, 99, 36, 28, 93, 27, 29, 2828, 234, 23, 56, 32, 56,
|
||||
67, 77, 32, 45, 93, 17, 28, 83, 62, 99, 36, 28,
|
||||
];
|
||||
|
||||
while (testArray.length > 0) {
|
||||
testArray.pop();
|
||||
}
|
||||
|
||||
return testArray;
|
||||
})();
|
||||
7
javascript-engine/external/boa/boa_engine/benches/bench_scripts/boolean_object_access.js
vendored
Normal file
7
javascript-engine/external/boa/boa_engine/benches/bench_scripts/boolean_object_access.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
new Boolean(
|
||||
!new Boolean(
|
||||
new Boolean(
|
||||
!new Boolean(false).valueOf() && new Boolean(true).valueOf()
|
||||
).valueOf()
|
||||
).valueOf()
|
||||
).valueOf();
|
||||
15
javascript-engine/external/boa/boa_engine/benches/bench_scripts/clean_js.js
vendored
Normal file
15
javascript-engine/external/boa/boa_engine/benches/bench_scripts/clean_js.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
!function () {
|
||||
var M = new Array();
|
||||
for (i = 0; i < 100; i++) {
|
||||
M.push(Math.floor(Math.random() * 100));
|
||||
}
|
||||
var test = [];
|
||||
for (i = 0; i < 100; i++) {
|
||||
if (M[i] > 50) {
|
||||
test.push(M[i]);
|
||||
}
|
||||
}
|
||||
test.forEach(elem => {
|
||||
0
|
||||
});
|
||||
}();
|
||||
10
javascript-engine/external/boa/boa_engine/benches/bench_scripts/fibonacci.js
vendored
Normal file
10
javascript-engine/external/boa/boa_engine/benches/bench_scripts/fibonacci.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
(function () {
|
||||
let num = 12;
|
||||
|
||||
function fib(n) {
|
||||
if (n <= 1) return 1;
|
||||
return fib(n - 1) + fib(n - 2);
|
||||
}
|
||||
|
||||
return fib(num);
|
||||
})();
|
||||
10
javascript-engine/external/boa/boa_engine/benches/bench_scripts/for_loop.js
vendored
Normal file
10
javascript-engine/external/boa/boa_engine/benches/bench_scripts/for_loop.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
(function () {
|
||||
let b = "hello";
|
||||
for (let a = 10; a < 100; a += 5) {
|
||||
if (a < 50) {
|
||||
b += "world";
|
||||
}
|
||||
}
|
||||
|
||||
return b;
|
||||
})();
|
||||
1
javascript-engine/external/boa/boa_engine/benches/bench_scripts/mini_js.js
vendored
Normal file
1
javascript-engine/external/boa/boa_engine/benches/bench_scripts/mini_js.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){var r=new Array();for(i=0;i<100;i++)r.push(Math.floor(100*Math.random()));var a=[];for(i=0;i<100;i++)r[i]>50&&a.push(r[i]);a.forEach(i=>{0})}();
|
||||
5
javascript-engine/external/boa/boa_engine/benches/bench_scripts/number_object_access.js
vendored
Normal file
5
javascript-engine/external/boa/boa_engine/benches/bench_scripts/number_object_access.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
new Number(
|
||||
new Number(
|
||||
new Number(new Number(100).valueOf() - 10.5).valueOf() + 100
|
||||
).valueOf() * 1.6
|
||||
);
|
||||
8
javascript-engine/external/boa/boa_engine/benches/bench_scripts/object_creation.js
vendored
Normal file
8
javascript-engine/external/boa/boa_engine/benches/bench_scripts/object_creation.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
(function () {
|
||||
let test = {
|
||||
my_prop: "hello",
|
||||
another: 65,
|
||||
};
|
||||
|
||||
return test;
|
||||
})();
|
||||
8
javascript-engine/external/boa/boa_engine/benches/bench_scripts/object_prop_access_const.js
vendored
Normal file
8
javascript-engine/external/boa/boa_engine/benches/bench_scripts/object_prop_access_const.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
(function () {
|
||||
let test = {
|
||||
my_prop: "hello",
|
||||
another: 65,
|
||||
};
|
||||
|
||||
return test.my_prop;
|
||||
})();
|
||||
8
javascript-engine/external/boa/boa_engine/benches/bench_scripts/object_prop_access_dyn.js
vendored
Normal file
8
javascript-engine/external/boa/boa_engine/benches/bench_scripts/object_prop_access_dyn.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
(function () {
|
||||
let test = {
|
||||
my_prop: "hello",
|
||||
another: 65,
|
||||
};
|
||||
|
||||
return test["my" + "_prop"];
|
||||
})();
|
||||
5
javascript-engine/external/boa/boa_engine/benches/bench_scripts/regexp.js
vendored
Normal file
5
javascript-engine/external/boa/boa_engine/benches/bench_scripts/regexp.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
(function () {
|
||||
let regExp = new RegExp("hello", "i");
|
||||
|
||||
return regExp.test("Hello World");
|
||||
})();
|
||||
5
javascript-engine/external/boa/boa_engine/benches/bench_scripts/regexp_creation.js
vendored
Normal file
5
javascript-engine/external/boa/boa_engine/benches/bench_scripts/regexp_creation.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
(function () {
|
||||
let regExp = new RegExp("hello", "i");
|
||||
|
||||
return regExp;
|
||||
})();
|
||||
5
javascript-engine/external/boa/boa_engine/benches/bench_scripts/regexp_literal.js
vendored
Normal file
5
javascript-engine/external/boa/boa_engine/benches/bench_scripts/regexp_literal.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
(function () {
|
||||
let regExp = /hello/i;
|
||||
|
||||
return regExp.test("Hello World");
|
||||
})();
|
||||
5
javascript-engine/external/boa/boa_engine/benches/bench_scripts/regexp_literal_creation.js
vendored
Normal file
5
javascript-engine/external/boa/boa_engine/benches/bench_scripts/regexp_literal_creation.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
(function () {
|
||||
let regExp = /hello/i;
|
||||
|
||||
return regExp;
|
||||
})();
|
||||
9
javascript-engine/external/boa/boa_engine/benches/bench_scripts/string_compare.js
vendored
Normal file
9
javascript-engine/external/boa/boa_engine/benches/bench_scripts/string_compare.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
(function () {
|
||||
var a = "hello";
|
||||
var b = "world";
|
||||
|
||||
var c = a == b;
|
||||
|
||||
var d = b;
|
||||
var e = d == b;
|
||||
})();
|
||||
6
javascript-engine/external/boa/boa_engine/benches/bench_scripts/string_concat.js
vendored
Normal file
6
javascript-engine/external/boa/boa_engine/benches/bench_scripts/string_concat.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
(function () {
|
||||
var a = "hello";
|
||||
var b = "world";
|
||||
|
||||
var c = a + b;
|
||||
})();
|
||||
4
javascript-engine/external/boa/boa_engine/benches/bench_scripts/string_copy.js
vendored
Normal file
4
javascript-engine/external/boa/boa_engine/benches/bench_scripts/string_copy.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
(function () {
|
||||
var a = "hello";
|
||||
var b = a;
|
||||
})();
|
||||
7
javascript-engine/external/boa/boa_engine/benches/bench_scripts/string_object_access.js
vendored
Normal file
7
javascript-engine/external/boa/boa_engine/benches/bench_scripts/string_object_access.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
new String(
|
||||
new String(
|
||||
new String(
|
||||
new String("Hello").valueOf() + new String(", world").valueOf()
|
||||
).valueOf() + "!"
|
||||
).valueOf()
|
||||
).valueOf();
|
||||
3
javascript-engine/external/boa/boa_engine/benches/bench_scripts/symbol_creation.js
vendored
Normal file
3
javascript-engine/external/boa/boa_engine/benches/bench_scripts/symbol_creation.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
(function () {
|
||||
return Symbol();
|
||||
})();
|
||||
Reference in New Issue
Block a user