Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,5 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
print("Fake stub");

View File

@ -0,0 +1,5 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
print("JSTest");

View File

@ -0,0 +1,9 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: JSTests/fake_stub.js
print("Fake stub");
// Original: JSTests/load.js
print("JSTest");

View File

@ -0,0 +1,32 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let __v_0 = 0;
let __v_1 = 0;
console.log(__v_0, __v_1, __f_0, __f_1);
function __f_0() {
let __v_2 = 0;
console.log(__v_2, __f_0, __f_1);
}
let __v_3 = 0;
console.log(__v_0, __v_1, __v_3, __f_0, __f_1);
function __f_1(__v_7) {
let __v_4 = 0;
console.log(__v_4, __v_7, __f_0, __f_1);
{
let __v_5 = 0;
var __v_6 = 0;
console.log(__v_4, __v_5, __v_6, __v_7, __f_0, __f_1, __f_2);
function __f_2 () {};
console.log(__v_4, __v_5, __v_6, __v_7, __f_0, __f_1, __f_2);
}
console.log(__v_4, __v_6, __v_7, __f_0, __f_1);
}
console.log(__v_0, __v_1, __v_3, __f_0, __f_1);

View File

@ -0,0 +1,30 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let __v_0 = 0;
let __v_1 = 0;
console.log(__v_0, __v_1);
(() => {
let __v_2 = 0;
console.log(__v_0, __v_1, __v_2);
})();
let __v_3 = 0;
console.log(__v_0, __v_1, __v_3);
((__v_7) => {
let __v_4 = 0;
console.log(__v_0, __v_1, __v_3, __v_4, __v_7);
{
let __v_5 = 0;
var __v_6 = 0;
console.log(__v_0, __v_1, __v_3, __v_4, __v_5, __v_6, __v_7);
}
console.log(__v_0, __v_1, __v_3, __v_4, __v_6, __v_7);
})(42);
console.log(__v_0, __v_1, __v_3);

View File

@ -0,0 +1,187 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_2"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_5"
},
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_6"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_6"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
}
]

View File

@ -0,0 +1,214 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_2"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_5"
},
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_6"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_2"
},
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_5"
},
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_6"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_2"
},
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_6"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
}
]

View File

@ -0,0 +1,30 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let __v_0 = 0;
let __v_1 = 0;
console.log(__v_0, __v_1);
(function () {
let __v_2 = 0;
console.log(__v_0, __v_1, __v_2);
})();
let __v_3 = 0;
console.log(__v_0, __v_1, __v_3);
(function (__v_7) {
let __v_4 = 0;
console.log(__v_0, __v_1, __v_3, __v_4, __v_7);
{
let __v_5 = 0;
var __v_6 = 0;
console.log(__v_0, __v_1, __v_3, __v_4, __v_5, __v_6, __v_7);
}
console.log(__v_0, __v_1, __v_3, __v_4, __v_6, __v_7);
})(42);
console.log(__v_0, __v_1, __v_3);

View File

@ -0,0 +1,187 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_2"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_5"
},
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_6"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_6"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": []
}
]

View File

@ -0,0 +1,270 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_2"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_5"
},
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_6"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_2"
},
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_5"
},
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_6"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_2"
},
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_7"
},
{
"type": "Identifier",
"name": "__v_4"
},
{
"type": "Identifier",
"name": "__v_6"
},
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
},
{
"variables": [
{
"type": "Identifier",
"name": "__v_0"
},
{
"type": "Identifier",
"name": "__v_1"
},
{
"type": "Identifier",
"name": "__v_3"
}
],
"functions": [
{
"type": "Identifier",
"name": "__f_0"
},
{
"type": "Identifier",
"name": "__f_1"
}
]
}
]

View File

@ -0,0 +1,6 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
WScript.LoadScriptFile("..\\load2.js", "self");
console.log('load3');

View File

@ -0,0 +1,14 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
if (this.WScript && this.WScript.LoadScriptFile) {
var { script } = WScript.LoadScriptFile("load1.js");
}
var { script1 } = WScript.LoadScriptFile("load1.js"),
{ script2 } = WScript.LoadScriptFile("load1.js");
console.log('load.js');
script();

View File

@ -0,0 +1,10 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Test case insensitivity.
WScript.LoadScriptFile("DIR\\LoAd3.js");
console.log('load1.js');
function script() {}

View File

@ -0,0 +1,5 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
console.log('load2.js');

View File

@ -0,0 +1,25 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: resources/chakra_stubs.js
function test(fun) {
try {
fun();
} catch (e) {}
}
// Original: chakra/load2.js
console.log('load2.js');
// Original: chakra/dir/load3.js
console.log('load3');
// Original: chakra/load1.js
console.log('load1.js');
function script() {}
// Original: chakra/load.js
if (this.WScript && this.WScript.LoadScriptFile) {}
console.log('load.js');
script();

View File

@ -0,0 +1,181 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let a = 0;
let b = 0;
// ----------------------------------------------------------------------------
// Closures that can be transformed.
// Basic cases.
(() => {
const b = 1;
foo(a + b);
})();
(() => {
const a = 1;
for (let c = 0; c < a; c++) foo(a + b + c + d);
})();
(function bar() {
const b = 1;
for (let c = 0; c < a; c++) foo(a + b + c + d);
})();
(function bar() {
const a = 1;
for (let c = 0; c < a; c++) foo(a + b + c + d);
})();
(function () {
const b = 1;
for (let c = 0; c < a; c++) foo(a + b + c + d);
this.a = 6;
})();
(function () {
const a = 1;
for (let c = 0; c < a; c++) foo(a + b + c + d);
})();
// Various name collision examples.
(function () {
const col1 = 1;
})();
const col1 = 2;
(function () {
var col2 = 1;
})();
col2 = 2;
var col3 = 2;
(function () {
var col3 = 1;
})();
var col4 = 2;
(function () {
col4 = 1;
})();
// Nested.
(() => {
(() => {
let a = 1;
while (b) b += a;
})();
})();
// Nested functions that return.
(() => {
(() => {
let a = 1;
return a;
})();
(() => {
if(foo()) return 0;
})();
})();
// Removable outer closure, but inner closures that stress the function stack.
(() => {
(function bar(a=() => { return 0; }) {
const b = () => { return 0; };
})(() => { return 0; });
(() => {
return () => { return 0; };
})();
})();
// ----------------------------------------------------------------------------
// Closures that can't be transformed.
// Don't bother with empty bodies.
(function () {})();
// Self reference.
(function bar() {
const a = bar();
})();
// Return statements.
(function () {
if (b++ > 10) return;
console.log(42);
})();
(function () {
const b = 0;
return b;
})();
// No block body.
(() => console.log(42))();
// Other non-supported cases.
(async function () {
console.log(42);
})();
(function* () {
console.log(42);
})();
// Normal function definition.
function foo2() {
let a = 0;
}
// Function expression (but no call).
const f = function foo3() {
const b = 0;
};
// Not top-level scope.
{
(() => { const a = 1; })();
}
function foo3() {
(() => { const a = 1; })();
}
(function () {
(() => { console.log(42); })();
(() => { console.log(42); })();
if (foo()) return;
})();
// Params.
(() => {
console.log(x);
})(5);
(function bar() {
console.log(x);
})(5);
// Arguments.
((x) => {
console.log(x);
})();
(function bar(x) {
console.log(x);
})();
// Call expressions with other types of callees.
foo();
foo[(() => { foo(); })()]();
[() => { foo(); }][0]();
// Sequence.
(() => { foo(); })(), (() => { foo(); })();

View File

@ -0,0 +1,132 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/* ClosureRemover: Transformed 14 closures. */
// Original: closures.js
let __v_0 = 0;
let __v_1 = 0;
const __v_6 = 1;
foo(__v_0 + __v_6);
const __v_7 = 1;
for (let __v_8 = 0; __v_8 < __v_7; __v_8++) {
foo(__v_7 + __v_1 + __v_8 + d);
}
const __v_9 = 1;
for (let __v_10 = 0; __v_10 < __v_0; __v_10++) {
foo(__v_0 + __v_9 + __v_10 + d);
}
const __v_11 = 1;
for (let __v_12 = 0; __v_12 < __v_11; __v_12++) {
foo(__v_11 + __v_1 + __v_12 + d);
}
const __v_13 = 1;
for (let __v_14 = 0; __v_14 < __v_0; __v_14++) {
foo(__v_0 + __v_13 + __v_14 + d);
}
this.a = 6;
const __v_15 = 1;
for (let __v_16 = 0; __v_16 < __v_15; __v_16++) {
foo(__v_15 + __v_1 + __v_16 + d);
}
const __v_17 = 1;
const __v_2 = 2;
var __v_18 = 1;
__v_19 = 2;
var __v_3 = 2;
var __v_20 = 1;
var __v_4 = 2;
__v_4 = 1;
let __v_21 = 1;
while (__v_1) {
__v_1 += __v_21;
}
(() => {
let __v_22 = 1;
return __v_22;
})();
(() => {
if (foo()) return 0;
})();
(function __f_4(__v_23 = () => {
return 0;
}) {
const __v_24 = () => {
return 0;
};
})(() => {
return 0;
});
(() => {
return () => {
return 0;
};
})();
(function () {})();
(function __f_5() {
const __v_25 = __f_5();
})();
(function () {
if (__v_1++ > 10) return;
console.log(42);
})();
(function () {
const __v_26 = 0;
return __v_26;
})();
(() => console.log(42))();
(async function () {
console.log(42);
})();
(function* () {
console.log(42);
})();
function __f_0() {
let __v_27 = 0;
}
const __v_5 = function __f_6() {
const __v_28 = 0;
};
{
(() => {
const __v_29 = 1;
})();
}
function __f_1() {
(() => {
const __v_30 = 1;
})();
}
(function () {
(() => {
console.log(42);
})();
(() => {
console.log(42);
})();
if (foo()) return;
})();
(() => {
console.log(x);
})(5);
(function __f_7() {
console.log(x);
})(5);
(__v_31 => {
console.log(__v_31);
})();
(function __f_8(__v_32) {
console.log(__v_32);
})();
foo();
foo[(() => {
foo();
})()]();
[() => {
foo();
}][0]();
(() => {
foo();
})(), (() => {
foo();
})();

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Fake file

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Fake file

View File

@ -0,0 +1,11 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
class __C {
foo() {
let __v_0 = 2;
let __v_1 = 2;
Math.pow(__v_0, __v_1);
}
}

View File

@ -0,0 +1,92 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let obj = {};
let v1 = 0;
let v2 = 0;
let v3 = 0;
// Contains statements that are extracted:
class A {
foo (){
Object.assign(obj, []);
}
}
class B extends A {
constructor(param) {
// Call.
super(param + 1);
}
foo() {
// Call.
super.valueOf();
// Update.
--super[v1];
}
}
// Valid assignments.
v3.p = 2;
v3.p = {
'something': 12345,
'large': 6789,
};
// Call.
Array.from(obj);
// Arrow-function.
(o=v1) => o + 1;
// Class (though this throws).
(class x extends x {});
// Logical.
v1 && v2();
// New.
new Set([...obj]);
// Sequence.
v1, v2;
// Tag template.
v3``;
// Just this.
this;
// Unary.
delete NaN;
// Update.
obj[5]++;
// Statements that are not extracted:
123;
-123;
v1;
v1 + v2;
[1, 2, 3];
obj[5];
obj[5] = 42;
obj["5"] = 42;
v3 = 1;
Array.from(v1, v2, v3);
obj = function (a){ return a; };
obj(5);
if (true) { 123; }
while (true) { 123; }
// TODO(machenbach): This should be valid in theory. Babel truncates the
// inner parentheses, the it becomes invalid. If we make this valid, however,
// we might wanna restrict the size and complexity as it might include a lot
// of test material.
(function (){ return 5; })();

View File

@ -0,0 +1,18 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Some more examples to test multiple input files.
// Contains statements that are extracted:
function foo() {
// Logical.
true || false;
}
// Statements that are not extracted:
function bar() {
unknown();
}

View File

@ -0,0 +1 @@
{"type":"CallExpression","source":"Array.from(VAR_0)","isStatement":true,"originalPath":"e2e/input1.js","dependencies":["VAR_0"],"needsSuper":false}

View File

@ -0,0 +1 @@
{"type":"CallExpression","source":"super(VAR_4 + 1)","isStatement":true,"originalPath":"e2e/input1.js","dependencies":["VAR_4"],"needsSuper":true}

View File

@ -0,0 +1 @@
{"type":"CallExpression","source":"Object.assign(VAR_0, [])","isStatement":true,"originalPath":"e2e/input1.js","dependencies":["VAR_0"],"needsSuper":false}

View File

@ -0,0 +1 @@
{"type":"CallExpression","source":"super.valueOf()","isStatement":true,"originalPath":"e2e/input1.js","needsSuper":true}

View File

@ -0,0 +1 @@
{"type":"ClassExpression","source":"class VAR_6 extends VAR_6 {}","isStatement":true,"originalPath":"e2e/input1.js","dependencies":["VAR_6","VAR_6"],"needsSuper":false}

View File

@ -0,0 +1 @@
{"type":"LogicalExpression","source":"true || false","isStatement":true,"originalPath":"e2e/input2.js","needsSuper":false}

View File

@ -0,0 +1 @@
{"type":"LogicalExpression","source":"VAR_1 && VAR_2()","isStatement":true,"originalPath":"e2e/input1.js","dependencies":["VAR_1","VAR_2"],"needsSuper":false}

View File

@ -0,0 +1 @@
{"type":"NewExpression","source":"new Set([...VAR_0])","isStatement":true,"originalPath":"e2e/input1.js","dependencies":["VAR_0"],"needsSuper":false}

View File

@ -0,0 +1 @@
{"type":"SequenceExpression","source":"VAR_1, VAR_2","isStatement":true,"originalPath":"e2e/input1.js","dependencies":["VAR_1","VAR_2"],"needsSuper":false}

View File

@ -0,0 +1 @@
{"type":"TaggedTemplateExpression","source":"VAR_3``","isStatement":true,"originalPath":"e2e/input1.js","dependencies":["VAR_3"],"needsSuper":false}

View File

@ -0,0 +1 @@
{"type":"ThisExpression","source":"this","isStatement":true,"originalPath":"e2e/input1.js","needsSuper":false}

View File

@ -0,0 +1 @@
{"type":"UnaryExpression","source":"delete NaN","isStatement":true,"originalPath":"e2e/input1.js","needsSuper":false}

View File

@ -0,0 +1 @@
{"type":"UpdateExpression","source":"--super[VAR_1]","isStatement":true,"originalPath":"e2e/input1.js","dependencies":["VAR_1"],"needsSuper":true}

View File

@ -0,0 +1 @@
{"type":"UpdateExpression","source":"VAR_0[5]++","isStatement":true,"originalPath":"e2e/input1.js","dependencies":["VAR_0"],"needsSuper":false}

View File

@ -0,0 +1 @@
{"statements":["CallExpression/1876a21afb7224a48ec53aa4436f4d93349c5fa0.json","CallExpression/877c27d1e4a8e5a959a7c12bbd6d08d6ba5e8b28.json","ClassExpression/32369494369ef66a7074b32fd6b27c588860b571.json","LogicalExpression/c5813b84d032ce3d569c58e7aabbc013bc17c487.json","LogicalExpression/cc45a134bf1ed0009f03b8931dc2157b53b97de1.json","NewExpression/0001aa3649d75f272d662a385e028a4d4f24a712.json","SequenceExpression/92059b515fdaaf897409c544d19fec01b7c677f5.json","TaggedTemplateExpression/93c7959bebf4148eab01ad9187a3390f6b127e23.json","ThisExpression/c2543fff3bfa6f144c2f06a7de6cd10c0b650cae.json","UnaryExpression/3b59bddfed6319031112411ec0633c4e423ae460.json","UpdateExpression/9822c139a3406842de5446673fdd2613c4e6ca00.json"],"superStatements":["CallExpression/76c7c68f689d7eb9fd7e9d42e98d92a3bd11d4f3.json","CallExpression/9a863bdec092babc502181f10470c11643c66aa9.json","UpdateExpression/62f296654616254793e9c1948c12a2951e711156.json"],"all":["CallExpression/1876a21afb7224a48ec53aa4436f4d93349c5fa0.json","CallExpression/76c7c68f689d7eb9fd7e9d42e98d92a3bd11d4f3.json","CallExpression/877c27d1e4a8e5a959a7c12bbd6d08d6ba5e8b28.json","CallExpression/9a863bdec092babc502181f10470c11643c66aa9.json","ClassExpression/32369494369ef66a7074b32fd6b27c588860b571.json","LogicalExpression/c5813b84d032ce3d569c58e7aabbc013bc17c487.json","LogicalExpression/cc45a134bf1ed0009f03b8931dc2157b53b97de1.json","NewExpression/0001aa3649d75f272d662a385e028a4d4f24a712.json","SequenceExpression/92059b515fdaaf897409c544d19fec01b7c677f5.json","TaggedTemplateExpression/93c7959bebf4148eab01ad9187a3390f6b127e23.json","ThisExpression/c2543fff3bfa6f144c2f06a7de6cd10c0b650cae.json","UnaryExpression/3b59bddfed6319031112411ec0633c4e423ae460.json","UpdateExpression/62f296654616254793e9c1948c12a2951e711156.json","UpdateExpression/9822c139a3406842de5446673fdd2613c4e6ca00.json"]}

View File

@ -0,0 +1,9 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function C() {
this.c = "c";
}
var c = new C();

View File

@ -0,0 +1,48 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
} catch (e) {}
print("v8-foozzie source: v8/differential_fuzz/input1.js");
// Original: v8/differential_fuzz/input1.js
try {
var __v_0 = 0;
} catch (e) {}
try {
/* DifferentialFuzzMutator: Pretty printing */__prettyPrintExtra(__v_0);
} catch (e) {}
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
__prettyPrint(__v_0);
} catch (e) {}
print("v8-foozzie source: v8/differential_fuzz/input2.js");
// Original: v8/differential_fuzz/input2.js
let __v_1 = 1;
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
__prettyPrint(__v_0);
__prettyPrint(__v_1);
} catch (e) {}

View File

@ -0,0 +1,8 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
try {
let __v_0 = boom;
} catch (e) {}

View File

@ -0,0 +1,15 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: differential_fuzz/exceptions.js
try {
let __v_0 = boom;
} catch (e) {
__caught++;
}
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
} catch (e) {}

View File

@ -0,0 +1,7 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file represents anything loaded from the resources directory.
print("I'm a resource.");

View File

@ -0,0 +1,44 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
} catch (e) {}
print("v8-foozzie source: v8/differential_fuzz/input2.js");
// Original: v8/differential_fuzz/input2.js
let __v_0 = 1;
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
__prettyPrint(__v_0);
} catch (e) {}
print("v8-foozzie source: fuzzilli_source");
// Original: fuzzilli/fuzzdir-1/corpus/program_1.js
try {
console.log(42);
} catch (e) {}
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
__prettyPrint(__v_0);
} catch (e) {}

View File

@ -0,0 +1,26 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Print after declaration.
var __v_0 = [1, 2, 3];
// Don't print after declarations or assigments in loops.
for (let __v_1 = 0; __v_1 < 3; __v_1 += 1) {
// Print after multiple declarations.
let __v_2, __v_3 = 0;
// Print after assigning to member.
__v_0.foo = undefined;
// Replace with deep printing.
print(0);
// Print exception.
try {
// Print after assignment.
__v_1 += 1;
} catch(e) {}
}

View File

@ -0,0 +1,32 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: differential_fuzz/mutations.js
var __v_0 = [1, 2, 3];
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_0);
for (let __v_1 = 0; __v_1 < 3; __v_1 += 1) {
let __v_2,
__v_3 = 0;
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_2);
__prettyPrintExtra(__v_3);
__v_0.foo = undefined;
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_0);
/* DifferentialFuzzMutator: Pretty printing */__prettyPrintExtra(0);
try {
__v_1 += 1;
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_1);
} catch (e) {
__prettyPrintExtra(e);
}
}
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
__prettyPrint(__v_0);
} catch (e) {}

View File

@ -0,0 +1,15 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// These statements might come from a CrashTest.
print("v8-foozzie source: some/file/name");
print('v8-foozzie source: some/file/name');
function foo(__v_0) {
// This is an unsupported language feature.
return 1 in foo.arguments;
}
// This leads to precision differences in optimized code.
print(192 ** -0.5);

View File

@ -0,0 +1,11 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: differential_fuzz/suppressions.js
print(/* DifferentialFuzzSuppressions: Replaced magic string */"v***************e: some/file/name");
print(/* DifferentialFuzzSuppressions: Replaced magic string */"v***************e: some/file/name");
function foo(__v_0) {
return 1 in /* DifferentialFuzzSuppressions: Replaced .arguments */__v_0;
}
print(/* DifferentialFuzzSuppressions: Replaced ** */192 + -0.5);

View File

@ -0,0 +1,3 @@
[
[100, "ignition", "ignition_turbo", "d8"]
]

View File

@ -0,0 +1,3 @@
[
[1.0, "--foo1 --foo2"]
]

View File

@ -0,0 +1,43 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
} catch (e) {}
print("v8-foozzie source: fuzzilli_source");
// Original: fuzzilli/fuzzdir-2/corpus/program_2.js
let __v_0 = 0;
if (Math.random() > 0.5) {
let __v_1 = "";
__v_0++;
if (__v_0) {
const __v_2 = 0;
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_2);
__v_1 = __v_2 + "";
__v_1 = __v_2 + "";
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_1);
__v_1 = __v_2 + "";
__v_0 = __v_1;
__v_0 = __v_1;
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_0);
__v_0 = __v_1;
}
}
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
__prettyPrint(__v_0);
} catch (e) {}

View File

@ -0,0 +1,40 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
} catch (e) {}
print("v8-foozzie source: fuzzilli_source");
// Original: fuzzilli/fuzzdir-2/corpus/program_3.js
try {
boom;
} catch (__v_0) {}
try {
boom;
} catch (__v_1) {
__caught++;
}
try {
boom;
} catch (__v_2) {
__caught++;
}
try {
boom;
} catch (__v_3) {
__caught++;
}
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
} catch (e) {}

View File

@ -0,0 +1,62 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
} catch (e) {}
print("v8-foozzie source: fuzzilli_source");
// Original: fuzzilli/fuzzdir-1/corpus/program_3.js
let __v_0 = {
a: 1,
b: 2
};
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_0);
const __v_1 = 29234234234234;
function __f_0(__v_2) {
let __v_3 = __v_2 + 5;
let __v_4 = dummy;
let __v_5 = dummy;
try {
__v_2++;
__v_4 = __v_5;
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_4);
__v_5.prop = {};
__v_5.prop = {};
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_5);
__v_5.prop = {};
__v_5.prop = {};
__v_5.prop = {};
} catch (__v_6) {
__v_2 = __v_3;
/* DifferentialFuzzMutator: Extra variable printing */
__prettyPrintExtra(__v_2);
}
return {
a: __v_2,
b: __v_2,
c: __v_0
};
}
%PrepareFunctionForOptimization(__f_0);
__f_0(__v_1);
%OptimizeFunctionOnNextCall(__f_0);
__f_0(__v_0.a);
/* DifferentialFuzzMutator: Print variables and exceptions from section */
try {
print("Hash: " + __hash);
print("Caught: " + __caught);
__prettyPrint(__v_0);
__prettyPrint(__v_1);
} catch (e) {}

View File

@ -0,0 +1,11 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
"--first-config=ignition",
"--second-config=ignition_turbo",
"--second-d8=d8",
"--second-config-extra-flags=--foo1",
"--second-config-extra-flags=--foo2"
]

View File

@ -0,0 +1,11 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
"--first-config=ignition",
"--second-config=ignition_turbo",
"--second-d8=d8",
"--second-config-extra-flags=--foo1",
"--second-config-extra-flags=--foo2"
]

View File

@ -0,0 +1,11 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
"--first-config=ignition",
"--second-config=ignition_turbo",
"--second-d8=d8",
"--second-config-extra-flags=--foo1",
"--second-config-extra-flags=--foo2"
]

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
console.log(42);

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
console.log(42);

View File

@ -0,0 +1,27 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let v1 = {a: 1, b: 2};
const v2 = 29234234234234;
function foo(val) {
let v3 = val + 5;
let v4 = dummy;
let v5 = dummy;
try {
val++;
v4 = v5;
v5.prop = {};
v5.prop = {};
v5.prop = {};
v5.prop = {};
v5.prop = {};
} catch(e) { val = v3; }
return {a: val, b: val, c: v1};
}
%PrepareFunctionForOptimization(foo);
foo(v2);
%OptimizeFunctionOnNextCall(foo);
foo(v1.a);

View File

@ -0,0 +1,9 @@
{
"processArguments": [
"--expose-gc",
"--fuzzing",
"--fuzzilli-flag1",
"--random-seed=123",
"--fuzzilli-flag2"
]
}

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
console.log(42);

View File

@ -0,0 +1,19 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let v1 = 0;
if (Math.random() > 0.5) {
let v2 = "";
v1++;
if (v1) {
const v3 = 0;
v2 = v3 + "";
v2 = v3 + "";
v2 = v3 + "";
v1 = v2;
v1 = v2;
v1 = v2;
}
}

View File

@ -0,0 +1,19 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
try {
boom;
} catch(e) {}
try {
boom;
} catch(e) {}
try {
boom;
} catch(e) {}
try {
boom;
} catch(e) {}

View File

@ -0,0 +1,9 @@
{
"processArguments": [
"--expose-gc",
"--fuzzing",
"--fuzzilli-flag1",
"--random-seed=123",
"--fuzzilli-flag2"
]
}

View File

@ -0,0 +1,3 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-feature1 --future

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --future --js-feature2 --js-staging

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-feature1 --future

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --future --js-feature1

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --future --js-staging

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
console.log(42);

View File

@ -0,0 +1,9 @@
{
"processArguments": [
"--expose-gc",
"--fuzzing",
"--fuzzilli-flag1",
"--random-seed=123",
"--fuzzilli-flag2"
]
}

View File

@ -0,0 +1,5 @@
// Copyright 2024 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
print("test");

View File

@ -0,0 +1,5 @@
// Copyright 2024 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
print("test");

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
print("test");

View File

@ -0,0 +1,5 @@
// Copyright 2024 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
print("test");

View File

@ -0,0 +1,5 @@
// Copyright 2024 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
print("test");

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
console.log(42);

View File

@ -0,0 +1,3 @@
{
"processArguments": []
}

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
console.log(43);

View File

@ -0,0 +1,7 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
console.log(42);

View File

@ -0,0 +1,3 @@
{
"processArguments": []
}

View File

@ -0,0 +1,5 @@
// Copyright 2024 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
print("test");

View File

@ -0,0 +1,5 @@
// Copyright 2024 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
print("test");

View File

@ -0,0 +1,7 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
console.log(42);

View File

@ -0,0 +1,7 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
console.log(42);

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
console.log("Wasm module builder");

View File

@ -0,0 +1,201 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// *********************************** ES2016
(() => {
// Exponentiation operator
let v = 2 ** 2;
v **= 3;
})();
// *********************************** ES2018
(() => {
// Async generators
async function* foo1() {
await 42;
yield 0;
}
async function foo2() {
for await (let a of b) {
bar1(x);
}
}
})();
(() => {
// Dotall regexp
/./s;
/./su;
})();
(() => {
// Named capturing groups regex
let v = /(?<month>\d{2})-(?<day>\d{2})/;
v.exec("11-11").groups.month;
})();
(() => {
// Rest
let { a, ...b } = { x: 1, y: 2, z: 3 };
// Spread
let v = { a, ...b };
})();
// *********************************** ES2019
(() => {
// Optional catch binding
try {
throw 0;
} catch {
foo();
} finally {
bar();
}
})();
(() => {
// Json strings - here: "a\u2028b"
"a
b";
})();
// *********************************** ES2020
(() => {
// BigInts
let v1 = 6n;
let v2 = BigInt(1234546) + v1;
let v3 = 0b1000011n;
})();
(() => {
// Nullish coalescing operator
object.foo ?? "42";
})();
(() => {
// Optional chaining
const obj = {
foo: {
bar: 42,
},
};
obj?.foo?.bar;
obj?.meh?.bar;
obj?.meh?.bar();
})();
// *********************************** ES2021
(() => {
// Numeric separator
let v1 = 1_000_000_000_000;
let v2 = 0b1010_0001;
})();
(() => {
// Logical assignment operators
let v = false;
v ||= true;
})();
// *********************************** ES2022
(() => {
// Private methods and properties
// Private property in object
class Foo {
#xValue = 0;
get #x() {
return this.#xValue;
}
set #x(value) {
this.#xValue = value;
}
#inc() {
this.#x++;
}
baz(obj) {
return #xValue in obj;
}
}
})();
(() => {
// Class properties
class Foo {
prop = "42";
fun = () => {
return this.prop;
};
static staticProp = "42";
static staticFun = function() {
return Foo2.staticProp;
};
}
})();
(() => {
// Class static block
class Foo {
static #a = 42;
static b;
static {
this.b = bar(this.#a);
}
}
})();
// *********************************** ES2024
(() => {
// Unicode sets regex
/[\p{Decimal_Number}&&\p{ASCII}]/v;
})();
// *********************************** ES2025
(() => {
// Duplicate named capturing groups regex
let v = /(?<month>\d{2})-(?<year>\d{4})|(?<year>\d{4})-(?<month>\d{2})/;
v.exec("11-1111").groups.year;
})();
(() => {
// Regexp modifiers
/(?i:a)a/;
/(?m:^a)a/;
/(?s:.)./;
/(?im:^a)a/;
})();
// *********************************** Proposals
(() => {
// Do expressions
let v = do {
if (v) {
("1");
} else {
("2");
}
};
})();
(() => {
// Explicit resource management
async function foo() {
using sync = openSync();
await using async = await openAsync();
}
})();

View File

@ -0,0 +1,146 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: language/features.js
(() => {
let v = 2 ** 2;
v **= 3;
})();
(() => {
async function* foo1() {
await 42;
yield 0;
}
async function foo2() {
for await (let a of b) {
bar1(x);
}
}
})();
(() => {
/./s;
/./su;
})();
(() => {
let v = /(?<month>\d{2})-(?<day>\d{2})/;
v.exec("11-11").groups.month;
})();
(() => {
let {
a,
...b
} = {
x: 1,
y: 2,
z: 3
};
let v = {
a,
...b
};
})();
(() => {
try {
throw 0;
} catch {
foo();
} finally {
bar();
}
})();
(() => {
"a
b";
})();
(() => {
let v1 = 6n;
let v2 = BigInt(1234546) + v1;
let v3 = 0b1000011n;
})();
(() => {
object.foo ?? "42";
})();
(() => {
const obj = {
foo: {
bar: 42
}
};
obj?.foo?.bar;
obj?.meh?.bar;
obj?.meh?.bar();
})();
(() => {
let v1 = 1_000_000_000_000;
let v2 = 0b1010_0001;
})();
(() => {
let v = false;
v ||= true;
})();
(() => {
class Foo {
#xValue = 0;
get #x() {
return this.#xValue;
}
set #x(value) {
this.#xValue = value;
}
#inc() {
this.#x++;
}
baz(obj) {
return #xValue in obj;
}
}
})();
(() => {
class Foo {
prop = "42";
fun = () => {
return this.prop;
};
static staticProp = "42";
static staticFun = function () {
return Foo2.staticProp;
};
}
})();
(() => {
class Foo {
static #a = 42;
static b;
static {
this.b = bar(this.#a);
}
}
})();
(() => {
/[\p{Decimal_Number}&&\p{ASCII}]/v;
})();
(() => {
let v = /(?<month>\d{2})-(?<year>\d{4})|(?<year>\d{4})-(?<month>\d{2})/;
v.exec("11-1111").groups.year;
})();
(() => {
/(?i:a)a/;
/(?m:^a)a/;
/(?s:.)./;
/(?im:^a)a/;
})();
(() => {
let v = do {
if (v) {
"1";
} else {
"2";
}
};
})();
(() => {
async function foo() {
using sync = openSync();
await using async = await openAsync();
}
})();

View File

@ -0,0 +1,120 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// For-loop examples that we approximate as either large or small.
// Large loops that we'll determine as large:
for (const a = 0; a < 10000; a++) {
console.log("Large1");
}
for (const a = 0; a < 1e3; a++) {
console.log("Large2");
}
for (const a = -0.01e7; a < 0.01e7; a++) {
console.log("Large3");
}
for (const a = 0; 10000 >= a; a++) {
console.log("Large4");
}
for (const a = 1000; a != 0; a--) {
console.log("Large5");
}
for (const a = 1e3; 0 != a; a--) {
console.log("Large6");
}
for (const a = 29303.34; 124.2 != a; a -= 0.7) {
console.log("Large7");
}
for (const a = 0n; a < 3000000000000n; a++) {
console.log("Large8");
}
// Test that we internally don't make a mixed bigint/non-bigint computation.
for (const a = 0; a < 30000000000000000000000000n; a++) {
console.log("Large10");
}
// Not really large, but we still approximate it as large:
for (const a = 0; a < 10000; a += 1000) {
console.log("Large11");
}
// Small loops that we'll determine as small:
for (const a = 0; a < 10; a++) {
console.log("Small1");
}
for (const a = 0; a < 999; a++) {
console.log("Small2");
}
for (const a = 3; 0 != a; a--) {
console.log("Small3");
}
for (const a = 10000; a > 9100; a--) {
console.log("Small4");
}
// Large loops that we can't determine, so we approximate them
// as small.
const b = 10000;
for (const a = b; a > 0; a--) {
console.log("Small5");
}
for (const a = 10000, b = 10000; a > 0; a--) {
console.log("Small6");
}
const c = 0;
for (const a = 10000; a > c; a--) {
console.log("Small7");
}
for (const a = 10000; a > 0 && other; a--) {
console.log("Small8");
}
// Types and structures that we can't determine, hence small.
for (var str = "start"; str < "end"; str += "inc") {
console.log("Small9");
}
for (let a = []; a < [0, 1, 2]; a += [0]) {
console.log("Small10");
}
for (let {a} = 123; a < 10000; a++) {
console.log("Small11");
}
for (let a = !1; a < 10000; a++) {
console.log("Small12");
}
// Other stuff for code coverage.
let d = 0
for (; d < 10000; d++) {
console.log("Small13");
}
for (let a = 0;;) {
console.log("Small14");
}
for (;;) {
console.log("Small15");
}
for (call();call();call()) {
console.log("Small16");
}

View File

@ -0,0 +1,36 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{
"large": [
"Large1",
"Large2",
"Large3",
"Large4",
"Large5",
"Large6",
"Large7",
"Large8",
"Large10",
"Large11"
],
"small": [
"Small1",
"Small2",
"Small3",
"Small4",
"Small5",
"Small6",
"Small7",
"Small8",
"Small9",
"Small10",
"Small11",
"Small12",
"Small13",
"Small14",
"Small15",
"Small16"
]
}

View File

@ -0,0 +1,9 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Attempts to explicitly load mjsunit should be ignored.
d8.file.execute("test/mjsunit/mjsunit.js");
// This code should be inlined.
d8.file.execute("test/mjsunit/wmb.js");

View File

@ -0,0 +1,9 @@
{
"processArguments": [
"--expose-gc",
"--fuzzing",
"--fuzzilli-flag1",
"--random-seed=123",
"--fuzzilli-flag2"
]
}

View File

@ -0,0 +1,6 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: v8/test/mjsunit/wmb.js
var wmb = 'WMB';

View File

@ -0,0 +1,5 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var wmb = 'WMB';

View File

@ -0,0 +1,50 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let a = 0;
let b = 0;
for (const a = 0; a < 10000; a++) {
console.log(a);
console.log(b);
b = a;
b = a;
b = a;
a = b;
a = b;
a = b;
f(a);
}
let c = 0;
while(true) {
if (c++ < 10) break;
console.log(c);
a = a + c;
a = a + c;
a = a + c;
}
let d = 0;
while(d < 10) {
if (f()) break;
}
let e = 0;
let f = true;
do console.log(e); while (f);
const g = 10;
for (const i = g; i > 0; i--) {
console.log(i);
console.log(g);
if (strange) {
i = g;
i = g;
i = g;
}
}
console.log(a);
console.log(g);

View File

@ -0,0 +1,58 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
// Original: differential_fuzz/fake_resource.js
print("I'm a resource.");
/* ClosureRemover: Transformed 0 closures. */
// Original: loop_mutations.js
let __v_0 = 0;
let __v_1 = 0;
for (const __v_7 = 0; __v_7 < 10000; __v_7++) {
console.log(/* VariableMutator: Replaced __v_7 with __v_7 */__v_7);
console.log(/* VariableMutator: Replaced __v_1 with __v_7 */__v_7);
__v_1 = /* VariableMutator: Replaced __v_7 with __v_7 */__v_7;
__v_1 = /* VariableMutator: Replaced __v_7 with __v_7 */__v_7;
__v_1 = /* VariableMutator: Replaced __v_7 with __v_7 */__v_7;
__v_7 = __v_1;
__v_7 = __v_1;
__v_7 = __v_1;
/* VariableMutator: Replaced __v_5 with __v_7 */__v_7(/* VariableMutator: Replaced __v_7 with __v_7 */__v_7);
}
let __v_2 = 0;
while (true) {
if (__v_2++ < 10) break;
console.log(__v_2);
__v_0 = __v_0 + __v_2;
__v_0 = __v_0 + __v_2;
__v_0 = __v_0 + __v_2;
}
let __v_3 = 0;
while (__v_3 < 10) {
if (__v_5()) break;
}
let __v_4 = 0;
let __v_5 = true;
do {
console.log(__v_4);
} while (/* VariableMutator: Replaced __v_5 with __v_4 */__v_4);
const __v_6 = 10;
for (const __v_8 = __v_6; __v_8 > 0; __v_8--) {
console.log(/* VariableMutator: Replaced __v_8 with __v_8 */__v_8);
console.log(/* VariableMutator: Replaced __v_6 with __v_8 */__v_8);
if (strange) {
__v_8 = __v_6;
__v_8 = __v_6;
__v_8 = __v_6;
}
}
console.log(/* VariableMutator: Replaced __v_0 with __v_3 */__v_3);
/* VariableOrObjectMutator: Random mutation */
__v_4 = __v_6, __callGC(false);
/* VariableOrObjectMutator: Random mutation */
__v_0 = __v_1;
console.log(/* VariableMutator: Replaced __v_6 with __v_3 */__v_3);

View File

@ -0,0 +1,58 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Test data to determine loop variables and differentiate them from
// non-loop variables. The data explores:
// - three loop statements
// - nested loops
// - nested block statements in loops to test the stack
// - complex loop-test expressions
// - non-variable identifiers in loop tests
// - various variables outside of loop tests
let a = 0;
function __f_0(b, c) {
for (const d = b; d < 10000; d++) {
console.log(c);
}
}
let e = false;
{
let f = 10;
while(something) {
a++;
if (a > 5) break;
}
let g = "";
do {
g + "...";
} while (call() || e > 0);
console.log(g);
}
let h = 0;
let i = 0;
let j = 0;
let k = 0;
while (call(h)) {
console.log(i);
h = i;
try {
for (; j < 2; j++) {
{
console.log(k);
}
}
} catch(e) {}
k++;
}
let l = 10000;
let m = "foo";
while(l-- > 0) console.log(m);

View File

@ -0,0 +1,12 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
"__v_10",
"__v_8",
"__v_1",
"__v_2",
"__v_4",
"__v_6"
]

View File

@ -0,0 +1,45 @@
// Copyright 2025 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original: loop_variables.js
let __v_0 = 0;
function __f_0(__v_8, __v_9) {
for (const __v_10 = __v_8; __v_10 < 10000; __v_10++) {
console.log(__v_9);
}
}
let __v_1 = false;
{
let __v_11 = 10;
while (something) {
__v_0++;
if (__v_0 > 5) break;
}
let __v_12 = "";
do {
__v_12 + "...";
} while (call() || __v_1 > 0);
console.log(__v_12);
}
let __v_2 = 0;
let __v_3 = 0;
let __v_4 = 0;
let __v_5 = 0;
while (call(__v_2)) {
console.log(__v_3);
__v_2 = __v_3;
try {
for (; __v_4 < 2; __v_4++) {
{
console.log(__v_5);
}
}
} catch (__v_13) {}
__v_5++;
}
let __v_6 = 10000;
let __v_7 = "foo";
while (__v_6-- > 0) {
console.log(__v_7);
}

Some files were not shown because too many files have changed in this diff Show More