mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Merge inbound to mozilla-central. a=merge
This commit is contained in:
commit
014b37a409
@ -319,7 +319,7 @@ imply_option('--with-toolchain-prefix', android_toolchain_prefix,
|
||||
@depends(extra_toolchain_flags, android_toolchain,
|
||||
android_toolchain_prefix_base, '--help')
|
||||
@imports(_from='os.path', _import='isdir')
|
||||
def bindgen_cflags_defaults(toolchain_flags, toolchain, toolchain_prefix, _):
|
||||
def bindgen_cflags_android(toolchain_flags, toolchain, toolchain_prefix, _):
|
||||
if not toolchain_flags:
|
||||
return
|
||||
|
||||
@ -329,10 +329,10 @@ def bindgen_cflags_defaults(toolchain_flags, toolchain, toolchain_prefix, _):
|
||||
gcc_include = os.path.join(
|
||||
toolchain, 'lib', 'gcc', toolchain_prefix, '4.9')
|
||||
|
||||
cflags_format = "%s -I%s -I%s"
|
||||
return cflags_format % (' '.join(toolchain_flags),
|
||||
os.path.join(gcc_include, 'include'),
|
||||
os.path.join(gcc_include, 'include-fixed'))
|
||||
return toolchain_flags + [
|
||||
'-I%s' % os.path.join(gcc_include, 'include'),
|
||||
'-I%s' % os.path.join(gcc_include, 'include-fixed'),
|
||||
]
|
||||
|
||||
|
||||
@depends(host, ndk)
|
||||
|
@ -212,3 +212,131 @@ def bindgen_config_paths(llvm_config, libclang_path, clang_path,
|
||||
|
||||
set_config('MOZ_LIBCLANG_PATH', bindgen_config_paths.libclang_path)
|
||||
set_config('MOZ_CLANG_PATH', bindgen_config_paths.clang_path)
|
||||
|
||||
|
||||
@depends(host, target, target_is_unix, c_compiler, bindgen_cflags_android)
|
||||
def basic_bindgen_cflags(host, target, is_unix, compiler_info, android_cflags):
|
||||
args = [
|
||||
'-x', 'c++', '-std=gnu++14', '-fno-sized-deallocation',
|
||||
'-DTRACING=1', '-DIMPL_LIBXUL', '-DMOZILLA_INTERNAL_API',
|
||||
'-DRUST_BINDGEN'
|
||||
]
|
||||
|
||||
if is_unix:
|
||||
args += ['-DOS_POSIX=1']
|
||||
|
||||
if target.os == 'Android':
|
||||
args += android_cflags
|
||||
|
||||
def handle_cpu(obj):
|
||||
if 'cpu' in obj and target.cpu in obj['cpu']:
|
||||
return obj['cpu'][target.cpu]
|
||||
return []
|
||||
|
||||
if target.os == 'WINNT' and host.raw_os.startswith('gnu'):
|
||||
args += handle_cpu({
|
||||
'cpu': {
|
||||
'x86': ['--target=i686-pc-mingw32'],
|
||||
'x86_64': ['--target=x86_64-w64-mingw32'],
|
||||
},
|
||||
})
|
||||
|
||||
os_dict = {
|
||||
'Android': {
|
||||
'default': ['-DOS_ANDROID=1'],
|
||||
'cpu': {
|
||||
'aarch64': ['--target=aarch64-linux-android'],
|
||||
'arm': ['--target=armv7-linux-androideabi'],
|
||||
'x86': ['--target=i686-linux-android'],
|
||||
'x86_64': ['--target=x86_64-linux-android'],
|
||||
},
|
||||
},
|
||||
'DragonFly': {
|
||||
'default': ['-DOS_BSD=1', '-DOS_DRAGONFLY=1'],
|
||||
},
|
||||
'FreeBSD': {
|
||||
'default': ['-DOS_BSD=1', '-DOS_FREEBSD=1'],
|
||||
},
|
||||
'GNU': {
|
||||
'default': ['-DOS_LINUX=1'],
|
||||
'cpu': {
|
||||
'x86': ['-m32'],
|
||||
'x86_64': ['-m64'],
|
||||
},
|
||||
},
|
||||
'NetBSD': {
|
||||
'default': ['-DOS_BSD=1', '-DOS_NETBSD=1'],
|
||||
},
|
||||
'OpenBSD': {
|
||||
'default': ['-DOS_BSD=1', '-DOS_OPENBSD=1'],
|
||||
},
|
||||
'OSX': {
|
||||
'default': [
|
||||
'-DOS_MACOSX=1',
|
||||
'-stdlib=libc++',
|
||||
# To disable the fixup bindgen applies which adds search
|
||||
# paths from clang command line in order to avoid potential
|
||||
# conflict with -stdlib=libc++.
|
||||
'--target=x86_64-apple-darwin',
|
||||
],
|
||||
},
|
||||
'SunOS': {
|
||||
'default': ['-DOS_SOLARIS=1'],
|
||||
},
|
||||
'WINNT': {
|
||||
'default': [
|
||||
'-DOS_WIN=1',
|
||||
'-DWIN32=1',
|
||||
],
|
||||
'compiler': {
|
||||
'msvc': {
|
||||
'default': [
|
||||
# For compatibility with MSVC 2015
|
||||
'-fms-compatibility-version=19',
|
||||
# To enable the builtin __builtin_offsetof so that CRT wouldn't
|
||||
# use reinterpret_cast in offsetof() which is not allowed inside
|
||||
# static_assert().
|
||||
'-D_CRT_USE_BUILTIN_OFFSETOF',
|
||||
# Enable hidden attribute (which is not supported by MSVC and
|
||||
# thus not enabled by default with a MSVC-compatibile build)
|
||||
# to exclude hidden symbols from the generated file.
|
||||
'-DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1',
|
||||
],
|
||||
'cpu': {
|
||||
'x86': ['--target=i686-pc-win32'],
|
||||
'x86_64': ['--target=x86_64-pc-win32'],
|
||||
'aarch64': ['--target=aarch64-pc-windows-msvc'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}.get(target.os, {})
|
||||
|
||||
if 'default' in os_dict:
|
||||
args += os_dict['default']
|
||||
|
||||
args += handle_cpu(os_dict)
|
||||
if 'compiler' in os_dict and compiler_info and compiler_info in os_dict['compiler']:
|
||||
compiler_dict = os_dict['compiler'].get(compiler_info)
|
||||
if 'default' in compiler_dict:
|
||||
args += compiler_dict['default']
|
||||
args += handle_cpu(compiler_dict)
|
||||
|
||||
return args
|
||||
|
||||
|
||||
js_option(env='BINDGEN_CFLAGS',
|
||||
nargs=1,
|
||||
help='Options bindgen should pass to the C/C++ parser')
|
||||
|
||||
|
||||
@depends(basic_bindgen_cflags, 'BINDGEN_CFLAGS')
|
||||
@checking('bindgen cflags', lambda s: s if s else 'no')
|
||||
def bindgen_cflags(base_flags, extra_flags):
|
||||
flags = base_flags
|
||||
if extra_flags and len(extra_flags):
|
||||
flags += extra_flags[0].split()
|
||||
return ' '.join(flags)
|
||||
|
||||
|
||||
add_old_configure_assignment('_BINDGEN_CFLAGS', bindgen_cflags)
|
||||
|
@ -1126,22 +1126,6 @@ def check_have_64_bit(have_64_bit, compiler_have_64_bit):
|
||||
'about the target bitness.')
|
||||
|
||||
|
||||
js_option(env='BINDGEN_CFLAGS',
|
||||
nargs=1,
|
||||
default=bindgen_cflags_defaults,
|
||||
help='Options bindgen should pass to the C/C++ parser')
|
||||
|
||||
|
||||
@depends('BINDGEN_CFLAGS')
|
||||
@checking('bindgen cflags', lambda s: s if s else 'no')
|
||||
def bindgen_cflags(value):
|
||||
if value and len(value):
|
||||
return value[0].split()
|
||||
|
||||
|
||||
add_old_configure_assignment('_BINDGEN_CFLAGS', bindgen_cflags)
|
||||
|
||||
|
||||
@depends(c_compiler)
|
||||
def default_debug_flags(compiler_info):
|
||||
# Debug info is ON by default.
|
||||
|
@ -27,7 +27,7 @@ snapshot.io.save.window=Save Snapshot
|
||||
snapshot.io.import.window=Import Snapshot
|
||||
|
||||
# LOCALIZATION NOTE (snapshot.io.filter): The title for the filter used to
|
||||
# filter file types (*.fxsnapshot.gz)
|
||||
# filter file types (*.fxsnapshot)
|
||||
snapshot.io.filter=Firefox Snapshots
|
||||
|
||||
# LOCALIZATION NOTE (aggregate.mb): The label annotating the number of bytes (in
|
||||
|
@ -19,8 +19,7 @@ exports.pickFileAndExportSnapshot = function(snapshot) {
|
||||
const outputFile = await openFilePicker({
|
||||
title: L10N.getFormatStr("snapshot.io.save.window"),
|
||||
defaultName: OS.Path.basename(snapshot.path),
|
||||
filters: [[L10N.getFormatStr("snapshot.io.filter"),
|
||||
"*.fxsnapshot; *.fxsnapshot.gz"]],
|
||||
filters: [[L10N.getFormatStr("snapshot.io.filter"), "*.fxsnapshot"]],
|
||||
mode: "save",
|
||||
});
|
||||
|
||||
@ -54,8 +53,7 @@ exports.pickFileAndImportSnapshotAndCensus = function(heapWorker) {
|
||||
return async function(dispatch, getState) {
|
||||
const input = await openFilePicker({
|
||||
title: L10N.getFormatStr("snapshot.io.import.window"),
|
||||
filters: [[L10N.getFormatStr("snapshot.io.filter"),
|
||||
"*.fxsnapshot; *.fxsnapshot.gz"]],
|
||||
filters: [[L10N.getFormatStr("snapshot.io.filter"), "*.fxsnapshot"]],
|
||||
mode: "open",
|
||||
});
|
||||
|
||||
|
@ -126,7 +126,7 @@ function waitUntilCensusState(store, getCensus, expected) {
|
||||
}
|
||||
|
||||
async function createTempFile() {
|
||||
const file = FileUtils.getFile("TmpD", ["tmp.fxsnapshot.gz"]);
|
||||
const file = FileUtils.getFile("TmpD", ["tmp.fxsnapshot"]);
|
||||
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
|
||||
const destPath = file.path;
|
||||
const stat = await OS.File.stat(destPath);
|
||||
|
@ -42,9 +42,8 @@ exports.getSnapshotTitle = function(snapshot) {
|
||||
}
|
||||
|
||||
if (snapshot.imported) {
|
||||
// Strip out the extension if it's the expected ".fxsnapshot.gz"
|
||||
// (".gz" optional)
|
||||
return OS.Path.basename(snapshot.path.replace(/\.fxsnapshot(?:\.gz)?$/, ""));
|
||||
// Strip out the extension if it's the expected ".fxsnapshot"
|
||||
return OS.Path.basename(snapshot.path.replace(/\.fxsnapshot$/, ""));
|
||||
}
|
||||
|
||||
const date = new Date(snapshot.creationTime / 1000);
|
||||
|
@ -82,7 +82,7 @@ class ParamsPanel extends Component {
|
||||
getProperties(arr) {
|
||||
return arr.reduce((map, obj) => {
|
||||
const value = map[obj.name];
|
||||
if (value) {
|
||||
if (value || value === "") {
|
||||
if (typeof value !== "object") {
|
||||
map[obj.name] = [value];
|
||||
}
|
||||
|
@ -58,7 +58,9 @@ function isMedia({ mimeType }) {
|
||||
return mimeType && (
|
||||
mimeType.includes("audio/") ||
|
||||
mimeType.includes("video/") ||
|
||||
mimeType.includes("model/"));
|
||||
mimeType.includes("model/") ||
|
||||
mimeType === "application/vnd.apple.mpegurl" ||
|
||||
mimeType === "application/x-mpegurl");
|
||||
}
|
||||
|
||||
function isWS({ requestHeaders, responseHeaders }) {
|
||||
|
@ -19,7 +19,7 @@ add_task(async function() {
|
||||
store.dispatch(Actions.batchEnable(false));
|
||||
|
||||
// Execute requests.
|
||||
await performRequests(monitor, tab, 10);
|
||||
await performRequests(monitor, tab, 12);
|
||||
|
||||
wait = waitForDOM(document, "#params-panel .tree-section", 2);
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" },
|
||||
@ -85,6 +85,23 @@ add_task(async function() {
|
||||
["species", "in=(52,60)"],
|
||||
]));
|
||||
|
||||
wait = waitForDOM(document, "#params-panel .tree-section", 1);
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" },
|
||||
document.querySelectorAll(".request-list-item")[10]);
|
||||
await wait;
|
||||
testParamsTabGetWithArgs(new Map([
|
||||
["a", ["", "b"]],
|
||||
]));
|
||||
|
||||
wait = waitForDOM(document, "#params-panel .tree-section", 1);
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" },
|
||||
document.querySelectorAll(".request-list-item")[11]);
|
||||
await wait;
|
||||
testParamsTabGetWithArgs(new Map([
|
||||
["a", ["b", "c"]],
|
||||
["d", "1"]
|
||||
]));
|
||||
|
||||
await teardown(monitor);
|
||||
|
||||
function testParamsTab1(queryStringParamName, queryStringParamValue,
|
||||
@ -198,15 +215,22 @@ add_task(async function() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Map} expectedParams A map of expected parameter keys and values
|
||||
* as Strings.
|
||||
* @param {Map} expectedParams A map of expected parameter keys, and values
|
||||
* as Strings or an array of Strings if the parameter key has multiple
|
||||
* values
|
||||
*/
|
||||
function testParamsTabGetWithArgs(expectedParams) {
|
||||
const tabpanel = document.querySelector("#params-panel");
|
||||
|
||||
let numParamRows = 0;
|
||||
expectedParams.forEach((v, k, m) => {
|
||||
numParamRows += (typeof v === "object" ? v.length + 1 : 1);
|
||||
});
|
||||
|
||||
is(tabpanel.querySelectorAll(".tree-section").length, 1,
|
||||
"Check the number of param tree sections displayed in this tabpanel.");
|
||||
is(tabpanel.querySelectorAll("tr:not(.tree-section).treeRow").length, 1,
|
||||
is(tabpanel.querySelectorAll("tr:not(.tree-section).treeRow").length,
|
||||
numParamRows,
|
||||
"Check the number of param rows displayed in this tabpanel.");
|
||||
ok(!tabpanel.querySelector(".empty-notice"),
|
||||
"The empty notice should not be displayed in this tabpanel.");
|
||||
@ -229,10 +253,28 @@ add_task(async function() {
|
||||
const labelsIter = labels.values();
|
||||
const valuesIter = values.values();
|
||||
for (const [expKey, expValue] of expectedParams) {
|
||||
const label = labelsIter.next().value;
|
||||
const value = valuesIter.next().value;
|
||||
is(label.textContent, expKey, "Check that parameter name matches.");
|
||||
is(value.textContent, expValue, "Check that parameter value matches.");
|
||||
let label = labelsIter.next().value;
|
||||
let value = valuesIter.next().value;
|
||||
|
||||
if (typeof expValue === "object") {
|
||||
// multiple values for one parameter
|
||||
is(label.textContent, expKey, "Check that parameter name matches.");
|
||||
is(value.textContent, "[\u2026]", // horizontal ellipsis
|
||||
"Check that parameter value indicates multiple.");
|
||||
|
||||
for (let i = 0; i < expValue.length; i++) {
|
||||
label = labelsIter.next().value;
|
||||
value = valuesIter.next().value;
|
||||
is(label.textContent, i + "",
|
||||
"Check that multi-value parameter index matches.");
|
||||
is(value.textContent, expValue[i],
|
||||
"Check that multi-value parameter value matches.");
|
||||
is(label.dataset.level, 2, "Check that parameter is nested.");
|
||||
}
|
||||
} else {
|
||||
is(label.textContent, expKey, "Check that parameter name matches.");
|
||||
is(value.textContent, expValue, "Check that parameter value matches.");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -28,6 +28,8 @@ const REQUESTS_WITH_MEDIA = BASIC_REQUESTS.concat([
|
||||
{ url: "sjs_content-type-test-server.sjs?fmt=image" },
|
||||
{ url: "sjs_content-type-test-server.sjs?fmt=audio" },
|
||||
{ url: "sjs_content-type-test-server.sjs?fmt=video" },
|
||||
{ url: "sjs_content-type-test-server.sjs?fmt=hls-m3u8" },
|
||||
{ url: "sjs_content-type-test-server.sjs?fmt=hls-m3u8-alt-mime-type" },
|
||||
]);
|
||||
|
||||
const REQUESTS_WITH_MEDIA_AND_FLASH = REQUESTS_WITH_MEDIA.concat([
|
||||
@ -150,6 +152,28 @@ const EXPECTED_REQUESTS = [
|
||||
fullMimeType: "video/webm"
|
||||
},
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
url: CONTENT_TYPE_SJS + "?fmt=hls-m3u8",
|
||||
data: {
|
||||
fuzzyUrl: true,
|
||||
status: 200,
|
||||
statusText: "OK",
|
||||
type: "x-mpegurl",
|
||||
fullMimeType: "application/x-mpegurl"
|
||||
},
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
url: CONTENT_TYPE_SJS + "?fmt=hls-m3u8-alt-mime-type",
|
||||
data: {
|
||||
fuzzyUrl: true,
|
||||
status: 200,
|
||||
statusText: "OK",
|
||||
type: "vnd.apple.mpegurl",
|
||||
fullMimeType: "application/vnd.apple.mpegurl"
|
||||
},
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
url: CONTENT_TYPE_SJS + "?fmt=flash",
|
||||
@ -208,12 +232,12 @@ add_task(async function() {
|
||||
|
||||
// First test with single filters...
|
||||
testFilterButtons(monitor, "all");
|
||||
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-html-button"));
|
||||
testFilterButtons(monitor, "html");
|
||||
await testContents([1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
// Reset filters
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
@ -221,105 +245,105 @@ add_task(async function() {
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-css-button"));
|
||||
testFilterButtons(monitor, "css");
|
||||
await testContents([0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-js-button"));
|
||||
testFilterButtons(monitor, "js");
|
||||
await testContents([0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-xhr-button"));
|
||||
testFilterButtons(monitor, "xhr");
|
||||
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]);
|
||||
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]);
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-fonts-button"));
|
||||
testFilterButtons(monitor, "fonts");
|
||||
await testContents([0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]);
|
||||
await testContents([0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-images-button"));
|
||||
testFilterButtons(monitor, "images");
|
||||
await testContents([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]);
|
||||
await testContents([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-media-button"));
|
||||
testFilterButtons(monitor, "media");
|
||||
await testContents([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0]);
|
||||
await testContents([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0]);
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-ws-button"));
|
||||
testFilterButtons(monitor, "ws");
|
||||
await testContents([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]);
|
||||
await testContents([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]);
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
|
||||
testFilterButtons(monitor, "all");
|
||||
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
|
||||
// Text in filter box that matches nothing should hide all.
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
setFreetextFilter("foobar");
|
||||
await testContents([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
// ASCII text in filter box that matches should filter out everything else.
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
setFreetextFilter("sample");
|
||||
await testContents([1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
// ASCII text in filter box that matches should filter out everything else.
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
setFreetextFilter("SAMPLE");
|
||||
await testContents([1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
// Test negative filtering ASCII text(only show unmatched items)
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
setFreetextFilter("-sample");
|
||||
await testContents([0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
await testContents([0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
|
||||
// Unicode text in filter box that matches should filter out everything else.
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
setFreetextFilter(UNICODE_IN_URI_COMPONENT);
|
||||
await testContents([0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
// Ditto, except the above is for a Unicode URI component, and this one is for
|
||||
// a Unicode domain name.
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
setFreetextFilter(UNICODE_IN_IDN);
|
||||
await testContents([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]);
|
||||
await testContents([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
// Test negative filtering Unicode text(only show unmatched items)
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
setFreetextFilter(`-${UNICODE_IN_URI_COMPONENT}`);
|
||||
await testContents([1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1]);
|
||||
await testContents([1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
|
||||
// Ditto, except the above is for a Unicode URI component, and this one is for
|
||||
// a Unicode domain name.
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
setFreetextFilter(`-${UNICODE_IN_IDN}`);
|
||||
await testContents([0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1]);
|
||||
await testContents([0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1]);
|
||||
|
||||
// ...then combine multiple filters together.
|
||||
|
||||
@ -330,29 +354,29 @@ add_task(async function() {
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-css-button"));
|
||||
testFilterButtonsCustom(monitor, [0, 1, 1, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
// Html and css filter enabled and text filter should show just the html and css match.
|
||||
// Should not show both the items matching the button plus the items matching the text.
|
||||
setFreetextFilter("sample");
|
||||
await testContents([1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
setFreetextFilter(UNICODE_IN_URI_COMPONENT);
|
||||
await testContents([0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
setFreetextFilter("");
|
||||
testFilterButtonsCustom(monitor, [0, 1, 1, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
// Disable some filters. Only one left active.
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-css-button"));
|
||||
testFilterButtons(monitor, "html");
|
||||
await testContents([1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
await testContents([1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
|
||||
// Disable last active filter. Should toggle to all.
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-html-button"));
|
||||
testFilterButtons(monitor, "all");
|
||||
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
|
||||
// Enable few filters and click on all. Only "all" should be checked.
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
@ -365,7 +389,7 @@ add_task(async function() {
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
document.querySelector(".requests-list-filter-all-button"));
|
||||
testFilterButtons(monitor, "all");
|
||||
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
await testContents([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
|
||||
await teardown(monitor);
|
||||
|
||||
|
@ -69,6 +69,8 @@
|
||||
await patch("baz", "?a=b", urlencoded, '{ "foo": "bar" }');
|
||||
await put("baz", "?a=b", urlencoded, '{ "foo": "bar" }');
|
||||
await get("baz", "?species=in=(52,60)");
|
||||
await get("baz", "?a=&a=b");
|
||||
await get("baz", "?a=b&a=c&d=1");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
@ -266,6 +266,14 @@ function handleRequest(request, response) {
|
||||
response.finish();
|
||||
break;
|
||||
}
|
||||
case "hls-m3u8-alt-mime-type": {
|
||||
response.setStatusLine(request.httpVersion, status, "OK");
|
||||
response.setHeader("Content-Type", "application/vnd.apple.mpegurl", false);
|
||||
setCacheHeaders();
|
||||
response.write("#EXTM3U\n");
|
||||
response.finish();
|
||||
break;
|
||||
}
|
||||
case "mpeg-dash": {
|
||||
response.setStatusLine(request.httpVersion, status, "OK");
|
||||
response.setHeader("Content-Type", "video/vnd.mpeg.dash.mpd", false);
|
||||
|
@ -1449,7 +1449,7 @@ HeapSnapshot::CreateUniqueCoreDumpFile(ErrorResult& rv,
|
||||
return nullptr;
|
||||
|
||||
auto ms = msSinceProcessCreation(now);
|
||||
rv = file->AppendNative(nsPrintfCString("%lu.fxsnapshot.gz", ms));
|
||||
rv = file->AppendNative(nsPrintfCString("%lu.fxsnapshot", ms));
|
||||
if (NS_WARN_IF(rv.Failed()))
|
||||
return nullptr;
|
||||
|
||||
@ -1464,7 +1464,7 @@ HeapSnapshot::CreateUniqueCoreDumpFile(ErrorResult& rv,
|
||||
// The snapshot ID must be computed in the process that created the
|
||||
// temp file, because TmpD may not be the same in all processes.
|
||||
outSnapshotId.Assign(Substring(outFilePath, tempPath.Length() + 1,
|
||||
outFilePath.Length() - tempPath.Length() - sizeof(".fxsnapshot.gz")));
|
||||
outFilePath.Length() - tempPath.Length() - sizeof(".fxsnapshot")));
|
||||
|
||||
return file.forget();
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ public:
|
||||
uint32_t size,
|
||||
ErrorResult& rv);
|
||||
|
||||
// Creates the `$TEMP_DIR/XXXXXX-XXX.fxsnapshot.gz` core dump file that heap
|
||||
// Creates the `$TEMP_DIR/XXXXXX-XXX.fxsnapshot` core dump file that heap
|
||||
// snapshots are serialized into.
|
||||
static already_AddRefed<nsIFile> CreateUniqueCoreDumpFile(ErrorResult& rv,
|
||||
const TimeStamp& now,
|
||||
|
@ -15,8 +15,8 @@
|
||||
//
|
||||
// The heap snapshot file path conventions permits the following forms:
|
||||
//
|
||||
// $TEMP_DIRECTORY/XXXXXXXXXX.fxsnapshot.gz
|
||||
// $TEMP_DIRECTORY/XXXXXXXXXX-XXXXX.fxsnapshot.gz
|
||||
// $TEMP_DIRECTORY/XXXXXXXXXX.fxsnapshot
|
||||
// $TEMP_DIRECTORY/XXXXXXXXXX-XXXXX.fxsnapshot
|
||||
//
|
||||
// Where the strings of "X" are zero or more digits.
|
||||
|
||||
@ -28,7 +28,7 @@ loader.lazyRequireGetter(this, "FileUtils",
|
||||
loader.lazyRequireGetter(this, "OS", "resource://gre/modules/osfile.jsm", true);
|
||||
|
||||
function getHeapSnapshotFileTemplate() {
|
||||
return OS.Path.join(OS.Constants.Path.tmpDir, `${Date.now()}.fxsnapshot.gz`);
|
||||
return OS.Path.join(OS.Constants.Path.tmpDir, `${Date.now()}.fxsnapshot`);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -63,7 +63,7 @@ exports.getHeapSnapshotTempFilePath = function(snapshotId) {
|
||||
if (!isValidSnapshotFileId(snapshotId)) {
|
||||
return null;
|
||||
}
|
||||
return OS.Path.join(OS.Constants.Path.tmpDir, snapshotId + ".fxsnapshot.gz");
|
||||
return OS.Path.join(OS.Constants.Path.tmpDir, snapshotId + ".fxsnapshot");
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1755,7 +1755,6 @@ nsContentUtils::IsHTMLBlock(nsIContent* aContent)
|
||||
nsGkAtoms::li,
|
||||
nsGkAtoms::listing,
|
||||
nsGkAtoms::menu,
|
||||
nsGkAtoms::multicol, // XXX get rid of this one?
|
||||
nsGkAtoms::nav,
|
||||
nsGkAtoms::ol,
|
||||
nsGkAtoms::p,
|
||||
|
@ -2137,6 +2137,11 @@ nsDocument::Init()
|
||||
|
||||
mScriptLoader = new dom::ScriptLoader(this);
|
||||
|
||||
// we need to create a policy here so getting the policy within
|
||||
// ::Policy() can *always* return a non null policy
|
||||
mFeaturePolicy = new FeaturePolicy(this);
|
||||
mFeaturePolicy->SetDefaultOrigin(NodePrincipal());
|
||||
|
||||
mozilla::HoldJSObjects(this);
|
||||
|
||||
return NS_OK;
|
||||
@ -3012,11 +3017,9 @@ nsIDocument::InitCSP(nsIChannel* aChannel)
|
||||
nsresult
|
||||
nsIDocument::InitFeaturePolicy(nsIChannel* aChannel)
|
||||
{
|
||||
MOZ_ASSERT(!mFeaturePolicy, "we should only call init once");
|
||||
MOZ_ASSERT(mFeaturePolicy, "we should only call init once");
|
||||
|
||||
// we need to create a policy here so getting the policy within
|
||||
// ::Policy() can *always* return a non null policy
|
||||
mFeaturePolicy = new FeaturePolicy(this);
|
||||
mFeaturePolicy->ResetDeclaredPolicy();
|
||||
|
||||
if (!StaticPrefs::dom_security_featurePolicy_enabled()) {
|
||||
return NS_OK;
|
||||
|
@ -36,7 +36,7 @@ namespace ChromeUtils {
|
||||
* @returns The path to the file the heap snapshot was written
|
||||
* to. This is guaranteed to be within the temp
|
||||
* directory and its file name will match the regexp
|
||||
* `\d+(\-\d+)?\.fxsnapshot.gz`.
|
||||
* `\d+(\-\d+)?\.fxsnapshot`.
|
||||
*/
|
||||
[Throws]
|
||||
DOMString saveHeapSnapshot(optional HeapSnapshotBoundaries boundaries);
|
||||
@ -46,7 +46,7 @@ namespace ChromeUtils {
|
||||
*
|
||||
* @returns The snapshot ID of the file. This is the file name
|
||||
* without the temp directory or the trailing
|
||||
* `.fxsnapshot.gz`.
|
||||
* `.fxsnapshot`.
|
||||
*/
|
||||
[Throws]
|
||||
DOMString saveHeapSnapshotGetId(optional HeapSnapshotBoundaries boundaries);
|
||||
|
@ -645,7 +645,7 @@ mozilla::ipc::IPCResult
|
||||
CompositorBridgeParent::RecvForcePresent()
|
||||
{
|
||||
if (mWrBridge) {
|
||||
mWrBridge->ScheduleGenerateFrame();
|
||||
mWrBridge->ScheduleForcedGenerateFrame();
|
||||
}
|
||||
// During the shutdown sequence mLayerManager may be null
|
||||
if (mLayerManager) {
|
||||
|
@ -1389,18 +1389,23 @@ WebRenderBridgeParent::UpdateWebRender(CompositorVsyncScheduler* aScheduler,
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
WebRenderBridgeParent::RecvScheduleComposite()
|
||||
{
|
||||
ScheduleGenerateFrame();
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
void
|
||||
WebRenderBridgeParent::ScheduleForcedGenerateFrame()
|
||||
{
|
||||
if (mDestroyed) {
|
||||
return IPC_OK();
|
||||
return;
|
||||
}
|
||||
|
||||
// Force frame rendering during next frame generation.
|
||||
wr::TransactionBuilder fastTxn(/* aUseSceneBuilderThread */ false);
|
||||
fastTxn.InvalidateRenderedFrame();
|
||||
mApi->SendTransaction(fastTxn);
|
||||
|
||||
ScheduleGenerateFrame();
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
|
@ -186,6 +186,14 @@ public:
|
||||
*/
|
||||
void ScheduleGenerateFrame();
|
||||
|
||||
/**
|
||||
* Schedule forced frame rendering at next composite timing.
|
||||
*
|
||||
* WebRender could skip frame rendering if there is no update.
|
||||
* This function is used to force rendering even when there is not update.
|
||||
*/
|
||||
void ScheduleForcedGenerateFrame();
|
||||
|
||||
wr::Epoch UpdateWebRender(CompositorVsyncScheduler* aScheduler,
|
||||
wr::WebRenderAPI* aApi,
|
||||
AsyncImagePipelineManager* aImageMgr,
|
||||
|
@ -73,17 +73,13 @@ BinASTParser<Tok>::parseSumAssertedMaybePositionalParameterName(const size_t sta
|
||||
Ok result;
|
||||
switch (kind) {
|
||||
case BinKind::AssertedParameterName:
|
||||
MOZ_TRY_VAR(result, parseInterfaceAssertedParameterName(start, kind, fields,
|
||||
scopeKind, positionalParams));
|
||||
break;
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (AssertedParameterName)");
|
||||
case BinKind::AssertedPositionalParameterName:
|
||||
MOZ_TRY_VAR(result, parseInterfaceAssertedPositionalParameterName(start, kind, fields,
|
||||
scopeKind, positionalParams));
|
||||
break;
|
||||
case BinKind::AssertedRestParameterName:
|
||||
MOZ_TRY_VAR(result, parseInterfaceAssertedRestParameterName(start, kind, fields,
|
||||
scopeKind, positionalParams));
|
||||
break;
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (AssertedRestParameterName)");
|
||||
default:
|
||||
return raiseInvalidKind("AssertedMaybePositionalParameterName", kind);
|
||||
}
|
||||
@ -1935,13 +1931,13 @@ BinASTParser<Tok>::parseSumVariableDeclarationOrExpression(const size_t start, c
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceArrayAssignmentTarget(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ArrayAssignmentTarget)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ArrayAssignmentTarget)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceArrayBinding(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ArrayBinding)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ArrayBinding)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -1994,7 +1990,7 @@ BinASTParser<Tok>::parseArrowExpressionContentsWithExpression()
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceArrowExpressionContentsWithExpression(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ArrowExpressionContentsWithExpression)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ArrowExpressionContentsWithExpression)");
|
||||
}
|
||||
|
||||
|
||||
@ -2027,7 +2023,7 @@ BinASTParser<Tok>::parseArrowExpressionContentsWithFunctionBody()
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceArrowExpressionContentsWithFunctionBody(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ArrowExpressionContentsWithFunctionBody)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ArrowExpressionContentsWithFunctionBody)");
|
||||
}
|
||||
|
||||
|
||||
@ -2243,29 +2239,10 @@ BinASTParser<Tok>::parseInterfaceAssertedDeclaredName(const size_t start, const
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<Ok>
|
||||
BinASTParser<Tok>::parseInterfaceAssertedParameterName(const size_t start, const BinKind kind, const BinFields& fields,
|
||||
AssertedScopeKind scopeKind,
|
||||
MutableHandle<GCVector<JSAtom*>> positionalParams)
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceAssertedParameterName(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
MOZ_ASSERT(kind == BinKind::AssertedParameterName);
|
||||
BINJS_TRY(CheckRecursionLimit(cx_));
|
||||
|
||||
#if defined(DEBUG)
|
||||
const BinField expected_fields[2] = { BinField::Name, BinField::IsCaptured };
|
||||
MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
|
||||
#endif // defined(DEBUG)
|
||||
|
||||
RootedAtom name(cx_);
|
||||
MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
|
||||
|
||||
BINJS_MOZ_TRY_DECL(isCaptured, tokenizer_->readBool());
|
||||
ParseContext::Scope* scope;
|
||||
DeclarationKind declKind;
|
||||
MOZ_TRY(getBoundScope(scopeKind, scope, declKind));
|
||||
MOZ_TRY(addScopeName(scopeKind, name, scope, declKind, isCaptured));
|
||||
auto result = Ok();
|
||||
return result;
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (AssertedParameterName)");
|
||||
}
|
||||
|
||||
|
||||
@ -2345,12 +2322,23 @@ BinASTParser<Tok>::parseInterfaceAssertedPositionalParameterName(const size_t st
|
||||
|
||||
RootedAtom name(cx_);
|
||||
MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
|
||||
// FIXME: The following checks should be performed inside
|
||||
// checkPositionalParameterIndices to match the spec's order
|
||||
// (bug 1490976).
|
||||
if (index >= positionalParams.get().length()) {
|
||||
return raiseError("AssertedPositionalParameterName.length out of range");
|
||||
// `positionalParams` vector can be shorter than the actual
|
||||
// parameter length. Resize on demand.
|
||||
// (see also ListOfAssertedMaybePositionalParameterName)
|
||||
size_t prevLength = positionalParams.get().length();
|
||||
if (index >= prevLength) {
|
||||
// This is implementation limit, which is not in the spec.
|
||||
size_t newLength = index + 1;
|
||||
if (newLength >= ARGNO_LIMIT) {
|
||||
return raiseError("AssertedPositionalParameterName.index is too big");
|
||||
}
|
||||
|
||||
BINJS_TRY(positionalParams.get().resize(newLength));
|
||||
for (uint32_t i = prevLength; i < newLength; i++) {
|
||||
positionalParams.get()[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (positionalParams.get()[index]) {
|
||||
return raiseError("AssertedPositionalParameterName has duplicate entry for the same index");
|
||||
}
|
||||
@ -2364,29 +2352,10 @@ BinASTParser<Tok>::parseInterfaceAssertedPositionalParameterName(const size_t st
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<Ok>
|
||||
BinASTParser<Tok>::parseInterfaceAssertedRestParameterName(const size_t start, const BinKind kind, const BinFields& fields,
|
||||
AssertedScopeKind scopeKind,
|
||||
MutableHandle<GCVector<JSAtom*>> positionalParams)
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceAssertedRestParameterName(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
MOZ_ASSERT(kind == BinKind::AssertedRestParameterName);
|
||||
BINJS_TRY(CheckRecursionLimit(cx_));
|
||||
|
||||
#if defined(DEBUG)
|
||||
const BinField expected_fields[2] = { BinField::Name, BinField::IsCaptured };
|
||||
MOZ_TRY(tokenizer_->checkFields(kind, fields, expected_fields));
|
||||
#endif // defined(DEBUG)
|
||||
|
||||
RootedAtom name(cx_);
|
||||
MOZ_TRY_VAR(name, tokenizer_->readIdentifierName());
|
||||
|
||||
BINJS_MOZ_TRY_DECL(isCaptured, tokenizer_->readBool());
|
||||
ParseContext::Scope* scope;
|
||||
DeclarationKind declKind;
|
||||
MOZ_TRY(getBoundScope(scopeKind, scope, declKind));
|
||||
MOZ_TRY(addScopeName(scopeKind, name, scope, declKind, isCaptured));
|
||||
auto result = Ok();
|
||||
return result;
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (AssertedRestParameterName)");
|
||||
}
|
||||
|
||||
|
||||
@ -2565,25 +2534,25 @@ BinASTParser<Tok>::parseInterfaceAssignmentTargetIdentifier(const size_t start,
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceAssignmentTargetPropertyIdentifier(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (AssignmentTargetPropertyIdentifier)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (AssignmentTargetPropertyIdentifier)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceAssignmentTargetPropertyProperty(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (AssignmentTargetPropertyProperty)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (AssignmentTargetPropertyProperty)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceAssignmentTargetWithInitializer(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (AssignmentTargetWithInitializer)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (AssignmentTargetWithInitializer)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceAwaitExpression(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (AwaitExpression)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (AwaitExpression)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -2747,19 +2716,19 @@ BinASTParser<Tok>::parseInterfaceBindingIdentifier(const size_t start, const Bin
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceBindingPropertyIdentifier(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (BindingPropertyIdentifier)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (BindingPropertyIdentifier)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceBindingPropertyProperty(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (BindingPropertyProperty)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (BindingPropertyProperty)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceBindingWithInitializer(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (BindingWithInitializer)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (BindingWithInitializer)");
|
||||
}
|
||||
|
||||
|
||||
@ -2946,7 +2915,7 @@ BinASTParser<Tok>::parseInterfaceCatchClause(const size_t start, const BinKind k
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceClassDeclaration(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ClassDeclaration)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ClassDeclaration)");
|
||||
}
|
||||
|
||||
|
||||
@ -2977,13 +2946,13 @@ BinASTParser<Tok>::parseClassElement()
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceClassElement(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ClassElement)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ClassElement)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceClassExpression(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ClassExpression)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ClassExpression)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -3087,7 +3056,7 @@ BinASTParser<Tok>::parseInterfaceComputedMemberExpression(const size_t start, co
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceComputedPropertyName(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ComputedPropertyName)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ComputedPropertyName)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -3170,7 +3139,7 @@ BinASTParser<Tok>::parseInterfaceDataProperty(const size_t start, const BinKind
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceDebuggerStatement(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (DebuggerStatement)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (DebuggerStatement)");
|
||||
}
|
||||
|
||||
|
||||
@ -3239,13 +3208,13 @@ BinASTParser<Tok>::parseInterfaceDoWhileStatement(const size_t start, const BinK
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceEagerArrowExpressionWithExpression(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (EagerArrowExpressionWithExpression)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (EagerArrowExpressionWithExpression)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceEagerArrowExpressionWithFunctionBody(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (EagerArrowExpressionWithFunctionBody)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (EagerArrowExpressionWithFunctionBody)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -3517,25 +3486,25 @@ MOZ_TRY(tokenizer_->checkFields0(kind, fields));
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceExport(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (Export)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (Export)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceExportAllFrom(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ExportAllFrom)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ExportAllFrom)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceExportDefault(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ExportDefault)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ExportDefault)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceExportFrom(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ExportFrom)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ExportFrom)");
|
||||
}
|
||||
|
||||
|
||||
@ -3566,7 +3535,7 @@ BinASTParser<Tok>::parseExportFromSpecifier()
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceExportFromSpecifier(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ExportFromSpecifier)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ExportFromSpecifier)");
|
||||
}
|
||||
|
||||
|
||||
@ -3597,13 +3566,13 @@ BinASTParser<Tok>::parseExportLocalSpecifier()
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceExportLocalSpecifier(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ExportLocalSpecifier)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ExportLocalSpecifier)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceExportLocals(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ExportLocals)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ExportLocals)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -3689,7 +3658,7 @@ BinASTParser<Tok>::parseInterfaceForInStatement(const size_t start, const BinKin
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceForOfStatement(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ForOfStatement)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ForOfStatement)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -3771,8 +3740,7 @@ BinASTParser<Tok>::parseInterfaceFormalParameters(const size_t start, const BinK
|
||||
|
||||
auto result = items;
|
||||
if (rest) {
|
||||
BINJS_TRY_DECL(spread, factory_.newSpread(start, rest));
|
||||
factory_.addList(result, spread);
|
||||
return raiseError("Rest parameter is not supported in this preview release");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -4047,13 +4015,13 @@ BinASTParser<Tok>::parseInterfaceIfStatement(const size_t start, const BinKind k
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceImport(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (Import)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (Import)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceImportNamespace(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ImportNamespace)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ImportNamespace)");
|
||||
}
|
||||
|
||||
|
||||
@ -4084,7 +4052,7 @@ BinASTParser<Tok>::parseImportSpecifier()
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceImportSpecifier(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ImportSpecifier)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ImportSpecifier)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -4113,13 +4081,13 @@ BinASTParser<Tok>::parseInterfaceLabelledStatement(const size_t start, const Bin
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceLazyArrowExpressionWithExpression(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (LazyArrowExpressionWithExpression)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (LazyArrowExpressionWithExpression)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceLazyArrowExpressionWithFunctionBody(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (LazyArrowExpressionWithFunctionBody)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (LazyArrowExpressionWithFunctionBody)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -4233,19 +4201,19 @@ BinASTParser<Tok>::parseInterfaceLazyFunctionExpression(const size_t start, cons
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceLazyGetter(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (LazyGetter)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (LazyGetter)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceLazyMethod(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (LazyMethod)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (LazyMethod)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceLazySetter(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (LazySetter)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (LazySetter)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -4268,7 +4236,7 @@ BinASTParser<Tok>::parseInterfaceLiteralBooleanExpression(const size_t start, co
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceLiteralInfinityExpression(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (LiteralInfinityExpression)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (LiteralInfinityExpression)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -4389,7 +4357,7 @@ BinASTParser<Tok>::parseInterfaceLiteralStringExpression(const size_t start, con
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceModule(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (Module)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (Module)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -4414,19 +4382,19 @@ BinASTParser<Tok>::parseInterfaceNewExpression(const size_t start, const BinKind
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceNewTargetExpression(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (NewTargetExpression)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (NewTargetExpression)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceObjectAssignmentTarget(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ObjectAssignmentTarget)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ObjectAssignmentTarget)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceObjectBinding(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ObjectBinding)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ObjectBinding)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -4581,7 +4549,7 @@ BinASTParser<Tok>::parseInterfaceShorthandProperty(const size_t start, const Bin
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceSpreadElement(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (SpreadElement)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (SpreadElement)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -4637,7 +4605,7 @@ BinASTParser<Tok>::parseInterfaceStaticMemberExpression(const size_t start, cons
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceSuper(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (Super)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (Super)");
|
||||
}
|
||||
|
||||
|
||||
@ -4781,13 +4749,13 @@ BinASTParser<Tok>::parseInterfaceSwitchStatementWithDefault(const size_t start,
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceTemplateElement(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (TemplateElement)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (TemplateElement)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceTemplateExpression(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (TemplateExpression)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (TemplateExpression)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
@ -5125,13 +5093,13 @@ BinASTParser<Tok>::parseInterfaceWithStatement(const size_t start, const BinKind
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceYieldExpression(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (YieldExpression)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (YieldExpression)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseInterfaceYieldStarExpression(const size_t start, const BinKind kind, const BinFields& fields)
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (YieldStarExpression)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (YieldStarExpression)");
|
||||
}
|
||||
|
||||
|
||||
@ -5481,13 +5449,14 @@ BinASTParser<Tok>::parseListOfAssertedMaybePositionalParameterName(
|
||||
MOZ_TRY(tokenizer_->enterList(length, guard));
|
||||
(void) start;
|
||||
auto result = Ok();
|
||||
if (length >= ARGNO_LIMIT) {
|
||||
return raiseError("Too many function parameters");
|
||||
}
|
||||
BINJS_TRY(positionalParams.get().resize(length));
|
||||
for (uint32_t i = 0; i < length; i++) {
|
||||
positionalParams.get()[i] = nullptr;
|
||||
}
|
||||
// This list contains also destructuring parameters, and the number of
|
||||
// list items can be greater than the actual parameters, or more than
|
||||
// ARGNO_LIMIT even if the number of parameters fits into ARGNO_LIMIT.
|
||||
// Also, the number of parameters can be greater than this list's length
|
||||
// if one of destructuring parameter is empty.
|
||||
//
|
||||
// We resize `positionalParams` vector on demand, to keep the vector
|
||||
// length match to the known maximum positional parameter index + 1.
|
||||
|
||||
for (uint32_t i = 0; i < length; ++i) {
|
||||
MOZ_TRY(parseAssertedMaybePositionalParameterName(
|
||||
@ -5502,25 +5471,25 @@ BinASTParser<Tok>::parseListOfAssertedMaybePositionalParameterName(
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseListOfAssignmentTargetOrAssignmentTargetWithInitializer()
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ListOfAssignmentTargetOrAssignmentTargetWithInitializer)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ListOfAssignmentTargetOrAssignmentTargetWithInitializer)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseListOfAssignmentTargetProperty()
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ListOfAssignmentTargetProperty)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ListOfAssignmentTargetProperty)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseListOfBindingProperty()
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ListOfBindingProperty)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ListOfBindingProperty)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseListOfClassElement()
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ListOfClassElement)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ListOfClassElement)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ListNode*>
|
||||
@ -5545,31 +5514,31 @@ BinASTParser<Tok>::parseListOfDirective()
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseListOfExportFromSpecifier()
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ListOfExportFromSpecifier)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ListOfExportFromSpecifier)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseListOfExportLocalSpecifier()
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ListOfExportLocalSpecifier)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ListOfExportLocalSpecifier)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseListOfExpressionOrTemplateElement()
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ListOfExpressionOrTemplateElement)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ListOfExpressionOrTemplateElement)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseListOfImportDeclarationOrExportDeclarationOrStatement()
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ListOfImportDeclarationOrExportDeclarationOrStatement)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ListOfImportDeclarationOrExportDeclarationOrStatement)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseListOfImportSpecifier()
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ListOfImportSpecifier)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ListOfImportSpecifier)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ListNode*>
|
||||
@ -5596,7 +5565,7 @@ BinASTParser<Tok>::parseListOfObjectProperty()
|
||||
template<typename Tok> JS::Result<ParseNode*>
|
||||
BinASTParser<Tok>::parseListOfOptionalBindingOrBindingWithInitializer()
|
||||
{
|
||||
return raiseError("FIXME: Not implemented yet (ListOfOptionalBindingOrBindingWithInitializer)");
|
||||
return raiseError("FIXME: Not implemented yet in this preview release (ListOfOptionalBindingOrBindingWithInitializer)");
|
||||
}
|
||||
|
||||
template<typename Tok> JS::Result<ListNode*>
|
||||
|
@ -196,17 +196,13 @@ JS::Result<Ok> parseInterfaceAssertedBoundName(const size_t start, const BinKind
|
||||
JS::Result<Ok> parseInterfaceAssertedBoundNamesScope(const size_t start, const BinKind kind, const BinFields& fields);
|
||||
JS::Result<Ok> parseInterfaceAssertedDeclaredName(const size_t start, const BinKind kind, const BinFields& fields,
|
||||
AssertedScopeKind scopeKind);
|
||||
JS::Result<Ok> parseInterfaceAssertedParameterName(const size_t start, const BinKind kind, const BinFields& fields,
|
||||
AssertedScopeKind scopeKind,
|
||||
MutableHandle<GCVector<JSAtom*>> positionalParams);
|
||||
JS::Result<ParseNode*> parseInterfaceAssertedParameterName(const size_t start, const BinKind kind, const BinFields& fields);
|
||||
JS::Result<Ok> parseInterfaceAssertedParameterScope(const size_t start, const BinKind kind, const BinFields& fields,
|
||||
MutableHandle<GCVector<JSAtom*>> positionalParams);
|
||||
JS::Result<Ok> parseInterfaceAssertedPositionalParameterName(const size_t start, const BinKind kind, const BinFields& fields,
|
||||
AssertedScopeKind scopeKind,
|
||||
MutableHandle<GCVector<JSAtom*>> positionalParams);
|
||||
JS::Result<Ok> parseInterfaceAssertedRestParameterName(const size_t start, const BinKind kind, const BinFields& fields,
|
||||
AssertedScopeKind scopeKind,
|
||||
MutableHandle<GCVector<JSAtom*>> positionalParams);
|
||||
JS::Result<ParseNode*> parseInterfaceAssertedRestParameterName(const size_t start, const BinKind kind, const BinFields& fields);
|
||||
JS::Result<Ok> parseInterfaceAssertedScriptGlobalScope(const size_t start, const BinKind kind, const BinFields& fields);
|
||||
JS::Result<Ok> parseInterfaceAssertedVarScope(const size_t start, const BinKind kind, const BinFields& fields);
|
||||
JS::Result<ParseNode*> parseInterfaceAssignmentExpression(const size_t start, const BinKind kind, const BinFields& fields);
|
||||
|
@ -241,8 +241,17 @@ BinASTParser<Tok>::buildFunctionBox(GeneratorKind generatorKind,
|
||||
|
||||
if (parseContext_ && syntax == FunctionSyntaxKind::Statement) {
|
||||
auto ptr = parseContext_->varScope().lookupDeclaredName(atom);
|
||||
MOZ_ASSERT(ptr);
|
||||
ptr->value()->alterKind(DeclarationKind::BodyLevelFunction);
|
||||
if (!ptr) {
|
||||
return raiseError("FunctionDeclaration without corresponding AssertedDeclaredName.");
|
||||
}
|
||||
|
||||
// FIXME: Should be merged with ParseContext::tryDeclareVarHelper
|
||||
// (bug 1499044).
|
||||
DeclarationKind declaredKind = ptr->value()->kind();
|
||||
if (DeclarationKindIsVar(declaredKind)) {
|
||||
MOZ_ASSERT(declaredKind != DeclarationKind::VarForAnnexBLexicalFunction);
|
||||
ptr->value()->alterKind(DeclarationKind::BodyLevelFunction);
|
||||
}
|
||||
}
|
||||
|
||||
// Allocate the function before walking down the tree.
|
||||
@ -472,52 +481,84 @@ template<typename Tok> JS::Result<Ok>
|
||||
BinASTParser<Tok>::checkPositionalParameterIndices(Handle<GCVector<JSAtom*>> positionalParams,
|
||||
ListNode* params)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
// positionalParams should have the same length as non-rest parameters.
|
||||
size_t paramsCount = params->count();
|
||||
if (paramsCount > 0) {
|
||||
if (params->last()->isKind(ParseNodeKind::Spread)) {
|
||||
paramsCount--;
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(positionalParams.get().length() == paramsCount);
|
||||
#endif
|
||||
// positionalParams should have the corresponding entry up to the last
|
||||
// positional parameter.
|
||||
|
||||
// `positionalParams` corresponds to `expectedParams` parameter in the spec.
|
||||
// `params` corresponds to `parseTree` in 3.1.9 CheckAssertedScope, and
|
||||
// `positionalParamNames` parameter
|
||||
|
||||
// Steps 1-3.
|
||||
// PositionalParameterNames (3.1.9 CheckAssertedScope step 5.d) and
|
||||
// CreatePositionalParameterIndices (3.1.5 CheckPositionalParameterIndices
|
||||
// step 1) are done implicitly.
|
||||
uint32_t i = 0;
|
||||
const bool hasRest = parseContext_->functionBox()->hasRest();
|
||||
for (ParseNode* param : params->contents()) {
|
||||
if (param->isKind(ParseNodeKind::Assign)) {
|
||||
param = param->as<AssignmentNode>().left();
|
||||
}
|
||||
if (param->isKind(ParseNodeKind::Spread)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(param->isKind(ParseNodeKind::Name) ||
|
||||
param->isKind(ParseNodeKind::Object) ||
|
||||
param->isKind(ParseNodeKind::Array));
|
||||
// At this point, function body is not part of params list.
|
||||
const bool isRest = hasRest && !param->pn_next;
|
||||
if (isRest) {
|
||||
// Rest parameter
|
||||
|
||||
if (JSAtom* name = positionalParams.get()[i]) {
|
||||
// Step 3.
|
||||
if (i >= positionalParams.get().length()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (positionalParams.get()[i]) {
|
||||
return raiseError("Expected positional parameter per AssertedParameterScope.paramNames, got rest parameter");
|
||||
}
|
||||
} else if (param->isKind(ParseNodeKind::Name)) {
|
||||
// Simple or default parameter.
|
||||
if (param->isKind(ParseNodeKind::Object) || param->isKind(ParseNodeKind::Array)) {
|
||||
return raiseError("AssertedPositionalParameterName: expected positional parameter, got destructuring parameter");
|
||||
}
|
||||
if (param->isKind(ParseNodeKind::Spread)) {
|
||||
return raiseError("AssertedPositionalParameterName: expected positional parameter, got rest parameter");
|
||||
|
||||
// Step 2.a.
|
||||
if (i >= positionalParams.get().length()) {
|
||||
return raiseError("AssertedParameterScope.paramNames doesn't have corresponding entry to positional parameter");
|
||||
}
|
||||
|
||||
if (param->name() != name) {
|
||||
return raiseError("AssertedPositionalParameterName: name mismatch");
|
||||
JSAtom* name = positionalParams.get()[i];
|
||||
if (!name) {
|
||||
// Step 2.a.ii.1.
|
||||
return raiseError("Expected destructuring/rest parameter per AssertedParameterScope.paramNames, got positional parameter");
|
||||
}
|
||||
|
||||
// Step 2.a.i.
|
||||
if (param->name() != name) {
|
||||
// Step 2.a.ii.1.
|
||||
return raiseError("Name mismatch between AssertedPositionalParameterName in AssertedParameterScope.paramNames and actual parameter");
|
||||
}
|
||||
|
||||
// Step 2.a.i.1.
|
||||
// Implicitly done.
|
||||
} else {
|
||||
// Destructuring or rest parameter.
|
||||
if (param->isKind(ParseNodeKind::Name)) {
|
||||
return raiseError("AssertedParameterName/AssertedRestParameterName: expected destructuring/rest parameter, got positional parameter");
|
||||
// Destructuring parameter.
|
||||
|
||||
MOZ_ASSERT(param->isKind(ParseNodeKind::Object) ||
|
||||
param->isKind(ParseNodeKind::Array));
|
||||
|
||||
// Step 3.
|
||||
if (i >= positionalParams.get().length()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (positionalParams.get()[i]) {
|
||||
return raiseError("Expected positional parameter per AssertedParameterScope.paramNames, got destructuring parameter");
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
// Step 3.
|
||||
if (positionalParams.get().length() > params->count()) {
|
||||
// `positionalParams` has unchecked entries.
|
||||
return raiseError("AssertedParameterScope.paramNames has unmatching items than the actual parameters");
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
@ -271,29 +271,39 @@ AssertedMaybePositionalParameterName:
|
||||
MutableHandle<GCVector<JSAtom*>> positionalParams
|
||||
extra-args: |
|
||||
scopeKind, positionalParams
|
||||
sum-arms:
|
||||
AssertedRestParameterName:
|
||||
disabled: true
|
||||
AssertedParameterName:
|
||||
disabled: true
|
||||
|
||||
AssertedPositionalParameterName:
|
||||
inherits: AssertedMaybePositionalParameterName
|
||||
fields:
|
||||
name:
|
||||
after: |
|
||||
// FIXME: The following checks should be performed inside
|
||||
// checkPositionalParameterIndices to match the spec's order
|
||||
// (bug 1490976).
|
||||
if (index >= positionalParams.get().length()) {
|
||||
return raiseError("AssertedPositionalParameterName.length out of range");
|
||||
// `positionalParams` vector can be shorter than the actual
|
||||
// parameter length. Resize on demand.
|
||||
// (see also ListOfAssertedMaybePositionalParameterName)
|
||||
size_t prevLength = positionalParams.get().length();
|
||||
if (index >= prevLength) {
|
||||
// This is implementation limit, which is not in the spec.
|
||||
size_t newLength = index + 1;
|
||||
if (newLength >= ARGNO_LIMIT) {
|
||||
return raiseError("AssertedPositionalParameterName.index is too big");
|
||||
}
|
||||
|
||||
BINJS_TRY(positionalParams.get().resize(newLength));
|
||||
for (uint32_t i = prevLength; i < newLength; i++) {
|
||||
positionalParams.get()[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (positionalParams.get()[index]) {
|
||||
return raiseError("AssertedPositionalParameterName has duplicate entry for the same index");
|
||||
}
|
||||
positionalParams.get()[index] = name;
|
||||
|
||||
AssertedRestParameterName:
|
||||
inherits: AssertedMaybePositionalParameterName
|
||||
|
||||
AssertedParameterName:
|
||||
inherits: AssertedMaybePositionalParameterName
|
||||
|
||||
AssertedBoundNamesScope:
|
||||
inherits: AssertedBlockScope
|
||||
init: |
|
||||
@ -839,8 +849,7 @@ FormalParameters:
|
||||
build: |
|
||||
auto result = items;
|
||||
if (rest) {
|
||||
BINJS_TRY_DECL(spread, factory_.newSpread(start, rest));
|
||||
factory_.addList(result, spread);
|
||||
return raiseError("Rest parameter is not supported in this preview release");
|
||||
}
|
||||
|
||||
ForStatement:
|
||||
@ -909,13 +918,14 @@ ListOfAssertedMaybePositionalParameterName:
|
||||
init: |
|
||||
(void) start;
|
||||
auto result = Ok();
|
||||
if (length >= ARGNO_LIMIT) {
|
||||
return raiseError("Too many function parameters");
|
||||
}
|
||||
BINJS_TRY(positionalParams.get().resize(length));
|
||||
for (uint32_t i = 0; i < length; i++) {
|
||||
positionalParams.get()[i] = nullptr;
|
||||
}
|
||||
// This list contains also destructuring parameters, and the number of
|
||||
// list items can be greater than the actual parameters, or more than
|
||||
// ARGNO_LIMIT even if the number of parameters fits into ARGNO_LIMIT.
|
||||
// Also, the number of parameters can be greater than this list's length
|
||||
// if one of destructuring parameter is empty.
|
||||
//
|
||||
// We resize `positionalParams` vector on demand, to keep the vector
|
||||
// length match to the known maximum positional parameter index + 1.
|
||||
|
||||
ListOfAssertedDeclaredName:
|
||||
inherits: ListOfAssertedBoundName
|
||||
|
@ -1397,7 +1397,7 @@ PerHandlerParser<ParseHandler>::noteDestructuredPositionalFormalParameter(CodeNo
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
bool
|
||||
DeclarationKindIsVar(DeclarationKind kind)
|
||||
{
|
||||
return kind == DeclarationKind::Var ||
|
||||
|
@ -1700,6 +1700,10 @@ JSFunction*
|
||||
AllocNewFunction(JSContext* cx, HandleAtom atom, FunctionSyntaxKind kind, GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
|
||||
HandleObject proto, bool isSelfHosting = false, bool inFunctionBox = false);
|
||||
|
||||
// Returns true if the declaration is `var` or equivalent.
|
||||
bool
|
||||
DeclarationKindIsVar(DeclarationKind kind);
|
||||
|
||||
} /* namespace frontend */
|
||||
} /* namespace js */
|
||||
|
||||
|
@ -58,6 +58,9 @@ struct FieldRules {
|
||||
#[derive(Clone, Default)]
|
||||
struct SumRules {
|
||||
after_arm: Option<String>,
|
||||
|
||||
// Disable this arm (false by default).
|
||||
disabled: bool,
|
||||
}
|
||||
|
||||
|
||||
@ -355,6 +358,15 @@ impl GlobalRules {
|
||||
update_rule(&mut sum_rule.after_arm, arm_config_entry)
|
||||
.unwrap_or_else(|()| panic!("Rule {}.sum-arms.{}.{} must be a string", node_key, sum_arm_key, arm_config_key));
|
||||
}
|
||||
"disabled" => {
|
||||
if let Some(disabled) = arm_config_entry.as_bool() {
|
||||
if disabled {
|
||||
sum_rule.disabled = true;
|
||||
}
|
||||
} else {
|
||||
panic!("Rule {}.sum-arms.{}.{} must be a bool", node_key, sum_arm_key, arm_config_key);
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
panic!("Unexpected {}.sum-arms.{}.{}", node_key, sum_arm_key, arm_config_key);
|
||||
}
|
||||
@ -1180,6 +1192,18 @@ impl CPPExporter {
|
||||
// Generate inner method
|
||||
let mut buffer_cases = String::new();
|
||||
for node in nodes {
|
||||
let rule_for_this_arm = rules_for_this_sum.by_sum.get(&node)
|
||||
.cloned()
|
||||
.unwrap_or_default();
|
||||
|
||||
if rule_for_this_arm.disabled {
|
||||
buffer_cases.push_str(&format!("
|
||||
case BinKind::{variant_name}:
|
||||
return raiseError(\"FIXME: Not implemented yet in this preview release ({variant_name})\");",
|
||||
variant_name = node.to_cpp_enum_case()));
|
||||
continue;
|
||||
}
|
||||
|
||||
buffer_cases.push_str(&format!("
|
||||
case BinKind::{variant_name}:
|
||||
{call}
|
||||
@ -1190,9 +1214,7 @@ impl CPPExporter {
|
||||
MethodCallKind::AlwaysVar)
|
||||
.reindent(" "),
|
||||
variant_name = node.to_cpp_enum_case(),
|
||||
arm_after = rules_for_this_sum.by_sum.get(&node)
|
||||
.cloned()
|
||||
.unwrap_or_default().after_arm.reindent(" ")
|
||||
arm_after = rule_for_this_arm.after_arm.reindent(" ")
|
||||
.newline_if_not_empty()));
|
||||
}
|
||||
buffer.push_str(&format!("\n{first_line}
|
||||
@ -1248,7 +1270,7 @@ impl CPPExporter {
|
||||
let rendered = format!("
|
||||
{first_line}
|
||||
{{
|
||||
return raiseError(\"FIXME: Not implemented yet ({kind})\");
|
||||
return raiseError(\"FIXME: Not implemented yet in this preview release ({kind})\");
|
||||
}}\n",
|
||||
first_line = first_line,
|
||||
kind = kind,
|
||||
@ -1458,7 +1480,7 @@ impl CPPExporter {
|
||||
if build_result.len() == 0 {
|
||||
buffer.push_str(&format!("{first_line}
|
||||
{{
|
||||
return raiseError(\"FIXME: Not implemented yet ({kind})\");
|
||||
return raiseError(\"FIXME: Not implemented yet in this preview release ({kind})\");
|
||||
}}
|
||||
|
||||
",
|
||||
@ -1487,7 +1509,7 @@ impl CPPExporter {
|
||||
if build_result.len() == 0 {
|
||||
buffer.push_str(&format!("{first_line}
|
||||
{{
|
||||
return raiseError(\"FIXME: Not implemented yet ({kind})\");
|
||||
return raiseError(\"FIXME: Not implemented yet in this preview release ({kind})\");
|
||||
}}
|
||||
|
||||
",
|
||||
@ -1517,7 +1539,7 @@ impl CPPExporter {
|
||||
if build_result.len() == 0 {
|
||||
buffer.push_str(&format!("{first_line}
|
||||
{{
|
||||
return raiseError(\"FIXME: Not implemented yet ({kind})\");
|
||||
return raiseError(\"FIXME: Not implemented yet in this preview release ({kind})\");
|
||||
}}
|
||||
|
||||
",
|
||||
@ -1763,7 +1785,7 @@ impl CPPExporter {
|
||||
if build_result == "" {
|
||||
buffer.push_str(&format!("{first_line}
|
||||
{{
|
||||
return raiseError(\"FIXME: Not implemented yet ({class_name})\");
|
||||
return raiseError(\"FIXME: Not implemented yet in this preview release ({class_name})\");
|
||||
}}
|
||||
|
||||
",
|
||||
|
@ -26,13 +26,6 @@ use std::fs::File;
|
||||
use std::io::prelude::*;
|
||||
use std::path::PathBuf;
|
||||
|
||||
enum Arch {
|
||||
X86,
|
||||
X64,
|
||||
Arm,
|
||||
Aarch64
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// Tell Cargo to regenerate the bindings if the header file changes.
|
||||
println!("cargo:rerun-if-changed=baldrapi.h");
|
||||
@ -52,69 +45,6 @@ fn main() {
|
||||
.clang_args(&["-x", "c++", "-std=gnu++14", "-fno-sized-deallocation", "-DRUST_BINDGEN"])
|
||||
.clang_arg("-I../..");
|
||||
|
||||
let arch = {
|
||||
let target_arch = env::var("CARGO_CFG_TARGET_ARCH");
|
||||
match target_arch.as_ref().map(|x| x.as_str()) {
|
||||
Ok("aarch64") => Some(Arch::Aarch64),
|
||||
Ok("arm") => Some(Arch::Arm),
|
||||
Ok("x86") => Some(Arch::X86),
|
||||
Ok("x86_64") => Some(Arch::X64),
|
||||
_ => None
|
||||
}
|
||||
};
|
||||
|
||||
match env::var("CARGO_CFG_TARGET_OS").as_ref().map(|x| x.as_str()) {
|
||||
Ok("android") => {
|
||||
bindings = bindings.clang_arg("-DOS_ANDROID=1");
|
||||
bindings = match arch.expect("unknown android architecture") {
|
||||
Arch::Aarch64 => { bindings.clang_arg("--target=aarch64-linux-android") }
|
||||
Arch::Arm => { bindings.clang_arg("--target=armv7-linux-androideabi") }
|
||||
Arch::X86 => { bindings.clang_arg("--target=i686-linux-android") }
|
||||
Arch::X64 => { bindings.clang_arg("--target=x86_64-linux-android") }
|
||||
};
|
||||
}
|
||||
|
||||
Ok("linux") | Ok("freebsd") | Ok("dragonfly") | Ok("openbsd") | Ok("bitrig") | Ok("netbsd")
|
||||
| Ok("ios") => {
|
||||
// Nothing to do in particular for these OSes, until proven the contrary.
|
||||
}
|
||||
|
||||
Ok("macos") => {
|
||||
bindings = bindings.clang_arg("-DOS_MACOSX=1");
|
||||
bindings = bindings.clang_arg("-stdlib=libc++");
|
||||
bindings = bindings.clang_arg("--target=x86_64-apple-darwin");
|
||||
}
|
||||
|
||||
Ok("windows") => {
|
||||
let arch = arch.expect("unknown Windows architecture");
|
||||
bindings = bindings.clang_arg("-DOS_WIN=1")
|
||||
.clang_arg("-DWIN32=1");
|
||||
bindings = match env::var("CARGO_CFG_TARGET_ENV").as_ref().map(|x| x.as_str()) {
|
||||
Ok("msvc") => {
|
||||
bindings = bindings.clang_arg("-fms-compatibility-version=19");
|
||||
bindings = bindings.clang_arg("-D_CRT_USE_BUILTIN_OFFSETOF");
|
||||
bindings = bindings.clang_arg("-DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1");
|
||||
match arch {
|
||||
Arch::X86 => { bindings.clang_arg("--target=i686-pc-win32") },
|
||||
Arch::X64 => { bindings.clang_arg("--target=x86_64-pc-win32") },
|
||||
Arch::Aarch64 => { bindings.clang_arg("--target=aarch64-pc-windows-msvc") }
|
||||
_ => panic!("unknown Windows architecture for msvc build")
|
||||
}
|
||||
}
|
||||
Ok("gnu") => {
|
||||
match arch {
|
||||
Arch::X86 => { bindings.clang_arg("--target=i686-pc-mingw32") },
|
||||
Arch::X64 => { bindings.clang_arg("--target=x86_64-w64-mingw32") },
|
||||
_ => panic!("unknown Windows architecture for gnu build")
|
||||
}
|
||||
}
|
||||
_ => panic!("unknown Windows build environment")
|
||||
};
|
||||
}
|
||||
|
||||
os => panic!("unknown target os {:?}!", os)
|
||||
}
|
||||
|
||||
let path = PathBuf::from(env::var_os("MOZ_TOPOBJDIR").unwrap()).join("js/src/rust/extra-bindgen-flags");
|
||||
|
||||
let mut extra_flags = String::new();
|
||||
|
13
layout/reftests/bugs/1149304-1-transform-change-ref.html
Normal file
13
layout/reftests/bugs/1149304-1-transform-change-ref.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
body { transform:translateY(10px); white-space: pre; }
|
||||
p { margin: 0; }
|
||||
span { padding: 2px; color: red; background: blue; }
|
||||
</style>
|
||||
</head>
|
||||
<body><p> <span> </span> </p>
|
||||
</body>
|
||||
</html>
|
23
layout/reftests/bugs/1149304-1-transform-change.html
Normal file
23
layout/reftests/bugs/1149304-1-transform-change.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
body { transform:translateY(100px); white-space: pre; }
|
||||
p { margin: 0; }
|
||||
span { padding: 2px; color: red; background: blue; }
|
||||
</style>
|
||||
<script>
|
||||
function test(n) {
|
||||
document.body.style.transform = "translateY(" + n + "px)";
|
||||
if (n > 10) {
|
||||
setTimeout("test(" + (n - 10) + ")", 0);
|
||||
} else {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="test(100)"><p> <span> </span> </p>
|
||||
</body>
|
||||
</html>
|
@ -1939,6 +1939,7 @@ skip-if(!Android) fails-if(Android) == 1133905-3-vh-rtl.html 1133905-ref-vh-rtl.
|
||||
skip-if(!Android) == 1133905-4-vh-rtl.html 1133905-ref-vh-rtl.html
|
||||
skip-if(!Android) fails-if(Android) == 1133905-5-vh-rtl.html 1133905-ref-vh-rtl.html
|
||||
skip-if(!Android) fails-if(Android) == 1133905-6-vh-rtl.html 1133905-ref-vh-rtl.html
|
||||
== 1149304-1-transform-change.html 1149304-1-transform-change-ref.html
|
||||
== 1150021-1.xul 1150021-1-ref.xul
|
||||
== 1151145-1.html 1151145-1-ref.html
|
||||
== 1151306-1.html 1151306-1-ref.html
|
||||
|
@ -1,61 +1,3 @@
|
||||
[build]
|
||||
args = [
|
||||
"-x", "c++", "-std=gnu++14", "-fno-sized-deallocation",
|
||||
"-DTRACING=1", "-DIMPL_LIBXUL", "-DMOZ_STYLO_BINDINGS=1",
|
||||
"-DMOZILLA_INTERNAL_API", "-DRUST_BINDGEN"
|
||||
]
|
||||
"family=unix" = ["-DOS_POSIX=1"]
|
||||
"os=solaris" = ["-DOS_SOLARIS=1"]
|
||||
"os=dragonfly" = ["-DOS_BSD=1", "-DOS_DRAGONFLY=1"]
|
||||
"os=freebsd" = ["-DOS_BSD=1", "-DOS_FREEBSD=1"]
|
||||
"os=netbsd" = ["-DOS_BSD=1", "-DOS_NETBSD=1"]
|
||||
"os=openbsd" = ["-DOS_BSD=1", "-DOS_OPENBSD=1"]
|
||||
"os=macos" = [
|
||||
"-DOS_MACOSX=1", "-stdlib=libc++",
|
||||
# To disable the fixup bindgen applies which adds search
|
||||
# paths from clang command line in order to avoid potential
|
||||
# conflict with -stdlib=libc++.
|
||||
"--target=x86_64-apple-darwin",
|
||||
]
|
||||
|
||||
[build."os=linux"]
|
||||
args = ["-DOS_LINUX=1"]
|
||||
"arch=x86" = ["-m32"]
|
||||
"arch=x86_64" = ["-m64"]
|
||||
|
||||
[build."os=android"]
|
||||
args = ["-DOS_ANDROID=1"]
|
||||
"arch=aarch64" = ["--target=aarch64-linux-android"]
|
||||
"arch=arm" = ["--target=armv7-linux-androideabi"]
|
||||
"arch=x86" = ["--target=i686-linux-android"]
|
||||
"arch=x86_64" = ["--target=x86_64-linux-android"]
|
||||
|
||||
[build."os=windows"]
|
||||
args = [
|
||||
"-DOS_WIN=1", "-DWIN32=1",
|
||||
]
|
||||
|
||||
[build."os=windows"."env=msvc"]
|
||||
args = [
|
||||
# For compatibility with MSVC 2015
|
||||
"-fms-compatibility-version=19",
|
||||
# To enable the builtin __builtin_offsetof so that CRT wouldn't
|
||||
# use reinterpret_cast in offsetof() which is not allowed inside
|
||||
# static_assert().
|
||||
"-D_CRT_USE_BUILTIN_OFFSETOF",
|
||||
# Enable hidden attribute (which is not supported by MSVC and
|
||||
# thus not enabled by default with a MSVC-compatibile build)
|
||||
# to exclude hidden symbols from the generated file.
|
||||
"-DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1",
|
||||
]
|
||||
"arch=x86" = ["--target=i686-pc-win32"]
|
||||
"arch=x86_64" = ["--target=x86_64-pc-win32"]
|
||||
"arch=aarch64" = ["--target=aarch64-pc-windows-msvc"]
|
||||
|
||||
[build."os=windows"."env=gnu"]
|
||||
"arch=x86" = ["--target=i686-pc-mingw32"]
|
||||
"arch=x86_64" = ["--target=x86_64-w64-mingw32"]
|
||||
|
||||
[structs]
|
||||
headers = [
|
||||
"nsStyleStruct.h",
|
||||
|
@ -45,17 +45,6 @@
|
||||
*/
|
||||
#if defined(CHROMIUM_SANDBOX_BUILD) && defined(XP_WIN)
|
||||
#include "base/win/sdkdecls.h"
|
||||
|
||||
#ifdef __MINGW32__
|
||||
/*
|
||||
* MinGW doesn't support __try / __except. There are a few mechanisms available
|
||||
* to hack around it and pseudo-support it, but these are untested in Firefox.
|
||||
* What is tested (and works) is replacing them with if(true) and else.
|
||||
*/
|
||||
#define __try if(true)
|
||||
#define __except(x) else
|
||||
|
||||
#endif /* __MINGW32__ */
|
||||
#endif /* defined(CHROMIUM_SANDBOX_BUILD) && defined(XP_WIN) */
|
||||
|
||||
#endif /* MOZILLA_CONFIG_H */
|
||||
|
@ -1,51 +0,0 @@
|
||||
# HG changeset patch
|
||||
# User Tom Ritter <tom@mozilla.com>
|
||||
# Date 1516389982 21600
|
||||
# Fri Jan 19 13:26:22 2018 -0600
|
||||
# Node ID 3ca7306d73ebc1ce47ccdc62ee8cbb69a9bfbb2c
|
||||
# Parent 6aa6c7d894609140ccde2e9e50eba8c25a9caeb5
|
||||
Bug 1431803 Disable a specific __try block on MinGW r?bobowen
|
||||
|
||||
This function is a technique to name a thread for debugging purposes,
|
||||
and it always throws an exception (and then continues). On MinGW
|
||||
we don't want it to throw an exception, so we do nothing.
|
||||
|
||||
This means on MinGW we won't get nice thread naming during debugging,
|
||||
but we'll limp along.
|
||||
|
||||
MozReview-Commit-ID: JRKY4wp7sdu
|
||||
|
||||
diff --git a/security/sandbox/chromium/base/threading/platform_thread_win.cc b/security/sandbox/chromium/base/threading/platform_thread_win.cc
|
||||
--- a/security/sandbox/chromium/base/threading/platform_thread_win.cc
|
||||
+++ b/security/sandbox/chromium/base/threading/platform_thread_win.cc
|
||||
@@ -32,27 +32,30 @@ typedef struct tagTHREADNAME_INFO {
|
||||
} THREADNAME_INFO;
|
||||
|
||||
// The SetThreadDescription API was brought in version 1607 of Windows 10.
|
||||
typedef HRESULT(WINAPI* SetThreadDescription)(HANDLE hThread,
|
||||
PCWSTR lpThreadDescription);
|
||||
|
||||
// This function has try handling, so it is separated out of its caller.
|
||||
void SetNameInternal(PlatformThreadId thread_id, const char* name) {
|
||||
+ //This function is only used for debugging purposes, as you can find by its caller
|
||||
+#ifndef __MINGW32__
|
||||
THREADNAME_INFO info;
|
||||
info.dwType = 0x1000;
|
||||
info.szName = name;
|
||||
info.dwThreadID = thread_id;
|
||||
info.dwFlags = 0;
|
||||
|
||||
__try {
|
||||
RaiseException(kVCThreadNameException, 0, sizeof(info)/sizeof(DWORD),
|
||||
reinterpret_cast<DWORD_PTR*>(&info));
|
||||
} __except(EXCEPTION_CONTINUE_EXECUTION) {
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
struct ThreadParams {
|
||||
PlatformThread::Delegate* delegate;
|
||||
bool joinable;
|
||||
ThreadPriority priority;
|
||||
};
|
||||
|
@ -18,6 +18,5 @@ mingw_copy_s.patch
|
||||
mingw_operator_new.patch
|
||||
mingw_cast_getprocaddress.patch
|
||||
mingw_capitalization.patch
|
||||
mingw_disable_one_try.patch
|
||||
mingw_noexports_casts.patch
|
||||
mingw_offsetof.patch
|
||||
mingw_offsetof.patch
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "permissionsService.h"
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <winternl.h>
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -37,8 +37,6 @@ typedef HRESULT(WINAPI* SetThreadDescription)(HANDLE hThread,
|
||||
|
||||
// This function has try handling, so it is separated out of its caller.
|
||||
void SetNameInternal(PlatformThreadId thread_id, const char* name) {
|
||||
//This function is only used for debugging purposes, as you can find by its caller
|
||||
#ifndef __MINGW32__
|
||||
THREADNAME_INFO info;
|
||||
info.dwType = 0x1000;
|
||||
info.szName = name;
|
||||
@ -50,7 +48,6 @@ void SetNameInternal(PlatformThreadId thread_id, const char* name) {
|
||||
reinterpret_cast<DWORD_PTR*>(&info));
|
||||
} __except(EXCEPTION_CONTINUE_EXECUTION) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
struct ThreadParams {
|
||||
|
@ -58,22 +58,10 @@ mod bindings {
|
||||
};
|
||||
static ref BUILD_CONFIG: Table = {
|
||||
// Load build-specific config overrides.
|
||||
// FIXME: We should merge with CONFIG above instead of
|
||||
// forcing callers to do it.
|
||||
let path = PathBuf::from(env::var_os("MOZ_TOPOBJDIR").unwrap())
|
||||
.join("layout/style/bindgen.toml");
|
||||
read_config(&path)
|
||||
};
|
||||
static ref TARGET_INFO: HashMap<String, String> = {
|
||||
const TARGET_PREFIX: &'static str = "CARGO_CFG_TARGET_";
|
||||
let mut result = HashMap::new();
|
||||
for (k, v) in env::vars() {
|
||||
if k.starts_with(TARGET_PREFIX) {
|
||||
result.insert(k[TARGET_PREFIX.len()..].to_lowercase(), v);
|
||||
}
|
||||
}
|
||||
result
|
||||
};
|
||||
static ref INCLUDE_RE: Regex = Regex::new(r#"#include\s*"(.+?)""#).unwrap();
|
||||
static ref DISTDIR_PATH: PathBuf = {
|
||||
let path = PathBuf::from(env::var_os("MOZ_DIST").unwrap());
|
||||
@ -145,35 +133,6 @@ mod bindings {
|
||||
fn mutable_borrowed_type(self, ty: &str) -> Builder;
|
||||
}
|
||||
|
||||
fn add_clang_args(mut builder: Builder, config: &Table, matched_os: &mut bool) -> Builder {
|
||||
fn add_args(mut builder: Builder, values: &[toml::Value]) -> Builder {
|
||||
for item in values.iter() {
|
||||
builder = builder.clang_arg(item.as_str().expect("Expect string in list"));
|
||||
}
|
||||
builder
|
||||
}
|
||||
for (k, v) in config.iter() {
|
||||
if k == "args" {
|
||||
builder = add_args(builder, v.as_array().unwrap().as_slice());
|
||||
continue;
|
||||
}
|
||||
let equal_idx = k.find('=').expect(&format!("Invalid key: {}", k));
|
||||
let (target_type, target_value) = k.split_at(equal_idx);
|
||||
if TARGET_INFO[target_type] != target_value[1..] {
|
||||
continue;
|
||||
}
|
||||
if target_type == "os" {
|
||||
*matched_os = true;
|
||||
}
|
||||
builder = match *v {
|
||||
toml::Value::Table(ref table) => add_clang_args(builder, table, matched_os),
|
||||
toml::Value::Array(ref array) => add_args(builder, array),
|
||||
_ => panic!("Unknown type"),
|
||||
};
|
||||
}
|
||||
builder
|
||||
}
|
||||
|
||||
impl BuilderExt for Builder {
|
||||
fn get_initial_builder() -> Builder {
|
||||
use bindgen::RustTarget;
|
||||
@ -207,16 +166,14 @@ mod bindings {
|
||||
builder = builder.clang_arg("-DDEBUG=1").clang_arg("-DJS_DEBUG=1");
|
||||
}
|
||||
|
||||
let mut matched_os = false;
|
||||
let build_config = CONFIG["build"].as_table().expect("Malformed config file");
|
||||
builder = add_clang_args(builder, build_config, &mut matched_os);
|
||||
let build_config = BUILD_CONFIG["build"]
|
||||
.as_table()
|
||||
.expect("Malformed config file");
|
||||
builder = add_clang_args(builder, build_config, &mut matched_os);
|
||||
if !matched_os {
|
||||
panic!("Unknown platform");
|
||||
let extra_bindgen_flags = build_config["args"].as_array().unwrap().as_slice();
|
||||
for item in extra_bindgen_flags.iter() {
|
||||
builder = builder.clang_arg(item.as_str().expect("Expect string in list"));
|
||||
}
|
||||
|
||||
builder
|
||||
}
|
||||
fn include<T: Into<String>>(self, file: T) -> Builder {
|
||||
|
@ -7,6 +7,7 @@ mozinfo>=0.8
|
||||
mozprocess>=0.22
|
||||
mozversion>=1.3
|
||||
mozprofile>=0.25
|
||||
mozrunner>=7.1.0
|
||||
psutil>=3.1.1
|
||||
simplejson>=2.1.1
|
||||
requests>=2.9.1
|
||||
|
@ -8,7 +8,7 @@ from __future__ import absolute_import, print_function
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from cmanager_base import CounterManager
|
||||
from talos.cmanager_base import CounterManager
|
||||
|
||||
|
||||
def GetProcessData(pid):
|
||||
|
@ -10,8 +10,8 @@ from ctypes import windll
|
||||
from ctypes.wintypes import DWORD, HANDLE, LPSTR, LPCSTR, LPCWSTR, Structure, \
|
||||
pointer, LONG
|
||||
|
||||
from cmanager_base import CounterManager
|
||||
from utils import TalosError
|
||||
from talos.cmanager_base import CounterManager
|
||||
from talos.utils import TalosError
|
||||
|
||||
pdh = windll.pdh
|
||||
|
||||
|
@ -7,8 +7,8 @@ from __future__ import absolute_import, print_function
|
||||
|
||||
import os
|
||||
import re
|
||||
import utils
|
||||
import whitelist
|
||||
from talos import utils
|
||||
from talos import whitelist
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
"""output formats for Talos"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import filter
|
||||
from talos import filter
|
||||
# NOTE: we have a circular dependency with output.py when we import results
|
||||
import simplejson as json
|
||||
import utils
|
||||
from talos import utils
|
||||
from mozlog import get_proxy_logger
|
||||
|
||||
LOG = get_proxy_logger()
|
||||
|
@ -16,7 +16,8 @@ import urllib
|
||||
import mozhttpd
|
||||
import mozinfo
|
||||
import mozversion
|
||||
import utils
|
||||
|
||||
from talos import utils
|
||||
from mozlog import get_proxy_logger
|
||||
from talos.config import get_configs, ConfigurationError
|
||||
from talos.mitmproxy import mitmproxy
|
||||
|
@ -14,7 +14,7 @@ import mozcrash
|
||||
import psutil
|
||||
from mozlog import get_proxy_logger
|
||||
from mozprocess import ProcessHandler
|
||||
from utils import TalosError
|
||||
from talos.utils import TalosError
|
||||
|
||||
LOG = get_proxy_logger()
|
||||
|
||||
|
@ -23,13 +23,14 @@ import time
|
||||
|
||||
import mozcrash
|
||||
import mozfile
|
||||
import results
|
||||
import talosconfig
|
||||
import utils
|
||||
|
||||
from mozlog import get_proxy_logger
|
||||
from talos.cmanager import CounterManagement
|
||||
from talos.ffsetup import FFSetup
|
||||
from talos.talos_process import run_browser
|
||||
from talos import utils
|
||||
from talos import results
|
||||
from talos import talosconfig
|
||||
from talos.utils import TalosCrash, TalosError, TalosRegression, run_in_debug_mode
|
||||
|
||||
LOG = get_proxy_logger()
|
||||
|
@ -8,7 +8,7 @@ from __future__ import absolute_import, print_function
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import utils
|
||||
from talos import utils
|
||||
|
||||
KEY_XRE = '{xre}'
|
||||
DEFAULT_DURATION = 100.0
|
||||
|
@ -1,5 +0,0 @@
|
||||
[EventListener-addEventListener.sub.window.html]
|
||||
expected: TIMEOUT
|
||||
[EventListener.addEventListener doesn't throw when a cross origin object is passed in.]
|
||||
expected: TIMEOUT
|
||||
|
@ -1,9 +0,0 @@
|
||||
[EventListener-incumbent-global-1.sub.html]
|
||||
expected:
|
||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): TIMEOUT
|
||||
if debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): TIMEOUT
|
||||
[Check the incumbent global EventListeners are called with]
|
||||
expected:
|
||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): TIMEOUT
|
||||
if debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): TIMEOUT
|
||||
|
@ -1,6 +1,6 @@
|
||||
async_test(function(t) {
|
||||
let crossOriginFrame = document.createElement('iframe');
|
||||
crossOriginFrame.src = 'https://{{hosts[alt][]}}/common/blank.html';
|
||||
crossOriginFrame.src = 'https://{{hosts[alt][]}}:{{ports[https][0]}}/common/blank.html';
|
||||
document.body.appendChild(crossOriginFrame);
|
||||
crossOriginFrame.addEventListener('load', t.step_func_done(function() {
|
||||
let crossOriginWindow = crossOriginFrame.contentWindow;
|
||||
|
@ -4,7 +4,8 @@ AntiTracking.runTest("ServiceWorkers",
|
||||
async _ => {
|
||||
await navigator.serviceWorker.register("empty.js").then(
|
||||
_ => { ok(false, "ServiceWorker cannot be used!"); },
|
||||
_ => { ok(true, "ServiceWorker cannot be used!"); });
|
||||
_ => { ok(true, "ServiceWorker cannot be used!"); }).
|
||||
catch(e => ok(false, "Promise rejected: " + e));
|
||||
},
|
||||
null,
|
||||
async _ => {
|
||||
|
Loading…
Reference in New Issue
Block a user