Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Oct 25, 2024
2 parents 09e6084 + 96471cc commit 8f32e9e
Show file tree
Hide file tree
Showing 4,366 changed files with 251,612 additions and 942,791 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
10 changes: 10 additions & 0 deletions .submitproject
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
[submitproject "filter"]
includedSubdirectoryPatterns = Configurations/
includedSubdirectoryPatterns = Source/
includedSubdirectoryPatterns = WebKitLibraries/SDKs/*.internal-additions.sdk/
excludedSubdirectoryPatterns = Source/ThirdParty/libwebrtc/Source/third_party/boringssl/src/util
excludedSubdirectoryPatterns = Source/ThirdParty/libwebrtc/Source/webrtc/examples
excludedSubdirectoryPatterns = Source/ThirdParty/capstone
excludedSubdirectoryPatterns = Source/ThirdParty/d3flamegraphjs
excludedSubdirectoryPatterns = Source/ThirdParty/d3js
excludedSubdirectoryPatterns = Source/ThirdParty/gmock
excludedSubdirectoryPatterns = Source/ThirdParty/gtest
excludedSubdirectoryPatterns = Source/ThirdParty/libsysprof-capture
excludedSubdirectoryPatterns = Source/ThirdParty/qunit
excludedSubdirectoryPatterns = Source/ThirdParty/skia
excludedSubdirectoryPatterns = Source/ThirdParty/unifdef
excludedSubdirectoryPatterns = Source/ThirdParty/xdgmime
[submitproject "gitmodules"]
enabled = false
7 changes: 7 additions & 0 deletions .submitproject-tools
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[submitproject "filter"]
includedSubdirectoryPatterns = Tools/DumpRenderTree
includedSubdirectoryPatterns = Tools/ImageDiff
includedSubdirectoryPatterns = Tools/MiniBrowser
includedSubdirectoryPatterns = Tools/TestRunnerShared
includedSubdirectoryPatterns = Tools/WebKitTestRunner
excludedSubdirectoryPatterns = Tools/WebKitTestRunner/gtk
2 changes: 1 addition & 1 deletion Configurations/Version.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

MAJOR_VERSION = 621;
MINOR_VERSION = 1;
TINY_VERSION = 4;
TINY_VERSION = 5;
MICRO_VERSION = 0;
NANO_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(TINY_VERSION);
Expand Down
1 change: 1 addition & 0 deletions Configurations/WebKitProjectPaths.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,5 @@ WEBKIT_FRAMEWORKS_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_YES = $(WK_OVERRIDE_FRAMEWORKS
WEBKITADDITIONS_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/WebKitAdditions $(SDK_DIR)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/WebKitAdditions;
ANGLE_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)$(WK_ALTERNATE_FRAMEWORKS_DIR)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/ $(SDK_DIR)$(WK_ALTERNATE_WEBKIT_SDK_PATH)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/;
LIBWEBRTC_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/webrtc $(SDK_DIR)$(WK_ALTERNATE_WEBKIT_SDK_PATH)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/webrtc;
LIBWEBM_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/webm $(SDK_DIR)$(WK_ALTERNATE_WEBKIT_SDK_PATH)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/webm;
WEBGPU_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/pal/graphics/WebGPU $(SDK_DIR)$(WK_ALTERNATE_FRAMEWORKS_DIR)$(WK_LIBRARY_HEADERS_FOLDER_PATH)/pal/graphics/WebGPU;
12 changes: 12 additions & 0 deletions JSTests/microbenchmarks/global-atom-match-multi-chars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

function test(str, regexp) {
str.match(regexp);
}
noInline(test);

let str = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
let regexp = /aaaaa/g;
for (let i = 0; i < 1e4; i++) {
test(str, regexp);
}

12 changes: 12 additions & 0 deletions JSTests/microbenchmarks/global-atom-match-one-char.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

function test(str, regexp) {
str.match(regexp);
}
noInline(test);

let str = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
let regexp = /a/g;
for (let i = 0; i < 1e4; i++) {
test(str, regexp);
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ let regexp = /aaaaaaaaaa/g;
for (let i = 0; i < 1e4; i++) {
test(str, regexp);
}

13 changes: 13 additions & 0 deletions JSTests/microbenchmarks/global-atom-substring-match-one-char.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

function test(str, regexp) {
str.substring(0, 50).match(regexp);
str.substring(0, 60).match(regexp);
}
noInline(test);

let str = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
let regexp = /\n/g;
for (let i = 0; i < 1e4; i++) {
test(str, regexp);
}

2 changes: 1 addition & 1 deletion JSTests/stress/in-by-val-profile.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions JSTests/stress/intl-durationformat-limits.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
function shouldThrow(op, errorConstructor) {
try {
op();
} catch (e) {
if (!(e instanceof errorConstructor)) {
throw new Error(`threw ${e}, but should have thrown ${errorConstructor.name}`);
}
return;
}
throw new Error(`Expected to throw ${errorConstructor.name}, but no exception thrown`);
}

const df = new Intl.DurationFormat();

{
const invalidValues = [
2**32,
2**32 + 1,
Number.MAX_SAFE_INTEGER,
Number.MAX_VALUE,
];
for (const v of invalidValues) {
shouldThrow(() => { df.format({ years: v }); }, RangeError);
shouldThrow(() => { df.format({ months: v }); }, RangeError);
shouldThrow(() => { df.format({ weeks: v }); }, RangeError);
}
}

{
shouldThrow(() => { df.format({ days: Math.ceil((Number.MAX_SAFE_INTEGER + 1) / 86400) }); }, RangeError)
shouldThrow(() => { df.format({ hours: Math.ceil((Number.MAX_SAFE_INTEGER + 1) / 3600) }) }, RangeError);
shouldThrow(() => { df.format({ minutes: Math.ceil((Number.MAX_SAFE_INTEGER + 1) / 60) }) }, RangeError);
shouldThrow(() => { df.format({ seconds: Number.MAX_SAFE_INTEGER + 1 }) }, RangeError);
shouldThrow(() => { df.format({ milliseconds: (Number.MAX_SAFE_INTEGER + 1) * 1e3 }) }, RangeError);
shouldThrow(() => { df.format({ milliseconds: 9007199254740992_000 }) }, RangeError);
shouldThrow(() => { df.format({ microseconds: (Number.MAX_SAFE_INTEGER + 1) * 1e6 }) }, RangeError);
shouldThrow(() => { df.format({ microseconds: 9007199254740992_000_000 }) }, RangeError);
shouldThrow(() => { df.format({ nanoseconds: (Number.MAX_SAFE_INTEGER + 1) * 1e9 }) }, RangeError);
shouldThrow(() => { df.format({ nanoseconds: 9007199254740992_000_000_000 }) }, RangeError);
}
41 changes: 41 additions & 0 deletions JSTests/stress/intl-durationformat-rounding-errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
function sameValue(actual, expected) {
if (actual !== expected)
throw new Error(`Expected ${expected} but got ${actual}`);
}

{
// This is calculated as 9.123456788999999 in double
const duration = {
seconds: 9,
milliseconds: 123,
microseconds: 456,
nanoseconds: 789,
};

const df = new Intl.DurationFormat('en', { style: "digital" });
sameValue(df.format(duration), "0:00:09.123456789");
}

{
// This is calculated as 10000000.000000002 in double
const duration = {
seconds: 10_000_000,
nanoseconds: 1,
};

const df = new Intl.DurationFormat('en', { style: "digital" });
sameValue(df.format(duration), "0:00:10,000,000.000000001");
}

{
// This is calculated as 0:00:9,007,199,254,740,992 in double
const duration = {
// Actual value is: 4503599627370497024
milliseconds: 4503599627370497_000,
// Actual value is: 4503599627370494951424
microseconds: 4503599627370495_000000,
};

const df = new Intl.DurationFormat('en', { style: 'digital' });
sameValue(df.format(duration), '0:00:9,007,199,254,740,991.975424');
}
42 changes: 42 additions & 0 deletions JSTests/stress/iterator-concat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//@ requireOptions("--useIteratorHelpers=1", "--useIteratorSequencing=1")

function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`FAIL: expected '${expected}' actual '${actual}'`);
}

function shouldBeArray(actual, expected) {
shouldBe(actual.length, expected.length);
for (let i = 0; i < expected.length; ++i)
shouldBe(actual[i], expected[i]);
}

function shouldThrow(callback, errorConstructor) {
try {
callback();
} catch (e) {
shouldBe(e instanceof errorConstructor, true);
return
}
throw new Error('FAIL: should have thrown');
}

shouldBeArray(Array.from(Iterator.concat([1, 2, 3, 4, 5, 6])), [1, 2, 3, 4, 5, 6]);
shouldBeArray(Array.from(Iterator.concat([1, 2], [3, 4], [5, 6])), [1, 2, 3, 4, 5, 6]);
shouldBeArray(Array.from(Iterator.concat([], [1], [], [2], [], [3], [], [4], [], [5], [], [6], [])), [1, 2, 3, 4, 5, 6]);

const customIterable = {
[Symbol.iterator]() {
return [1, 2, 3][Symbol.iterator]();
},
};
shouldBeArray(Array.from(Iterator.concat(customIterable, ["abc"], customIterable)), [1, 2, 3, "abc", 1, 2, 3]);

const nonIterableArray = [];
nonIterableArray[Symbol.iterator] = undefined;

for (let invalid of [undefined, null, false, true, 42, "abc", {}, nonIterableArray]) {
shouldThrow(() => {
Iterator.concat(invalid);
}, TypeError);
}
171 changes: 171 additions & 0 deletions JSTests/stress/iterator-prototype-chunks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
//@ requireOptions("--useIteratorHelpers=1", "--useIteratorChunking=1")

function assert(a, text) {
if (!a)
throw new Error(`Failed assertion: ${text}`);
}

function sameValue(a, b) {
if (a !== b)
throw new Error(`Expected ${b} but got ${a}`);
}

function sameArray(a, b) {
sameValue(JSON.stringify(a), JSON.stringify(b));
}

function shouldThrow(fn, error, message) {
try {
fn();
throw new Error('Expected to throw, but succeeded');
} catch (e) {
if (!(e instanceof error))
throw new Error(`Expected to throw ${error.name} but got ${e.name}`);
if (e.message !== message)
throw new Error(`Expected ${error.name} with '${message}' but got '${e.message}'`);
}
}

{
class Iter extends Iterator {
i = 1;
next() {
if (this.i > 5)
return { value: this.i, done: true }
return { value: this.i++, done: false }
}
}
const iter = new Iter();
const result = Array.from(iter.chunks(1));
sameArray(result, [[1], [2], [3], [4], [5]]);
}

{
const iter = {
i: 1,
next() {
if (this.i > 5)
return { value: this.i, done: true }
return { value: this.i++, done: false }
},
};
const result = Array.from(Iterator.prototype.chunks.call(iter, 2));
sameArray(result, [[1, 2], [3, 4], [5]]);
}

{
let nextGetCount = 0;
class Iter extends Iterator {
get next() {
nextGetCount++;
let i = 1;
return function() {
if (i > 5)
return { value: i, done: true }
return { value: i++, done: false }
}
};
};
const iter = new Iter();
sameValue(nextGetCount, 0);
const result = Array.from(iter.chunks(3));
sameValue(nextGetCount, 1);
sameArray(result, [[1, 2, 3], [4, 5]]);
}

{
function* gen() {
yield 1;
yield 2;
yield 3;
yield 4;
yield 5;
}
const iter = gen();
const result = Array.from(iter.chunks(4));
sameArray(result, [[1, 2, 3, 4], [5]]);
}

{
const arr = [1, 2, 3, 4, 5];
const iter = arr[Symbol.iterator]();
assert(iter.chunks === Iterator.prototype.chunks);
const result = Array.from(iter.chunks(5));
sameArray(result, [[1, 2, 3, 4, 5]]);
}

{
const arr = [1, 2, 3, 4, 5];
const iter = arr[Symbol.iterator]();
assert(iter.chunks === Iterator.prototype.chunks);
const result = Array.from(iter.chunks(6));
sameArray(result, [[1, 2, 3, 4, 5]]);
}

{
const arr = [1, 2, 3, 4, 5];
const iter = arr[Symbol.iterator]();
assert(iter.chunks === Iterator.prototype.chunks);
const chunks = iter.chunks(2);
const result1 = chunks.next().value;
sameArray(result1, [1, 2]);
result1.pop();
sameArray(result1, [1]);
const result2 = chunks.next().value;
sameArray(result2, [3, 4]);
result2.pop();
sameArray(result2, [3]);
assert(result1 !== result2);
const result3 = chunks.next().value;
sameArray(result3, [5]);
result3.pop();
sameArray(result3, []);
assert(result2 !== result3);
assert(chunks.next().done);
}

{
const invalidIterators = [
1,
1n,
true,
false,
null,
undefined,
Symbol("symbol"),
];
for (const invalidIterator of invalidIterators) {
shouldThrow(function () {
Iterator.prototype.chunks.call(invalidIterator);
}, TypeError, "Iterator.prototype.chunks requires that |this| be an Object.");
}
}

{
const invalidChunkSizes = [
undefined,
"test",
{},
];
const validIter = (function* gen() {})();
for (const invalidChunkSize of invalidChunkSizes) {
shouldThrow(function () {
Iterator.prototype.chunks.call(validIter, invalidChunkSize);
}, RangeError, "Iterator.prototype.chunks requires that argument not be NaN.");
}
}

{
const invalidChunkSizes = [
-1,
0,
2 ** 32,
null,
];
const validIter = (function* gen() {})();
for (const invalidChunkSize of invalidChunkSizes) {
shouldThrow(function () {
Iterator.prototype.chunks.call(validIter, invalidChunkSize);
}, RangeError, "Iterator.prototype.chunks requires that argument be between 1 and 2**32 - 1.");
}
}
Loading

0 comments on commit 8f32e9e

Please sign in to comment.