Merge mozilla-central to autoland. a=merge CLOSED TREE

This commit is contained in:
Margareta Eliza Balazs 2018-12-21 11:42:32 +02:00
Родитель 4a9cd4dfff 413dd3a1fa
Коммит f43dfc843e
97 изменённых файлов: 5348 добавлений и 5492 удалений

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

@ -176,6 +176,7 @@ var whitelist = [
isFromDevTools: true},
{file: "chrome://devtools/skin/images/aboutdebugging-firefox-release.svg",
isFromDevTools: true},
{file: "chrome://devtools/skin/images/next.svg", isFromDevTools: true},
];
whitelist = new Set(whitelist.filter(item =>

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

@ -297,6 +297,13 @@ function init() {
sectionButton.click();
}
}
window.addEventListener("hashchange", function() {
if (location.hash) {
let sectionButton = document.getElementById("category-" + location.hash.substring(1));
sectionButton.click();
}
});
}
function show(button) {

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

@ -400,6 +400,17 @@ var paymentDialogWrapper = {
return savedBasicCards;
},
fetchTempPaymentCards() {
let creditCards = this.temporaryStore.creditCards.getAll();
for (let card of Object.values(creditCards)) {
// Ensure each card has a methodName property.
if (!card.methodName) {
card.methodName = "basic-card";
}
}
return creditCards;
},
async onAutofillStorageChange() {
let [savedAddresses, savedBasicCards] =
await Promise.all([this.fetchSavedAddresses(), this.fetchSavedPaymentCards()]);
@ -521,7 +532,7 @@ var paymentDialogWrapper = {
savedAddresses,
tempAddresses: this.temporaryStore.addresses.getAll(),
savedBasicCards,
tempBasicCards: this.temporaryStore.creditCards.getAll(),
tempBasicCards: this.fetchTempPaymentCards(),
isPrivate,
});
},
@ -719,7 +730,7 @@ var paymentDialogWrapper = {
// there will be no formautofill-storage-changed event to update state
// so add updated collection here
Object.assign(responseMessage.stateChange, {
tempBasicCards: this.temporaryStore.creditCards.getAll(),
tempBasicCards: this.fetchTempPaymentCards(),
});
}
} catch (ex) {

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

@ -244,24 +244,29 @@ var paymentRequest = {
/**
* @param {object} state object representing the UI state
* @param {string} methodID (GUID) uniquely identifying the selected payment method
* @param {string} selectedMethodID (GUID) uniquely identifying the selected payment method
* @returns {object?} the applicable modifier for the payment method
*/
getModifierForPaymentMethod(state, methodID) {
let method = state.savedBasicCards[methodID] || null;
if (method && method.methodName !== "basic-card") {
throw new Error(`${method.methodName} (${methodID}) is not a supported payment method`);
getModifierForPaymentMethod(state, selectedMethodID) {
let basicCards = this.getBasicCards(state);
let selectedMethod = basicCards[selectedMethodID] || null;
if (selectedMethod && selectedMethod.methodName !== "basic-card") {
throw new Error(`${selectedMethod.methodName} (${selectedMethodID}) ` +
`is not a supported payment method`);
}
let modifiers = state.request.paymentDetails.modifiers;
if (!modifiers || !modifiers.length) {
if (!selectedMethod || !modifiers || !modifiers.length) {
return null;
}
let modifier = modifiers.find(m => {
let appliedModifier = modifiers.find(modifier => {
// take the first matching modifier
// TODO (bug 1429198): match on supportedNetworks
return m.supportedMethods == "basic-card";
if (modifier.supportedMethods && modifier.supportedMethods != selectedMethod.methodName) {
return false;
}
let supportedNetworks = modifier.data && modifier.data.supportedNetworks || [];
return supportedNetworks.length == 0 || supportedNetworks.includes(selectedMethod["cc-type"]);
});
return modifier || null;
return appliedModifier || null;
},
/**

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

@ -47,6 +47,7 @@ function setup() {
let cardGUID = "john-doe";
let johnDoeCard = deepClone(PTU.BasicCards.JohnDoe);
johnDoeCard.methodName = "basic-card";
johnDoeCard.guid = cardGUID;
let savedBasicCards = {
[cardGUID]: johnDoeCard,
};
@ -185,6 +186,30 @@ add_task(async function test_modified_total() {
is(orderDetails.totalAmountElem.currency, "USD", "total currency uses modifier currency");
});
// The modifier is not applied since the cc network is not supported.
add_task(async function test_non_supported_network() {
setup();
let request = Object.assign({}, requestStore.getState().request);
request.paymentDetails = Object.assign({}, request.paymentDetails, {
totalItem: { label: "foo", amount: { currency: "JPY", value: "5" }},
modifiers: [{
supportedMethods: "basic-card",
total: {
label: "Total due",
amount: { currency: "USD", value: "3.5" },
},
data: {
supportedNetworks: ["mastercard"],
},
}],
});
requestStore.setState({request});
await asyncElementRendered();
is(orderDetails.totalAmountElem.value, "5", "total amount uses modifier total");
is(orderDetails.totalAmountElem.currency, "JPY", "total currency uses modifier currency");
});
</script>
</body>

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

@ -0,0 +1,16 @@
AArch64 Windows uses a five-argument __va_start, just like ARM.
https://bugs.llvm.org/show_bug.cgi?id=39090
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 22483f8..53d9cb2 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -917,6 +917,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
switch (Context.getTargetInfo().getTriple().getArch()) {
case llvm::Triple::arm:
case llvm::Triple::thumb:
+ case llvm::Triple::aarch64:
if (SemaBuiltinVAStartARMMicrosoft(TheCall))
return ExprError();
break;

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

@ -1,22 +1,26 @@
{
"llvm_revision": "348970",
"llvm_revision": "342383",
"stages": "3",
"build_libcxx": false,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/trunk",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/final",
"lld_repo": "https://llvm.org/svn/llvm-project/lld/tags/RELEASE_700/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/final",
"python_path": "c:/mozilla-build/python/python.exe",
"cc": "cl.exe",
"cxx": "cl.exe",
"ml": "ml64.exe",
"patches": [
"workaround-issue38586.patch",
"r342649-hotpatch-8-byte-nops.patch",
"r342652-unpoison-thread-stacks.patch",
"r343123-pin-asan-dll.patch",
"aarch64-vastart-checking.patch",
"downgrade-mangling-error.patch",
"r346300-compiler-rt-windows-mmap.patch",
"loosen-msvc-detection.patch"
]
}

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

@ -0,0 +1,30 @@
[winasan] Reduce hotpatch prefix check to 8 bytes
Same idea as r310419: The 8 byte nop is a suffix of the 9 byte nop, and we need at most 6 bytes.
Differential Revision: https://reviews.llvm.org/D51788
--- a/compiler-rt/lib/interception/interception_win.cc (revision 342648)
+++ b/compiler-rt/lib/interception/interception_win.cc (revision 342649)
@@ -223,8 +223,8 @@
return true;
}
-static const u8 kHintNop9Bytes[] = {
- 0x66, 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
+static const u8 kHintNop8Bytes[] = {
+ 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
};
template<class T>
@@ -239,8 +239,8 @@
static bool FunctionHasPadding(uptr address, uptr size) {
if (IsMemoryPadding(address - size, size))
return true;
- if (size <= sizeof(kHintNop9Bytes) &&
- FunctionHasPrefix(address, kHintNop9Bytes))
+ if (size <= sizeof(kHintNop8Bytes) &&
+ FunctionHasPrefix(address, kHintNop8Bytes))
return true;
return false;
}

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

@ -21,8 +21,8 @@ Differential Revision: https://reviews.llvm.org/D52091
// }}}
namespace __asan {
@@ -169,7 +177,9 @@
@@ -161,7 +169,9 @@
void InitializePlatformInterceptors() {
ASAN_INTERCEPT_FUNC(CreateThread);
ASAN_INTERCEPT_FUNC(SetUnhandledExceptionFilter);
-

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

@ -0,0 +1,27 @@
------------------------------------------------------------------------
r343123 | dmajor | 2018-09-26 12:28:39 -0400 (Wed, 26 Sep 2018) | 5 lines
[winasan] Pin the ASan DLL to prevent unloading
Differential Revision: https://reviews.llvm.org/D52505
===================================================================
--- a/compiler-rt/lib/asan/asan_win.cc (revision 343122)
+++ b/compiler-rt/lib/asan/asan_win.cc (revision 343123)
@@ -167,6 +167,14 @@
namespace __asan {
void InitializePlatformInterceptors() {
+ // The interceptors were not designed to be removable, so we have to keep this
+ // module alive for the life of the process.
+ HMODULE pinned;
+ CHECK(GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
+ GET_MODULE_HANDLE_EX_FLAG_PIN,
+ (LPCWSTR)&InitializePlatformInterceptors,
+ &pinned));
+
ASAN_INTERCEPT_FUNC(CreateThread);
ASAN_INTERCEPT_FUNC(SetUnhandledExceptionFilter);
CHECK(::__interception::OverrideFunction("NtTerminateThread",
------------------------------------------------------------------------

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

@ -0,0 +1,149 @@
From 0b881f23c6f2a637ab97d71e964cc3743fef98b8 Mon Sep 17 00:00:00 2001
From: Marco Castelluccio <mcastelluccio@mozilla.com>
Date: Wed, 7 Nov 2018 09:38:26 +0000
Subject: [PATCH] [GCOV] Close file mapping handle on Windows, so flushed gcda
files can be removed while the process is in execution
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346300 91177308-0d34-0410-b5e6-96231b3b80d8
---
lib/profile/GCDAProfiling.c | 49 +++++++++++++++++++
lib/profile/WindowsMMap.c | 8 ---
lib/profile/WindowsMMap.h | 8 +++
.../instrprof-gcov-__gcov_flush-multiple.c | 16 ++++++
...nstrprof-gcov-__gcov_flush-multiple.c.gcov | 21 ++++++++
.../instrprof-gcov-__gcov_flush-multiple.test | 10 ++++
6 files changed, 104 insertions(+), 8 deletions(-)
create mode 100644 test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c
create mode 100644 test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov
create mode 100644 test/profile/instrprof-gcov-__gcov_flush-multiple.test
diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c
index cbca36551..0665a680c 100644
--- a/compiler-rt/lib/profile/GCDAProfiling.c
+++ b/compiler-rt/lib/profile/GCDAProfiling.c
@@ -29,6 +29,8 @@
#include <string.h>
#if defined(_WIN32)
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
#include "WindowsMMap.h"
#else
#include <sys/mman.h>
@@ -86,6 +88,9 @@ static uint64_t cur_buffer_size = 0;
static uint64_t cur_pos = 0;
static uint64_t file_size = 0;
static int new_file = 0;
+#if defined(_WIN32)
+static HANDLE mmap_handle = NULL;
+#endif
static int fd = -1;
typedef void (*fn_ptr)();
@@ -255,6 +260,28 @@ static int map_file() {
if (file_size == 0)
return -1;
+#if defined(_WIN32)
+ HANDLE mmap_fd;
+ if (fd == -1)
+ mmap_fd = INVALID_HANDLE_VALUE;
+ else
+ mmap_fd = (HANDLE)_get_osfhandle(fd);
+
+ mmap_handle = CreateFileMapping(mmap_fd, NULL, PAGE_READWRITE, DWORD_HI(file_size), DWORD_LO(file_size), NULL);
+ if (mmap_handle == NULL) {
+ fprintf(stderr, "profiling: %s: cannot create file mapping: %d\n", filename,
+ GetLastError());
+ return -1;
+ }
+
+ write_buffer = MapViewOfFile(mmap_handle, FILE_MAP_WRITE, 0, 0, file_size);
+ if (write_buffer == NULL) {
+ fprintf(stderr, "profiling: %s: cannot map: %d\n", filename,
+ GetLastError());
+ CloseHandle(mmap_handle);
+ return -1;
+ }
+#else
write_buffer = mmap(0, file_size, PROT_READ | PROT_WRITE,
MAP_FILE | MAP_SHARED, fd, 0);
if (write_buffer == (void *)-1) {
@@ -263,10 +290,30 @@ static int map_file() {
strerror(errnum));
return -1;
}
+#endif
+
return 0;
}
static void unmap_file() {
+#if defined(_WIN32)
+ if (!FlushViewOfFile(write_buffer, file_size)) {
+ fprintf(stderr, "profiling: %s: cannot flush mapped view: %d\n", filename,
+ GetLastError());
+ }
+
+ if (!UnmapViewOfFile(write_buffer)) {
+ fprintf(stderr, "profiling: %s: cannot unmap mapped view: %d\n", filename,
+ GetLastError());
+ }
+
+ if (!CloseHandle(mmap_handle)) {
+ fprintf(stderr, "profiling: %s: cannot close file mapping handle: %d\n", filename,
+ GetLastError());
+ }
+
+ mmap_handle = NULL;
+#else
if (msync(write_buffer, file_size, MS_SYNC) == -1) {
int errnum = errno;
fprintf(stderr, "profiling: %s: cannot msync: %s\n", filename,
@@ -277,6 +324,8 @@ static void unmap_file() {
* is written and we don't care.
*/
(void)munmap(write_buffer, file_size);
+#endif
+
write_buffer = NULL;
file_size = 0;
}
diff --git a/compiler-rt/lib/profile/WindowsMMap.c b/compiler-rt/lib/profile/WindowsMMap.c
index dc87a888a..41cc67f41 100644
--- a/compiler-rt/lib/profile/WindowsMMap.c
+++ b/compiler-rt/lib/profile/WindowsMMap.c
@@ -24,14 +24,6 @@
#include "InstrProfiling.h"
-#ifdef __USE_FILE_OFFSET64
-# define DWORD_HI(x) (x >> 32)
-# define DWORD_LO(x) ((x) & 0xffffffff)
-#else
-# define DWORD_HI(x) (0)
-# define DWORD_LO(x) (x)
-#endif
-
COMPILER_RT_VISIBILITY
void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
{
diff --git a/compiler-rt/lib/profile/WindowsMMap.h b/compiler-rt/lib/profile/WindowsMMap.h
index ac2c911c8..51a130b31 100644
--- a/compiler-rt/lib/profile/WindowsMMap.h
+++ b/compiler-rt/lib/profile/WindowsMMap.h
@@ -45,6 +45,14 @@
#define LOCK_NB 4 /* don't block when locking */
#define LOCK_UN 8 /* unlock */
+#ifdef __USE_FILE_OFFSET64
+# define DWORD_HI(x) (x >> 32)
+# define DWORD_LO(x) ((x) & 0xffffffff)
+#else
+# define DWORD_HI(x) (0)
+# define DWORD_LO(x) (x)
+#endif
+
void *mmap(void *start, size_t length, int prot, int flags, int fd,
off_t offset);

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

@ -1601,8 +1601,6 @@ def security_hardening_cflags(hardening_flag, asan, optimize, c_compiler, target
flags = []
js_flags = []
ldflags = []
js_ldflags = []
# FORTIFY_SOURCE ------------------------------------
# If hardening is explicitly enabled, or not explicitly disabled
@ -1625,14 +1623,6 @@ def security_hardening_cflags(hardening_flag, asan, optimize, c_compiler, target
if target.os != 'WINNT' or c_compiler == 'gcc':
flags.append("-fstack-protector-strong")
if c_compiler.type == 'clang-cl':
flags.append("-guard:cf")
js_flags.append("-guard:cf")
# nolongjmp is needed because clang doesn't emit the CFG tables of
# setjmp return addresses https://bugs.llvm.org/show_bug.cgi?id=40057
ldflags.append("-guard:cf,nolongjmp")
js_ldflags.append("-guard:cf,nolongjmp")
# If ASAN _is_ on, undefine FOTIFY_SOURCE just to be safe
if asan:
flags.append("-U_FORTIFY_SOURCE")
@ -1648,16 +1638,12 @@ def security_hardening_cflags(hardening_flag, asan, optimize, c_compiler, target
return namespace(
flags=flags,
ldflags=ldflags,
js_flags=js_flags,
js_ldflags=js_ldflags,
)
add_old_configure_assignment('MOZ_HARDENING_CFLAGS', security_hardening_cflags.flags)
add_old_configure_assignment('MOZ_HARDENING_LDFLAGS', security_hardening_cflags.ldflags)
add_old_configure_assignment('MOZ_HARDENING_CFLAGS_JS', security_hardening_cflags.js_flags)
add_old_configure_assignment('MOZ_HARDENING_LDFLAGS_JS', security_hardening_cflags.js_ldflags)
# Code Coverage
# ==============================================================

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

@ -1,9 +1,9 @@
This is the debugger.html project output.
See https://github.com/devtools-html/debugger.html
Version 109
Version 110
Comparison: https://github.com/devtools-html/debugger.html/compare/release-108...release-109
Comparison: https://github.com/devtools-html/debugger.html/compare/release-109...release-110
Packages:
- babel-plugin-transform-es2015-modules-commonjs @6.26.2

162
devtools/client/debugger/new/dist/debugger.css поставляемый
Просмотреть файл

@ -649,6 +649,14 @@ button:focus {
.min-width-0 {
min-width: 0;
}
/*
Prevents horizontal scrollbar from displaying when
right pane collapsed (#7505)
*/
.split-box > .splitter:last-child {
display: none;
}
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -1039,72 +1047,72 @@ menuseparator {
width: 15px;
}
img.domain,
img.folder {
.img.domain,
.img.folder {
width: 15px;
height: 15px;
}
img.extension {
.img.extension {
width: 13px;
height: 13px;
margin-inline-start: 2px;
}
img.result-item-icon {
.img.result-item-icon {
height: 18px;
width: 18px;
}
img.domain {
.img.domain {
mask: url("resource://devtools/client/debugger/new/images/domain.svg") no-repeat;
}
img.folder {
.img.folder {
mask: url("resource://devtools/client/debugger/new/images/folder.svg") no-repeat;
}
img.coffeescript {
.img.coffeescript {
mask: url("resource://devtools/client/debugger/new/images/coffeescript.svg") no-repeat;
}
img.javascript {
.img.javascript {
mask: url("resource://devtools/client/debugger/new/images/javascript.svg") no-repeat;
}
img.tab {
.img.tab {
mask: url("resource://devtools/client/debugger/new/images/tab.svg") no-repeat;
}
img.react {
.img.react {
mask: url("resource://devtools/client/debugger/new/images/react.svg") no-repeat;
}
img.typescript {
.img.typescript {
mask: url("resource://devtools/client/debugger/new/images/typescript.svg") no-repeat;
}
img.extension {
.img.extension {
mask: url("resource://devtools/client/debugger/new/images/extension.svg") no-repeat;
}
img.file {
.img.file {
mask: url("resource://devtools/client/debugger/new/images/file.svg") no-repeat;
width: 13px;
height: 13px;
}
img.domain,
img.folder,
img.file,
.sources-list img.source-icon,
img.extension {
.img.domain,
.img.folder,
.img.file,
.sources-list .img.source-icon,
.img.extension {
mask-size: 100%;
margin-inline-end: 5px;
display: inline-block;
}
img.result-item-icon {
.img.result-item-icon {
mask-size: 100%;
margin-inline-end: 15px;
margin-inline-start: 5px;
@ -1117,7 +1125,7 @@ img.result-item-icon {
margin-inline-end: 5px;
}
img.arrow {
.img.arrow {
mask: url("resource://devtools/client/debugger/new/images/arrow.svg");
margin-inline-end: 5px;
margin-top: 3px;
@ -1132,11 +1140,11 @@ img.arrow {
transition: transform 0.18s ease;
}
html[dir="ltr"] img.arrow {
html[dir="ltr"] .img.arrow {
transform: rotate(-90deg);
}
html[dir="rtl"] img.arrow {
html[dir="rtl"] .img.arrow {
transform: rotate(90deg);
}
@ -1249,6 +1257,13 @@ html[dir="rtl"] .managed-tree .tree .node > div {
.managed-tree .tree-node button {
position: fixed;
}
.img {
/* default height an width which will likely be overrode */
width: 12px;
height: 12px;
/* makes span appear like an image */
display: inline-block;
}
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
@ -1276,7 +1291,7 @@ html[dir="rtl"] .managed-tree .tree .node > div {
margin-top: 0;
}
.close-btn:hover img.close {
.close-btn:hover .img.close {
background-color: white;
}
@ -1288,7 +1303,7 @@ html[dir="rtl"] .managed-tree .tree .node > div {
background-color: var(--theme-selection-background);
}
.close-btn:focus img.close {
.close-btn:focus .img.close {
background-color: white;
}
@ -1425,6 +1440,11 @@ html .toggle-button.end.vertical svg {
width: 22px;
}
.search-field i.loader {
padding-top: 4px;
margin-right: 8px;
}
.search-field input {
border: none;
line-height: 30px;
@ -1739,7 +1759,6 @@ html .toggle-button.end.vertical svg {
overflow-x: auto;
overflow-y: auto;
height: 100%;
padding: 4px 0;
}
.sources-list {
@ -1755,17 +1774,22 @@ html .toggle-button.end.vertical svg {
overflow-y: auto;
}
.sources-list .managed-tree .tree-node:first-child {
margin-top: 4px;
}
.sources-list .managed-tree .tree .node {
padding: 0 10px 0 3px;
width: 100%;
}
.sources-list .tree img.arrow {
.sources-list .tree .img.arrow {
margin-right: 5px;
}
.sources-list .tree .focused img.arrow {
background-color: white;
.sources-list .tree .focused img:not(.vue):not(.angular),
.sources-list .managed-tree .tree .node.focused img.blackBox {
background: #ffffff;
}
.sources-list .tree .label .suffix {
@ -1778,7 +1802,7 @@ html .toggle-button.end.vertical svg {
color: inherit;
}
.sources-list .tree img.arrow.expanded {
.sources-list .tree .img.arrow.expanded {
transform: rotate(0deg);
}
@ -1883,7 +1907,7 @@ html .toggle-button.end.vertical svg {
overflow: auto;
}
.sources-list .managed-tree .tree .node img.blackBox {
.sources-list .managed-tree .tree .node .img.blackBox {
mask: url("resource://devtools/client/debugger/new/images/blackBox.svg") no-repeat;
mask-size: 100%;
background-color: var(--theme-highlight-blue);
@ -1895,22 +1919,14 @@ html .toggle-button.end.vertical svg {
margin-top: 2px;
}
.sources-list .managed-tree .tree .node.focused img {
background-color: white;
}
.theme-dark .sources-list .managed-tree .tree .node:not(.focused) img.blackBox {
.theme-dark .sources-list .managed-tree .tree .node:not(.focused) .img.blackBox {
background-color: var(--theme-comment);
}
.theme-dark .sources-list .managed-tree .tree .node img.blackBox {
.theme-dark .sources-list .managed-tree .tree .node .img.blackBox {
background-color: var(--theme-body-color);
}
.theme-dark .sources-list .managed-tree .tree .node.focused img.blackBox {
background-color: white;
}
/*
Custom root styles
*/
@ -2278,7 +2294,7 @@ menuseparator {
padding: 6px;
}
.source-footer > .commands > .action img {
.source-footer > .commands > .action .img {
height: 100%;
display: flex;
flex-direction: column;
@ -2303,21 +2319,21 @@ menuseparator {
margin: 0 4px;
}
.source-footer > .commands > .action > img.prettyPrint {
.source-footer > .commands > .action > .img.prettyPrint {
mask: url("resource://devtools/client/debugger/new/images/prettyPrint.svg") no-repeat;
height: 16px;
width: 16px;
background: var(--theme-body-color);
}
.source-footer > .commands > .action > img.blackBox {
.source-footer > .commands > .action > .img.blackBox {
mask: url("resource://devtools/client/debugger/new/images/blackBox.svg") no-repeat;
height: 16px;
width: 16px;
background: var(--theme-body-color);
}
.source-footer > .commands > .blackboxed > img.blackBox {
.source-footer > .commands > .blackboxed > .img.blackBox {
background: var(--theme-highlight-blue);
}
@ -2408,7 +2424,7 @@ menuseparator {
border-radius: 3px;
}
.search-bottom-bar .search-modifiers button.close-btn.big img {
.search-bottom-bar .search-modifiers button.close-btn.big .img {
width: 12px;
height: 12px;
}
@ -3795,59 +3811,59 @@ html[dir="rtl"] .command-bar {
background-color: var(--theme-toolbar-background);
}
img.pause,
img.stepOver,
img.stepIn,
img.stepOut,
img.resume,
img.rewind,
img.reverseStepOver,
img.reverseStepIn,
img.reverseStepOut,
img.replay-previous,
img.replay-next,
img.resume,
img.shortcuts,
img.skipPausing {
.img.pause,
.img.stepOver,
.img.stepIn,
.img.stepOut,
.img.resume,
.img.rewind,
.img.reverseStepOver,
.img.reverseStepIn,
.img.reverseStepOut,
.img.replay-previous,
.img.replay-next,
.img.resume,
.img.shortcuts,
.img.skipPausing {
background-color: var(--theme-body-color);
}
.command-bar img.pause {
.command-bar .img.pause {
mask: url("resource://devtools/client/debugger/new/images/pause.svg") no-repeat;
}
.command-bar img.stepOver {
.command-bar .img.stepOver {
mask: url("resource://devtools/client/debugger/new/images/stepOver.svg") no-repeat;
}
.command-bar img.stepIn {
.command-bar .img.stepIn {
mask: url("resource://devtools/client/debugger/new/images/stepIn.svg") no-repeat;
}
.command-bar img.stepOut {
.command-bar .img.stepOut {
mask: url("resource://devtools/client/debugger/new/images/stepOut.svg") no-repeat;
}
.command-bar img.resume {
.command-bar .img.resume {
mask: url("resource://devtools/client/debugger/new/images/resume.svg") no-repeat;
}
.command-bar img.rewind {
.command-bar .img.rewind {
mask: url("resource://devtools/client/debugger/new/images/resume.svg") no-repeat;
transform: scaleX(-1);
}
.command-bar img.reverseStepOver {
.command-bar .img.reverseStepOver {
mask: url("resource://devtools/client/debugger/new/images/stepOver.svg") no-repeat;
transform: scaleX(-1);
}
.command-bar img.reverseStepIn {
.command-bar .img.reverseStepIn {
mask: url("resource://devtools/client/debugger/new/images/stepIn.svg") no-repeat;
transform: scaleX(-1);
}
.command-bar img.reverseStepOut {
.command-bar .img.reverseStepOut {
mask: url("resource://devtools/client/debugger/new/images/stepOut.svg") no-repeat;
transform: scaleX(-1);
}
@ -3856,7 +3872,7 @@ img.skipPausing {
flex-grow: 1;
}
.command-bar img.shortcuts {
.command-bar .img.shortcuts {
mask: url("resource://devtools/client/debugger/new/images/help.svg") no-repeat;
mask-size: contain;
}
@ -4323,7 +4339,7 @@ html .welcomebox .toggle-button-end.collapsed {
margin-inline-end: 0;
}
.source-tab img.prettyPrint,
.source-tab .img.prettyPrint,
.source-tab .source-icon.blackBox {
height: 12px;
width: 12px;
@ -4334,7 +4350,7 @@ html .welcomebox .toggle-button-end.collapsed {
fill: var(--theme-textbox-box-shadow);
}
.source-tab img.react {
.source-tab .img.react {
mask: url("resource://devtools/client/debugger/new/images/react.svg") no-repeat;
mask-size: 100%;
height: 14px;
@ -4361,7 +4377,7 @@ img.moreTabs {
margin-left: 6px;
}
html[dir="rtl"] img.moreTabs {
html[dir="rtl"] .img.moreTabs {
transform: rotate(180deg);
margin-right: 6px;
}
@ -4562,7 +4578,7 @@ html[dir="rtl"] .dropdown {
mask-position: 2px 4px;
}
.result-list li img.result-item-icon {
.result-list li .img.result-item-icon {
width: 16px;
height: 16px;
}

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

@ -773,11 +773,6 @@ module.exports = overArg;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
exports.parse = parse;
exports.parseConsoleScript = parseConsoleScript;
exports.parseScript = parseScript;
@ -808,12 +803,15 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
let ASTs = new Map();
let ASTs = new Map(); /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
function _parse(code, opts) {
return babelParser.parse(code, _extends({}, opts, {
return babelParser.parse(code, {
...opts,
tokens: true
}));
});
}
const sourceOptions = {
@ -853,9 +851,10 @@ function htmlParser({ source, line }) {
const VUE_COMPONENT_START = /^\s*</;
function vueParser({ source, line }) {
return parse(source, _extends({
startLine: line
}, sourceOptions.original));
return parse(source, {
startLine: line,
...sourceOptions.original
});
}
function parseVueScript(code) {
if (typeof code !== "string") {
@ -881,11 +880,11 @@ function parseVueScript(code) {
}
function parseConsoleScript(text, opts) {
return _parse(text, _extends({
plugins: ["objectRestSpread"]
}, opts, {
return _parse(text, {
plugins: ["objectRestSpread"],
...opts,
allowAwaitOutsideFunction: true
}));
});
}
function parseScript(text, opts) {
@ -914,9 +913,10 @@ function getAst(sourceId) {
const options = sourceOptions[type];
ast = parse(source.text, options);
} else if (contentType && contentType.match(/typescript/)) {
const options = _extends({}, sourceOptions.original, {
const options = {
...sourceOptions.original,
plugins: [...sourceOptions.original.plugins.filter(p => p !== "flow" && p !== "decorators" && p !== "decorators2" && (p !== "jsx" || contentType.match(/typescript-jsx/))), "decorators-legacy", "typescript"]
});
};
ast = parse(source.text, options);
}
@ -1282,11 +1282,6 @@ function nodeContainsPosition(node, position) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
exports.clearSymbols = clearSymbols;
exports.getSymbols = getSymbols;
@ -1312,6 +1307,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
let symbolDeclarations = new Map();
function getFunctionParameterNames(path) {
@ -1461,7 +1460,7 @@ function extractSymbol(path, symbols) {
if (path.node.typeAnnotation) {
const column = path.node.typeAnnotation.loc.start.column;
end = _extends({}, end, { column });
end = { ...end, column };
}
symbols.identifiers.push({
@ -1992,10 +1991,6 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
var _get = __webpack_require__(67);
var _get2 = _interopRequireDefault(_get);
@ -2014,6 +2009,10 @@ var _getSymbols = __webpack_require__(1457);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
function findSymbols(source) {
const { functions, comments } = (0, _getSymbols.getSymbols)(source);
return { functions, comments };
@ -2026,7 +2025,7 @@ function findSymbols(source) {
*/
function getLocation(func) {
const location = _extends({}, func.location);
const location = { ...func.location };
// if the function has an identifier, start the block after it so the
// identifier is included in the "scope" of its parent
@ -2130,11 +2129,6 @@ exports.default = findOutOfScopeLocations;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
exports.getNextStep = getNextStep;
var _types = __webpack_require__(2268);
@ -2162,7 +2156,9 @@ function getNextStep(sourceId, pausedPosition) {
}
return _getNextStep(currentStatement, sourceId, pausedPosition);
}
} /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
function getSteppableExpression(sourceId, pausedPosition) {
const closestPath = (0, _closest.getClosestPath)(sourceId, pausedPosition);
@ -2181,9 +2177,10 @@ function getSteppableExpression(sourceId, pausedPosition) {
function _getNextStep(statement, sourceId, position) {
const nextStatement = statement.getSibling(1);
if (nextStatement) {
return _extends({}, nextStatement.node.loc.start, {
return {
...nextStatement.node.loc.start,
sourceId: sourceId
});
};
}
return null;

44
devtools/client/debugger/new/dist/vendors.css поставляемый
Просмотреть файл

@ -218,72 +218,72 @@ html[dir="rtl"] .tree-node button.arrow {
width: 15px;
}
img.domain,
img.folder {
.img.domain,
.img.folder {
width: 15px;
height: 15px;
}
img.extension {
.img.extension {
width: 13px;
height: 13px;
margin-inline-start: 2px;
}
img.result-item-icon {
.img.result-item-icon {
height: 18px;
width: 18px;
}
img.domain {
.img.domain {
mask: url("resource://devtools/client/debugger/new/images/domain.svg") no-repeat;
}
img.folder {
.img.folder {
mask: url("resource://devtools/client/debugger/new/images/folder.svg") no-repeat;
}
img.coffeescript {
.img.coffeescript {
mask: url("resource://devtools/client/debugger/new/images/coffeescript.svg") no-repeat;
}
img.javascript {
.img.javascript {
mask: url("resource://devtools/client/debugger/new/images/javascript.svg") no-repeat;
}
img.tab {
.img.tab {
mask: url("resource://devtools/client/debugger/new/images/tab.svg") no-repeat;
}
img.react {
.img.react {
mask: url("resource://devtools/client/debugger/new/images/react.svg") no-repeat;
}
img.typescript {
.img.typescript {
mask: url("resource://devtools/client/debugger/new/images/typescript.svg") no-repeat;
}
img.extension {
.img.extension {
mask: url("resource://devtools/client/debugger/new/images/extension.svg") no-repeat;
}
img.file {
.img.file {
mask: url("resource://devtools/client/debugger/new/images/file.svg") no-repeat;
width: 13px;
height: 13px;
}
img.domain,
img.folder,
img.file,
.sources-list img.source-icon,
img.extension {
.img.domain,
.img.folder,
.img.file,
.sources-list .img.source-icon,
.img.extension {
mask-size: 100%;
margin-inline-end: 5px;
display: inline-block;
}
img.result-item-icon {
.img.result-item-icon {
mask-size: 100%;
margin-inline-end: 15px;
margin-inline-start: 5px;
@ -296,7 +296,7 @@ img.result-item-icon {
margin-inline-end: 5px;
}
img.arrow {
.img.arrow {
mask: url("resource://devtools/client/debugger/new/images/arrow.svg");
margin-inline-end: 5px;
margin-top: 3px;
@ -311,11 +311,11 @@ img.arrow {
transition: transform 0.18s ease;
}
html[dir="ltr"] img.arrow {
html[dir="ltr"] .img.arrow {
transform: rotate(-90deg);
}
html[dir="rtl"] img.arrow {
html[dir="rtl"] .img.arrow {
transform: rotate(90deg);
}

2972
devtools/client/debugger/new/dist/vendors.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

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

@ -20,8 +20,6 @@ DevToolsModules(
'folder.svg',
'help.svg',
'javascript.svg',
'next-circle.svg',
'next.svg',
'pause.svg',
'prettyPrint.svg',
'react.svg',

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

@ -7,7 +7,7 @@
import {
getSource,
getSourceFromId,
hasSymbols,
getSymbols,
getSelectedLocation,
isPaused
} from "../selectors";
@ -21,12 +21,7 @@ import { setInScopeLines } from "./ast/setInScopeLines";
import { setPausePoints } from "./ast/setPausePoints";
export { setPausePoints };
import {
getSymbols,
findOutOfScopeLocations,
getFramework,
type AstPosition
} from "../workers/parser";
import * as parser from "../workers/parser";
import { isLoaded } from "../utils/source";
@ -40,7 +35,7 @@ export function setSourceMetaData(sourceId: SourceId) {
return;
}
const framework = await getFramework(source.id);
const framework = await parser.getFramework(source.id);
if (framework) {
dispatch(updateTab(source, framework));
}
@ -61,14 +56,14 @@ export function setSymbols(sourceId: SourceId) {
return async ({ dispatch, getState, sourceMaps }: ThunkArgs) => {
const source = getSourceFromId(getState(), sourceId);
if (source.isWasm || hasSymbols(getState(), source) || !isLoaded(source)) {
if (source.isWasm || getSymbols(getState(), source) || !isLoaded(source)) {
return;
}
await dispatch({
type: "SET_SYMBOLS",
sourceId,
[PROMISE]: getSymbols(sourceId)
[PROMISE]: parser.getSymbols(sourceId)
});
if (isPaused(getState())) {
@ -92,9 +87,9 @@ export function setOutOfScopeLocations() {
let locations = null;
if (location.line && source && !source.isWasm && isPaused(getState())) {
locations = await findOutOfScopeLocations(
locations = await parser.findOutOfScopeLocations(
source.id,
((location: any): AstPosition)
((location: any): parser.AstPosition)
);
}

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

@ -9,6 +9,7 @@ import * as parser from "../../workers/parser";
import { isGenerated } from "../../utils/source";
import { mapPausePoints } from "../../utils/pause/pausePoints";
import { features } from "../../utils/prefs";
import { getGeneratedLocation } from "../../utils/source-maps";
import type { SourceId } from "../../types";
import type { ThunkArgs, Action } from "../types";
@ -26,12 +27,17 @@ function compressPausePoints(pausePoints) {
return compressed;
}
async function mapLocations(pausePoints, source, sourceMaps) {
async function mapLocations(pausePoints, state, source, sourceMaps) {
const sourceId = source.id;
return mapPausePoints(pausePoints, async ({ types, location }) => {
const generatedLocation = await sourceMaps.getGeneratedLocation(
{ ...location, sourceId },
source
const generatedLocation = await getGeneratedLocation(
state,
source,
{
...location,
sourceId
},
sourceMaps
);
return { types, location, generatedLocation };
@ -50,9 +56,12 @@ export function setPausePoints(sourceId: SourceId) {
let pausePoints = await parser.getPausePoints(sourceId);
if (features.columnBreakpoints) {
pausePoints = await mapLocations(pausePoints, source, sourceMaps);
}
pausePoints = await mapLocations(
pausePoints,
getState(),
source,
sourceMaps
);
if (isGenerated(source)) {
const compressed = compressPausePoints(pausePoints);

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

@ -156,10 +156,11 @@ export function toggleBreakpoints(
breakpoints: Breakpoint[]
) {
return async ({ dispatch }: ThunkArgs) => {
const promises = breakpoints.map(breakpoint =>
shouldDisableBreakpoints
? dispatch(disableBreakpoint(breakpoint.location))
: dispatch(enableBreakpoint(breakpoint.location))
const promises = breakpoints.map(
breakpoint =>
shouldDisableBreakpoints
? dispatch(disableBreakpoint(breakpoint.location))
: dispatch(enableBreakpoint(breakpoint.location))
);
await Promise.all(promises);
@ -374,7 +375,7 @@ export function toggleDisabledBreakpoint(line: number, column?: number) {
};
}
export function enableXHRBreakpoint(index: number, bp: XHRBreakpoint) {
export function enableXHRBreakpoint(index: number, bp?: XHRBreakpoint) {
return ({ dispatch, getState, client }: ThunkArgs) => {
const xhrBreakpoints = getXHRBreakpoints(getState());
const breakpoint = bp || xhrBreakpoints[index];
@ -392,7 +393,7 @@ export function enableXHRBreakpoint(index: number, bp: XHRBreakpoint) {
};
}
export function disableXHRBreakpoint(index: number, bp: XHRBreakpoint) {
export function disableXHRBreakpoint(index: number, bp?: XHRBreakpoint) {
return ({ dispatch, getState, client }: ThunkArgs) => {
const xhrBreakpoints = getXHRBreakpoints(getState());
const breakpoint = bp || xhrBreakpoints[index];

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

@ -1,10 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// @flow
import type { Action, ThunkArgs } from "./types";
export function setExpandedState(expanded) {
export function setExpandedState(expanded: Set<string>) {
return ({ dispatch, getState }: ThunkArgs) => {
dispatch(
({

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

@ -26,6 +26,7 @@ import {
} from "../../selectors";
import { prefs } from "../../utils/prefs";
import sourceQueue from "../../utils/source-queue";
import type { Source, SourceId } from "../../types";
import type { Action, ThunkArgs } from "../types";
@ -46,20 +47,25 @@ function createOriginalSource(
};
}
function loadSourceMaps(sources) {
return async function({ dispatch, sourceMaps }: ThunkArgs) {
function loadSourceMaps(sources: Source[]) {
return async function({
dispatch,
sourceMaps
}: ThunkArgs): Promise<Promise<Source>[]> {
if (!prefs.clientSourceMapsEnabled) {
return;
return [];
}
let originalSources = await Promise.all(
sources.map(({ id }) => dispatch(loadSourceMap(id)))
);
const sourceList = await Promise.all(
sources.map(async ({ id }) => {
const originalSources = await dispatch(loadSourceMap(id));
sourceQueue.queueSources(originalSources);
return originalSources;
})
)
originalSources = flatten(originalSources).filter(Boolean);
if (originalSources.length > 0) {
await dispatch(newSources(originalSources));
}
await sourceQueue.flush()
return flatten(sourceList);
};
}
@ -68,11 +74,15 @@ function loadSourceMaps(sources) {
* @static
*/
function loadSourceMap(sourceId: SourceId) {
return async function({ dispatch, getState, sourceMaps }: ThunkArgs) {
return async function({
dispatch,
getState,
sourceMaps
}: ThunkArgs): Promise<Source[]> {
const source = getSource(getState(), sourceId);
if (!source || isOriginal(source) || !source.sourceMapURL) {
return;
return [];
}
let urls = null;
@ -97,7 +107,7 @@ function loadSourceMap(sourceId: SourceId) {
source: (({ ...currentSource, sourceMapURL: "" }: any): Source)
}: Action)
);
return;
return [];
}
return urls.map(url => createOriginalSource(url, source, sourceMaps));
@ -197,15 +207,21 @@ export function newSources(sources: Source[]) {
dispatch(({ type: "ADD_SOURCES", sources: sources }: Action));
await dispatch(loadSourceMaps(sources));
for (const source of sources) {
dispatch(checkSelectedSource(source.id));
dispatch(checkPendingBreakpoints(source.id));
}
// We would like to restore the blackboxed state
// after loading all states to make sure the correctness.
await dispatch(restoreBlackBoxedSources(sources));
dispatch(restoreBlackBoxedSources(sources));
dispatch(loadSourceMaps(sources)).then(() => {
// We would like to sync breakpoints after we are done
// loading source maps as sometimes generated and original
// files share the same paths.
for (const source of sources) {
dispatch(checkPendingBreakpoints(source.id));
}
});
};
}

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

@ -127,7 +127,7 @@ export function togglePaneCollapse(
export function highlightLineRange(location: {
start: number,
end: number,
sourceId: number
sourceId: string
}) {
return {
type: "HIGHLIGHT_LINES",
@ -138,7 +138,7 @@ export function highlightLineRange(location: {
export function flashLineRange(location: {
start: number,
end: number,
sourceId: number
sourceId: string
}) {
return ({ dispatch }: ThunkArgs) => {
dispatch(highlightLineRange(location));

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

@ -32,7 +32,7 @@ function setupEvents(dependencies: Dependencies) {
threadClient = dependencies.threadClient;
actions = dependencies.actions;
supportsWasm = dependencies.supportsWasm;
sourceQueue.initialize({ actions, supportsWasm, createSource });
sourceQueue.initialize(actions);
if (threadClient) {
Object.keys(clientEvents).forEach(eventName => {
@ -98,7 +98,7 @@ function resumed(_: "resumed", packet: ResumedPacket) {
}
function newSource(_: "newSource", { source }: SourcePacket) {
sourceQueue.queue(source);
sourceQueue.queue(createSource(source, { supportsWasm }));
}
function workerListChanged() {

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

@ -63,13 +63,13 @@ type Props = {
endPanelCollapsed: boolean,
activeSearch: string,
quickOpenEnabled: boolean,
setActiveSearch: string => void,
closeActiveSearch: () => void,
closeProjectSearch: () => void,
openQuickOpen: (query?: string) => void,
closeQuickOpen: () => void,
setOrientation: OrientationType => void,
canRewind: boolean
canRewind: boolean,
setActiveSearch: typeof actions.setActiveSearch,
closeActiveSearch: typeof actions.closeActiveSearch,
closeProjectSearch: typeof actions.closeProjectSearch,
openQuickOpen: typeof actions.openQuickOpen,
closeQuickOpen: typeof actions.closeQuickOpen,
setOrientation: typeof actions.setOrientation
};
type State = {

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

@ -20,7 +20,8 @@ class ColumnBreakpoints extends Component {
props: {
editor: Object,
selectedSource: Source,
columnBreakpoints: ColumnBreakpointType[]
columnBreakpoints: ColumnBreakpointType[],
toggleBreakpoint: (number, ?number) => void
};
render() {

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

@ -22,8 +22,8 @@ type Props = {
setBreakpointCondition: Function,
location: SourceLocation,
editor: Object,
openConditionalPanel: () => void,
closeConditionalPanel: () => void
openConditionalPanel: typeof actions.openConditionalPanel,
closeConditionalPanel: typeof actions.closeConditionalPanel
};
export class ConditionalPanel extends PureComponent<Props> {

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

@ -26,6 +26,7 @@ import { getGeneratedSource } from "../../reducers/sources";
import { shouldShowFooter, shouldShowPrettyPrint } from "../../utils/editor";
import { PaneToggleButton } from "../shared/Button";
import AccessibleImage from "../shared/AccessibleImage";
import type { Source } from "../../types";
@ -42,10 +43,10 @@ type Props = {
endPanelCollapsed: boolean,
editor: Object,
horizontal: boolean,
togglePrettyPrint: string => void,
toggleBlackBox: Object => void,
jumpToMappedLocation: (Source: any) => void,
togglePaneCollapse: () => void
togglePrettyPrint: typeof actions.togglePrettyPrint,
toggleBlackBox: typeof actions.toggleBlackBox,
jumpToMappedLocation: typeof actions.jumpToMappedLocation,
togglePaneCollapse: typeof actions.togglePaneCollapse
};
type State = {
@ -99,7 +100,7 @@ class SourceFooter extends PureComponent<Props, State> {
title={tooltip}
aria-label={tooltip}
>
<img className={type} />
<AccessibleImage className={type} />
</button>
);
}
@ -128,7 +129,7 @@ class SourceFooter extends PureComponent<Props, State> {
title={tooltip}
aria-label={tooltip}
>
<img className="blackBox" />
<AccessibleImage className="blackBox" />
</button>
);
}

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

@ -34,12 +34,9 @@ import "./Popup.css";
import type { EditorRange } from "../../../utils/editor/types";
import type { Coords } from "../../shared/Popover";
import type { Grip } from "../../../types";
type PopupValue = Object | null;
type Props = {
setPopupObjectProperties: (Object, Object) => void,
addExpression: (string, ?Object) => void,
popupObjectProperties: Object,
popoverPos: Object,
value: PopupValue,
@ -48,10 +45,12 @@ type Props = {
range: EditorRange,
editor: any,
editorRef: ?HTMLDivElement,
selectSourceURL: (string, Object) => void,
openLink: string => void,
extra: Object,
openElementInInspector: (grip: Grip) => void
setPopupObjectProperties: typeof actions.setPopupObjectProperties,
addExpression: typeof actions.addExpression,
selectSourceURL: typeof actions.selectSourceURL,
openLink: typeof actions.openLink,
openElementInInspector: typeof actions.openElementInInspectorCommand
};
type State = {
@ -355,7 +354,6 @@ const mapStateToProps = state => ({
const {
addExpression,
selectSourceURL,
selectLocation,
setPopupObjectProperties,
openLink
} = actions;
@ -363,7 +361,6 @@ const {
const mapDispatchToProps = {
addExpression,
selectSourceURL,
selectLocation,
setPopupObjectProperties,
openLink
};

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

@ -23,10 +23,10 @@ type Props = {
selectedSource: Source,
preview: PreviewType,
isPaused: Boolean,
clearPreview: () => void,
setPopupObjectProperties: Object => void,
addExpression: (string, ?Object) => void,
updatePreview: (any, any, any) => void
clearPreview: typeof actions.clearPreview,
setPopupObjectProperties: typeof actions.setPopupObjectProperties,
addExpression: typeof actions.addExpression,
updatePreview: typeof actions.updatePreview
};
type State = {

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

@ -26,7 +26,6 @@ import { scrollList } from "../../utils/result-list";
import classnames from "classnames";
import type { Source } from "../../types";
import type { ActiveSearchType } from "../../reducers/ui";
import type { Modifiers, SearchResults } from "../../reducers/file-search";
import SearchInput from "../shared/SearchInput";
@ -56,21 +55,20 @@ type State = {
};
type Props = {
editor?: SourceEditor,
editor: SourceEditor,
selectedSource?: Source,
searchOn: boolean,
searchResults: SearchResults,
modifiers: Modifiers,
query: string,
toggleFileSearchModifier: string => any,
setFileSearchQuery: string => any,
setActiveSearch: (?ActiveSearchType) => any,
closeFileSearch: SourceEditor => void,
doSearch: (string, SourceEditor) => void,
traverseResults: (boolean, SourceEditor) => void,
updateSearchResults: ({ count: number, index?: number }) => any,
showClose?: boolean,
size?: string
size?: string,
toggleFileSearchModifier: typeof actions.toggleFileSearchModifier,
setFileSearchQuery: typeof actions.setFileSearchQuery,
setActiveSearch: typeof actions.setActiveSearch,
closeFileSearch: typeof actions.closeFileSearch,
doSearch: typeof actions.doSearch,
traverseResults: typeof actions.traverseResults
};
class SearchBar extends Component<Props, State> {
@ -179,18 +177,6 @@ class SearchBar extends Component<Props, State> {
this.props.doSearch(query, this.props.editor);
};
updateSearchResults = (characterIndex, line, matches) => {
const matchIndex = matches.findIndex(
elm => elm.line === line && elm.ch === characterIndex
);
this.props.updateSearchResults({
matches,
matchIndex,
count: matches.length,
index: characterIndex
});
};
traverseResults = (e: SyntheticEvent<HTMLElement>, rev: boolean) => {
e.stopPropagation();
e.preventDefault();
@ -350,6 +336,7 @@ class SearchBar extends Component<Props, State> {
count={count}
placeholder={L10N.getStr("sourceSearch.search.placeholder2")}
summaryMsg={this.buildSummaryMsg()}
isLoading={false}
onChange={this.onChange}
onFocus={this.onFocus}
onBlur={this.onBlur}
@ -389,7 +376,6 @@ export default connect(
setActiveSearch: actions.setActiveSearch,
closeFileSearch: actions.closeFileSearch,
doSearch: actions.doSearch,
traverseResults: actions.traverseResults,
updateSearchResults: actions.updateSearchResults
traverseResults: actions.traverseResults
}
)(SearchBar);

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

@ -45,12 +45,12 @@ type Props = {
selectedSource: Source,
source: Source,
activeSearch: string,
selectSource: string => void,
closeTab: Source => void,
closeTabs: (List<string>) => void,
togglePrettyPrint: string => void,
showSource: string => void,
hasSiblingOfSameName: boolean
hasSiblingOfSameName: boolean,
selectSource: typeof actions.selectSource,
closeTab: typeof actions.closeTab,
closeTabs: typeof actions.closeTabs,
togglePrettyPrint: typeof actions.togglePrettyPrint,
showSource: typeof actions.showSource
};
class Tab extends PureComponent<Props> {

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

@ -20,6 +20,7 @@ import "./Tabs.css";
import Tab from "./Tab";
import { PaneToggleButton } from "../shared/Button";
import Dropdown from "../shared/Dropdown";
import AccessibleImage from "../shared/AccessibleImage";
import type { Source } from "../../types";
@ -31,11 +32,11 @@ type Props = {
horizontal: boolean,
startPanelCollapsed: boolean,
endPanelCollapsed: boolean,
moveTab: (string, number) => void,
closeTab: string => void,
togglePaneCollapse: () => void,
showSource: string => void,
selectSource: string => void
moveTab: typeof actions.moveTab,
closeTab: typeof actions.closeTab,
togglePaneCollapse: typeof actions.togglePaneCollapse,
showSource: typeof actions.showSource,
selectSource: typeof actions.selectSource
};
type State = {
@ -134,7 +135,9 @@ class Tabs extends PureComponent<Props, State> {
const onClick = () => selectSource(source.id);
return (
<li key={source.id} onClick={onClick}>
<img className={`dropdown-icon ${this.getIconClass(source)}`} />
<AccessibleImage
className={`dropdown-icon ${this.getIconClass(source)}`}
/>
{filename}
</li>
);
@ -162,7 +165,7 @@ class Tabs extends PureComponent<Props, State> {
}
const Panel = <ul>{hiddenTabs.map(this.renderDropdownSource)}</ul>;
const icon = <img className="moreTabs" />;
const icon = <AccessibleImage className="moreTabs" />;
return <Dropdown panel={Panel} icon={icon} />;
}

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

@ -85,17 +85,17 @@ export type Props = {
symbols: SymbolDeclarations,
// Actions
openConditionalPanel: (?SourceLocation) => void,
closeConditionalPanel: void => void,
setContextMenu: (string, any) => void,
continueToHere: number => void,
toggleBreakpoint: number => void,
toggleBreakpointsAtLine: number => void,
addOrToggleDisabledBreakpoint: number => void,
jumpToMappedLocation: any => void,
traverseResults: (boolean, Object) => void,
updateViewport: void => void,
closeTab: Source => void
openConditionalPanel: typeof actions.openConditionalPanel,
closeConditionalPanel: typeof actions.closeConditionalPanel,
setContextMenu: typeof actions.setContextMenu,
continueToHere: typeof actions.continueToHere,
toggleBreakpoint: typeof actions.toggleBreakpoint,
toggleBreakpointsAtLine: typeof actions.toggleBreakpointsAtLine,
addOrToggleDisabledBreakpoint: typeof actions.addOrToggleDisabledBreakpoint,
jumpToMappedLocation: typeof actions.jumpToMappedLocation,
traverseResults: typeof actions.traverseResults,
updateViewport: typeof actions.updateViewport,
closeTab: typeof actions.closeTab
};
type State = {

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

@ -38,9 +38,9 @@ type Props = {
alphabetizeOutline: boolean,
onAlphabetizeClick: Function,
selectedLocation: any,
selectLocation: ({ sourceId: string, line: number }) => void,
getFunctionText: Function,
flashLineRange: Function
selectLocation: typeof actions.selectLocation,
flashLineRange: typeof actions.flashLineRange
};
type State = {
@ -274,7 +274,6 @@ export default connect(
mapStateToProps,
{
selectLocation: actions.selectLocation,
getFunctionText: actions.getFunctionText,
flashLineRange: actions.flashLineRange
}
)(Outline);

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

@ -58,9 +58,9 @@ type Props = {
debuggeeUrl: string,
projectRoot: string,
expanded: Set<string> | null,
selectSource: string => mixed,
setExpandedState: (Set<string>) => mixed,
clearProjectDirectoryRoot: () => void
selectSource: typeof actions.selectSource,
setExpandedState: typeof actions.setExpandedState,
clearProjectDirectoryRoot: typeof actions.clearProjectDirectoryRoot
};
type State = {

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

@ -10,6 +10,7 @@ import classnames from "classnames";
import { showMenu } from "devtools-contextmenu";
import SourceIcon from "../shared/SourceIcon";
import AccessibleImage from "../shared/AccessibleImage";
import Svg from "../shared/Svg";
import {
@ -42,8 +43,8 @@ type Props = {
setExpanded: (TreeNode, boolean, boolean) => void,
focusItem: TreeNode => void,
selectItem: TreeNode => void,
clearProjectDirectoryRoot: () => void,
setProjectDirectoryRoot: string => void
clearProjectDirectoryRoot: typeof actions.clearProjectDirectoryRoot,
setProjectDirectoryRoot: typeof actions.setProjectDirectoryRoot
};
type State = {};
@ -57,12 +58,12 @@ class SourceTreeItem extends Component<Props, State> {
} else if (item.path === "ng://") {
return <Svg name="angular" />;
} else if (item.path.startsWith("moz-extension://") && depth === 0) {
return <img className="extension" />;
return <AccessibleImage className="extension" />;
}
if (depth === 0 && projectRoot === "") {
return (
<img
<AccessibleImage
className={classnames("domain", {
debuggee: debuggeeUrl && debuggeeUrl.includes(item.name)
})}
@ -71,7 +72,7 @@ class SourceTreeItem extends Component<Props, State> {
}
if (isDirectory(item)) {
return <img className="folder" />;
return <AccessibleImage className="folder" />;
}
if (source) {
@ -150,7 +151,7 @@ class SourceTreeItem extends Component<Props, State> {
renderItemArrow() {
const { item, expanded } = this.props;
return isDirectory(item) ? (
<img className={classnames("arrow", { expanded })} />
<AccessibleImage className={classnames("arrow", { expanded })} />
) : (
<i className="no-arrow" />
);

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

@ -22,6 +22,7 @@ import Outline from "./Outline";
import SourcesTree from "./SourcesTree";
import type { SourcesMap } from "../../reducers/types";
import type { SelectedPrimaryPaneTabType } from "../../reducers/ui";
type State = {
alphabetizeOutline: boolean
@ -32,9 +33,9 @@ type Props = {
sources: SourcesMap,
horizontal: boolean,
sourceSearchOn: boolean,
setPrimaryPaneTab: string => void,
setActiveSearch: string => void,
closeActiveSearch: () => void
setPrimaryPaneTab: typeof actions.setPrimaryPaneTab,
setActiveSearch: typeof actions.setActiveSearch,
closeActiveSearch: typeof actions.closeActiveSearch
};
class PrimaryPanes extends Component<Props, State> {
@ -46,7 +47,7 @@ class PrimaryPanes extends Component<Props, State> {
};
}
showPane = (selectedPane: string) => {
showPane = (selectedPane: SelectedPrimaryPaneTabType) => {
this.props.setPrimaryPaneTab(selectedPane);
};

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

@ -26,12 +26,11 @@ import {
import Svg from "./shared/Svg";
import ManagedTree from "./shared/ManagedTree";
import SearchInput from "./shared/SearchInput";
import AccessibleImage from "./shared/AccessibleImage";
import type { List } from "immutable";
import type { SourceLocation } from "../types";
import type { ActiveSearchType } from "../reducers/types";
import type { StatusType } from "../reducers/project-text-search";
type Editor = ?Object;
import "./ProjectSearch.css";
@ -65,17 +64,12 @@ type Props = {
results: List<Result>,
status: StatusType,
activeSearch: ActiveSearchType,
closeProjectSearch: () => void,
searchSources: (query: string) => void,
clearSearch: () => void,
selectSpecificLocation: (location: SourceLocation, tabIndex?: string) => void,
setActiveSearch: (activeSearch?: ActiveSearchType) => void,
doSearchForHighlight: (
query: string,
editor: Editor,
line: number,
column: number
) => void
closeProjectSearch: typeof actions.closeProjectSearch,
searchSources: typeof actions.searchSources,
clearSearch: typeof actions.clearSearch,
selectSpecificLocation: typeof actions.selectSpecificLocation,
setActiveSearch: typeof actions.setActiveSearch,
doSearchForHighlight: typeof actions.doSearchForHighlight
};
function getFilePath(item: Item, index?: number) {
@ -238,7 +232,7 @@ export class ProjectSearch extends Component<Props, State> {
key={file.sourceId}
>
<Svg name="arrow" className={classnames({ expanded })} />
<img className="file" />
<AccessibleImage className="file" />
<span className="file-path">{getRelativePath(file.filepath)}</span>
<span className="matches-summary">{matches}</span>
</div>
@ -314,6 +308,7 @@ export class ProjectSearch extends Component<Props, State> {
}
renderInput() {
const { status } = this.props;
return (
<SearchInput
query={this.state.inputValue}
@ -322,12 +317,16 @@ export class ProjectSearch extends Component<Props, State> {
size="big"
showErrorEmoji={this.shouldShowErrorEmoji()}
summaryMsg={this.renderSummary()}
isLoading={status === statusType.fetching}
onChange={this.inputOnChange}
onFocus={() => this.setState({ inputFocused: true })}
onBlur={() => this.setState({ inputFocused: false })}
onKeyDown={this.onKeyDown}
onHistoryScroll={this.onHistoryScroll}
handleClose={this.props.closeProjectSearch}
handleClose={
// TODO - This function doesn't quite match the signature.
(this.props.closeProjectSearch: any)
}
ref="searchInput"
/>
);

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

@ -35,7 +35,7 @@ import type {
QuickOpenResult
} from "../utils/quick-open";
import type { SourceLocation, Source } from "../types";
import type { Source } from "../types";
import type { QuickOpenType } from "../reducers/quick-open";
import type { Tab } from "../reducers/tabs";
@ -51,10 +51,10 @@ type Props = {
symbolsLoading: boolean,
tabs: Tab[],
shortcutsModalEnabled: boolean,
selectSpecificLocation: SourceLocation => void,
setQuickOpenQuery: (query: string) => void,
highlightLineRange: ({ start: number, end: number }) => void,
closeQuickOpen: () => void,
selectSpecificLocation: typeof actions.selectSpecificLocation,
setQuickOpenQuery: typeof actions.setQuickOpenQuery,
highlightLineRange: typeof actions.highlightLineRange,
closeQuickOpen: typeof actions.closeQuickOpen,
toggleShortcutsModal: () => void
};
@ -387,6 +387,7 @@ export class QuickOpenModal extends Component<Props, State> {
placeholder={L10N.getStr("sourceSearch.search2")}
summaryMsg={this.getSummaryMessage()}
showErrorEmoji={this.shouldShowErrorEmoji()}
isLoading={false}
onChange={this.onChange}
onKeyDown={this.onKeyDown}
handleClose={this.closeModal}
@ -433,11 +434,9 @@ function mapStateToProps(state) {
export default connect(
mapStateToProps,
{
shortcutsModalEnabled: actions.shortcutsModalEnabled,
selectSpecificLocation: actions.selectSpecificLocation,
setQuickOpenQuery: actions.setQuickOpenQuery,
highlightLineRange: actions.highlightLineRange,
closeQuickOpen: actions.closeQuickOpen,
toggleShortcutsModal: actions.toggleShortcutsModal
closeQuickOpen: actions.closeQuickOpen
}
)(QuickOpenModal);

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

@ -202,7 +202,6 @@ export default connect(
removeAllBreakpoints: actions.removeAllBreakpoints,
disableBreakpoint: actions.disableBreakpoint,
selectSpecificLocation: actions.selectSpecificLocation,
selectLocation: actions.selectLocation,
setBreakpointCondition: actions.setBreakpointCondition,
toggleAllBreakpoints: actions.toggleAllBreakpoints,
toggleBreakpoints: actions.toggleBreakpoints,

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

@ -22,7 +22,7 @@ type Props = {
sources: Source[],
source: Source,
hasSiblingOfSameName: boolean,
selectSource: string => void
selectSource: typeof actions.selectSource
};
class BreakpointHeading extends PureComponent<Props> {

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

@ -20,6 +20,7 @@ import {
import { formatKeyShortcut } from "../../utils/text";
import actions from "../../actions";
import { debugBtn } from "../shared/Button/CommandBarButton";
import AccessibleImage from "../shared/AccessibleImage";
import "./CommandBar.css";
import { appinfo } from "devtools-services";
@ -78,17 +79,17 @@ type Props = {
horizontal: boolean,
canRewind: boolean,
skipPausing: boolean,
resume: () => void,
stepIn: () => void,
stepOut: () => void,
stepOver: () => void,
breakOnNext: () => void,
rewind: () => void,
reverseStepIn: () => void,
reverseStepOut: () => void,
reverseStepOver: () => void,
pauseOnExceptions: (boolean, boolean) => void,
toggleSkipPausing: () => void
resume: typeof actions.resume,
stepIn: typeof actions.stepIn,
stepOut: typeof actions.stepOut,
stepOver: typeof actions.stepOver,
breakOnNext: typeof actions.breakOnNext,
rewind: typeof actions.rewind,
reverseStepIn: typeof actions.reverseStepIn,
reverseStepOut: typeof actions.reverseStepOut,
reverseStepOver: typeof actions.reverseStepOver,
pauseOnExceptions: typeof actions.pauseOnExceptions,
toggleSkipPausing: typeof actions.toggleSkipPausing
};
class CommandBar extends Component<Props> {
@ -273,7 +274,7 @@ class CommandBar extends Component<Props> {
title={L10N.getStr("skipPausingTooltip")}
onClick={toggleSkipPausing}
>
<img className="skipPausing" />
<AccessibleImage className="skipPausing" />
</button>
);
}

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

@ -22,7 +22,7 @@ import { CloseButton } from "../shared/Button";
import { debounce } from "lodash";
import type { List } from "immutable";
import type { Expression, Grip } from "../../types";
import type { Expression } from "../../types";
import "./Expressions.css";
@ -40,16 +40,16 @@ type Props = {
expressionError: boolean,
showInput: boolean,
autocompleteMatches: string[],
autocomplete: (input: string, cursor: number) => Promise<any>,
clearAutocomplete: () => void,
onExpressionAdded: () => void,
addExpression: (input: string) => void,
clearExpressionError: () => void,
evaluateExpressions: () => void,
updateExpression: (input: string, expression: Expression) => void,
deleteExpression: (expression: Expression) => void,
openLink: (url: string) => void,
openElementInInspector: (grip: Grip) => void
autocomplete: typeof actions.autocomplete,
clearAutocomplete: typeof actions.clearAutocomplete,
addExpression: typeof actions.addExpression,
clearExpressionError: typeof actions.clearExpressionError,
evaluateExpressions: typeof actions.evaluateExpressions,
updateExpression: typeof actions.updateExpression,
deleteExpression: typeof actions.deleteExpression,
openLink: typeof actions.openLink,
openElementInInspector: typeof actions.openElementInInspectorCommand
};
class Expressions extends Component<Props, State> {
@ -371,7 +371,6 @@ export default connect(
{
autocomplete: actions.autocomplete,
clearAutocomplete: actions.clearAutocomplete,
onExpressionAdded: actions.onExpressionAdded,
addExpression: actions.addExpression,
clearExpressionError: actions.clearExpressionError,
evaluateExpressions: actions.evaluateExpressions,

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

@ -27,7 +27,7 @@ const {
type Props = {
selectedFrame: Frame,
popupObjectProperties: Object,
setPopupObjectProperties: (Object, Object) => void,
setPopupObjectProperties: typeof actions.setPopupObjectProperties,
openElementInInspector: (grip: Grip) => void
};

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

@ -19,7 +19,7 @@ import {
import { getScopes } from "../../utils/pause/scopes";
import { objectInspector } from "devtools-reps";
import type { Pause, Why, Grip } from "../../types";
import type { Pause, Why } from "../../types";
import type { NamedValue } from "../../utils/pause/scopes/types";
import "./Scopes.css";
@ -33,8 +33,8 @@ type Props = {
originalFrameScopes: Object | null,
isLoading: boolean,
why: Why,
openLink: string => void,
openElementInInspector: (grip: Grip) => void
openLink: typeof actions.openLink,
openElementInInspector: typeof actions.openElementInInspectorCommand
};
type State = {

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

@ -12,6 +12,7 @@ import actions from "../../actions";
import { getWorkers } from "../../selectors";
import { basename } from "../../utils/path";
import type { Worker } from "../../types";
import AccessibleImage from "../shared/AccessibleImage";
export class Workers extends PureComponent {
props: {
@ -27,7 +28,7 @@ export class Workers extends PureComponent {
key={worker.actor}
onClick={() => openWorkerToolbox(worker)}
>
<img className="domain" />
<AccessibleImage className="domain" />
{basename(worker.url)}
</div>
));

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

@ -82,11 +82,11 @@ type Props = {
shouldPauseOnExceptions: boolean,
shouldPauseOnCaughtExceptions: boolean,
workers: WorkersList,
toggleAllBreakpoints: Function,
toggleShortcutsModal: Function,
evaluateExpressions: Function,
pauseOnExceptions: (boolean, boolean) => void,
breakOnNext: () => void
toggleShortcutsModal: () => void,
toggleAllBreakpoints: typeof actions.toggleAllBreakpoints,
evaluateExpressions: typeof actions.evaluateExpressions,
pauseOnExceptions: typeof actions.pauseOnExceptions,
breakOnNext: typeof actions.breakOnNext
};
class SecondaryPanes extends Component<Props, State> {
@ -442,7 +442,6 @@ export default connect(
mapStateToProps,
{
toggleAllBreakpoints: actions.toggleAllBreakpoints,
toggleShortcutsModal: actions.toggleShortcutsModal,
evaluateExpressions: actions.evaluateExpressions,
pauseOnExceptions: actions.pauseOnExceptions,
breakOnNext: actions.breakOnNext

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

@ -21,7 +21,7 @@ type Props = {
endPanelCollapsed: boolean,
togglePaneCollapse: Function,
setActiveSearch: (?ActiveSearchType) => any,
openQuickOpen: (query?: string) => void,
openQuickOpen: typeof actions.openQuickOpen,
toggleShortcutsModal: () => void
};

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

@ -0,0 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// @flow
import React from "react";
import classnames from "classnames";
import "./AccessibleImage.css";
const AccessibleImage = (props: Object) => {
props = {
...props,
className: classnames("img", props.className)
};
return <span {...props} />;
};
export default AccessibleImage;

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

@ -4,6 +4,9 @@
// @flow
import React from "react";
import AccessibleImage from "../AccessibleImage";
import "./styles/CloseButton.css";
type Props = {
@ -19,7 +22,7 @@ function CloseButton({ handleClick, buttonClass, tooltip }: Props) {
onClick={handleClick}
title={tooltip}
>
<img className="close" />
<AccessibleImage className="close" />
</button>
);
}

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

@ -6,6 +6,8 @@
import classnames from "classnames";
import React from "react";
import AccessibleImage from "../AccessibleImage";
import "./styles/CommandBarButton.css";
type Props = {
@ -31,7 +33,7 @@ export function debugBtn(
pressed={ariaPressed}
title={tooltip}
>
<img className={type} />
<AccessibleImage className={type} />
</CommandBarButton>
);
}

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

@ -6,6 +6,8 @@
import React, { Component } from "react";
import classnames from "classnames";
import AccessibleImage from "./AccessibleImage";
import "./ResultList.css";
type Props = {
@ -51,7 +53,7 @@ export default class ResultList extends Component<Props> {
<li {...props}>
{item.icon && (
<div>
<img className={item.icon} />
<AccessibleImage className={item.icon} />
</div>
)}
<div id={`${item.id}-title`} className="title">

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

@ -48,7 +48,8 @@ type Props = {
showErrorEmoji: boolean,
size: string,
summaryMsg: string,
showClose: boolean
showClose: boolean,
isLoading: boolean
};
type State = {
@ -199,6 +200,13 @@ class SearchInput extends Component<Props, State> {
return <div className="summary">{summaryMsg}</div>;
}
renderSpinner() {
const { isLoading } = this.props;
if (isLoading) {
return <Svg name="loader" />;
}
}
renderNav() {
const { count, handleNext, handlePrev } = this.props;
if ((!handleNext && !handlePrev) || (!count || count == 1)) {
@ -258,6 +266,7 @@ class SearchInput extends Component<Props, State> {
>
{this.renderSvg()}
<input {...inputProps} />
{this.renderSpinner()}
{this.renderSummaryMsg()}
{this.renderNav()}
{showClose && (

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

@ -8,6 +8,8 @@ import React, { PureComponent } from "react";
import { connect } from "react-redux";
import AccessibleImage from "./AccessibleImage";
import { getSourceClassnames } from "../../utils/source";
import { getFramework } from "../../utils/tabs";
import { getSourceMetaData, getTabs } from "../../selectors";
@ -37,7 +39,7 @@ class SourceIcon extends PureComponent<Props> {
return null;
}
return <img className={`source-icon ${iconClass}`} />;
return <AccessibleImage className={`source-icon ${iconClass}`} />;
}
}

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

@ -8,6 +8,7 @@ DIRS += [
]
DebuggerModules(
'AccessibleImage.js',
'Accordion.js',
'Badge.js',
'BracketArrow.js',

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

@ -2,11 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// @flow
import { throttle } from "lodash";
import type { Source } from "../types";
let newSources;
let createSource;
let supportsWasm = false;
let queuedSources;
let currentWork;
@ -14,24 +15,25 @@ async function dispatchNewSources() {
const sources = queuedSources;
queuedSources = [];
currentWork = await newSources(
sources.map(source => createSource(source, { supportsWasm }))
);
currentWork = await newSources(sources);
}
const queue = throttle(dispatchNewSources, 100);
export default {
initialize: options => {
newSources = options.actions.newSources;
createSource = options.createSource;
supportsWasm = options.supportsWasm;
initialize: (actions: Object) => {
newSources = actions.newSources;
queuedSources = [];
},
queue: source => {
queue: (source: Source) => {
queuedSources.push(source);
queue();
},
queueSources: (sources: Source[]) => {
queuedSources = queuedSources.concat(sources);
queue();
},
flush: () => Promise.all([queue.flush(), currentWork]),
clear: () => queue.cancel()
};

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

@ -48,6 +48,11 @@ add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "simple1");
await pushPref("devtools.debugger.features.column-breakpoints", true);
if(!Services.prefs.getBoolPref("devtools.debugger.features.column-breakpoints")) {
ok(true, "This test only applies when column breakpoints are on");
return;
}
await selectSource(dbg, "simple1");
// Scroll down to desired line so that column breakpoints render

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

@ -728,6 +728,23 @@ function disableBreakpoint(dbg, source, line, column) {
return waitForDispatch(dbg, "DISABLE_BREAKPOINT");
}
function findBreakpoint(dbg, url, line) {
const {
selectors: { getBreakpoint },
getState
} = dbg;
const source = findSource(dbg, url);
let column;
if(
Services.prefs.getBoolPref("devtools.debugger.features.column-breakpoints")
) {
column = dbg.selectors.getFirstPausePointLocation(
dbg.store.getState(), { sourceId: source.id, line }
).column;
}
return getBreakpoint(getState(), { sourceId: source.id, line, column });
}
async function loadAndAddBreakpoint(dbg, filename, line, column) {
const {
selectors: { getBreakpoint, getBreakpointCount, getBreakpointsMap },
@ -1413,4 +1430,4 @@ async function editExpression(dbg, input) {
const evaluated = waitForDispatch(dbg, "EVALUATE_EXPRESSIONS");
pressKey(dbg, "Enter");
await evaluated;
}
}

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

@ -189,6 +189,8 @@ devtools.jar:
skin/images/debugging-workers.svg (themes/images/debugging-workers.svg)
skin/images/datastore.svg (themes/images/datastore.svg)
skin/images/globe.svg (themes/images/globe.svg)
skin/images/next.svg (themes/images/next.svg)
skin/images/next-circle.svg (themes/images/next-circle.svg)
skin/images/folder.svg (themes/images/folder.svg)
skin/images/sad-face.svg (themes/images/sad-face.svg)
skin/images/shape-swatch.svg (themes/images/shape-swatch.svg)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,13 +1,13 @@
# wasmparser version
Current vesion is: 0.6.2
Current vesion is: 0.7.0
# Upgrade process
1. Pull latest release from npm and extract WasmDis.js and WasmParser.js, e.g.
```
curl https://registry.npmjs.org/wasmparser/-/wasmparser-0.6.2.tgz | tar -x --strip-components 2 package/dist/{WasmDis,WasmParser}.js
curl https://registry.npmjs.org/wasmparser/-/wasmparser-0.7.0.tgz | tar -x --strip-components 2 package/dist/{WasmDis,WasmParser}.js
```
2. Remove reference to source maps (last line)

38
devtools/client/shared/vendor/WasmDis.js поставляемый
Просмотреть файл

@ -31,6 +31,7 @@ function typeToString(type) {
case -2 /* i64 */: return 'i64';
case -3 /* f32 */: return 'f32';
case -4 /* f64 */: return 'f64';
case -5 /* v128 */: return 'v128';
case -16 /* anyfunc */: return 'anyfunc';
default: throw new Error('Unexpected type');
}
@ -72,9 +73,20 @@ function formatFloat64(n) {
return '-nan';
return (data2 < 0 ? '-' : '+') + 'nan:0x' + payload.toString(16);
}
function formatI32Array(bytes, count) {
var dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
var result = [];
for (var i = 0; i < count; i++)
result.push("0x" + formatHex(dv.getInt32(i << 2, true), 8));
return result.join(' ');
}
function memoryAddressToString(address, code) {
var defaultAlignFlags;
switch (code) {
case 64768 /* v128_load */:
case 64769 /* v128_store */:
defaultAlignFlags = 4;
break;
case 41 /* i64_load */:
case 55 /* i64_store */:
case 43 /* f64_load */:
@ -189,7 +201,7 @@ function limitsToString(limits) {
}
var paddingCache = ['0', '00', '000'];
function formatHex(n, width) {
var s = n.toString(16).toUpperCase();
var s = (n >>> 0).toString(16).toUpperCase();
if (width === undefined || s.length >= width)
return s;
var paddingIndex = width - s.length - 1;
@ -618,6 +630,8 @@ var WasmDisassembler = /** @class */ (function () {
case 65100 /* i64_atomic_rmw8_u_cmpxchg */:
case 65101 /* i64_atomic_rmw16_u_cmpxchg */:
case 65102 /* i64_atomic_rmw32_u_cmpxchg */:
case 64768 /* v128_load */:
case 64769 /* v128_store */:
var memoryAddress = memoryAddressToString(operator.memoryAddress, operator.code);
if (memoryAddress !== null) {
this.appendBuffer(' ');
@ -639,6 +653,28 @@ var WasmDisassembler = /** @class */ (function () {
case 68 /* f64_const */:
this.appendBuffer(" " + formatFloat64(operator.literal));
break;
case 64770 /* v128_const */:
this.appendBuffer(" i32 " + formatI32Array(operator.literal, 4));
break;
case 64771 /* v8x16_shuffle */:
this.appendBuffer(" " + formatI32Array(operator.lines, 4));
break;
case 64773 /* i8x16_extract_lane_s */:
case 64774 /* i8x16_extract_lane_u */:
case 64775 /* i8x16_replace_lane */:
case 64777 /* i16x8_extract_lane_s */:
case 64778 /* i16x8_extract_lane_u */:
case 64779 /* i16x8_replace_lane */:
case 64781 /* i32x4_extract_lane */:
case 64782 /* i32x4_replace_lane */:
case 64787 /* f32x4_extract_lane */:
case 64788 /* f32x4_replace_lane */:
case 64784 /* i64x2_extract_lane */:
case 64785 /* i64x2_replace_lane */:
case 64790 /* f64x2_extract_lane */:
case 64791 /* f64x2_replace_lane */:
this.appendBuffer(" " + operator.lineIndex);
break;
}
};
WasmDisassembler.prototype.printImportSource = function (info) {

345
devtools/client/shared/vendor/WasmParser.js поставляемый
Просмотреть файл

@ -214,6 +214,7 @@ var OperatorCode;
OperatorCode[OperatorCode["i64_extend16_s"] = 195] = "i64_extend16_s";
OperatorCode[OperatorCode["i64_extend32_s"] = 196] = "i64_extend32_s";
OperatorCode[OperatorCode["prefix_0xfc"] = 252] = "prefix_0xfc";
OperatorCode[OperatorCode["prefix_0xfd"] = 253] = "prefix_0xfd";
OperatorCode[OperatorCode["prefix_0xfe"] = 254] = "prefix_0xfe";
OperatorCode[OperatorCode["i32_trunc_s_sat_f32"] = 64512] = "i32_trunc_s_sat_f32";
OperatorCode[OperatorCode["i32_trunc_u_sat_f32"] = 64513] = "i32_trunc_u_sat_f32";
@ -289,6 +290,146 @@ var OperatorCode;
OperatorCode[OperatorCode["i64_atomic_rmw8_u_cmpxchg"] = 65100] = "i64_atomic_rmw8_u_cmpxchg";
OperatorCode[OperatorCode["i64_atomic_rmw16_u_cmpxchg"] = 65101] = "i64_atomic_rmw16_u_cmpxchg";
OperatorCode[OperatorCode["i64_atomic_rmw32_u_cmpxchg"] = 65102] = "i64_atomic_rmw32_u_cmpxchg";
OperatorCode[OperatorCode["v128_load"] = 64768] = "v128_load";
OperatorCode[OperatorCode["v128_store"] = 64769] = "v128_store";
OperatorCode[OperatorCode["v128_const"] = 64770] = "v128_const";
OperatorCode[OperatorCode["v8x16_shuffle"] = 64771] = "v8x16_shuffle";
OperatorCode[OperatorCode["i8x16_splat"] = 64772] = "i8x16_splat";
OperatorCode[OperatorCode["i8x16_extract_lane_s"] = 64773] = "i8x16_extract_lane_s";
OperatorCode[OperatorCode["i8x16_extract_lane_u"] = 64774] = "i8x16_extract_lane_u";
OperatorCode[OperatorCode["i8x16_replace_lane"] = 64775] = "i8x16_replace_lane";
OperatorCode[OperatorCode["i16x8_splat"] = 64776] = "i16x8_splat";
OperatorCode[OperatorCode["i16x8_extract_lane_s"] = 64777] = "i16x8_extract_lane_s";
OperatorCode[OperatorCode["i16x8_extract_lane_u"] = 64778] = "i16x8_extract_lane_u";
OperatorCode[OperatorCode["i16x8_replace_lane"] = 64779] = "i16x8_replace_lane";
OperatorCode[OperatorCode["i32x4_splat"] = 64780] = "i32x4_splat";
OperatorCode[OperatorCode["i32x4_extract_lane"] = 64781] = "i32x4_extract_lane";
OperatorCode[OperatorCode["i32x4_replace_lane"] = 64782] = "i32x4_replace_lane";
OperatorCode[OperatorCode["i64x2_splat"] = 64783] = "i64x2_splat";
OperatorCode[OperatorCode["i64x2_extract_lane"] = 64784] = "i64x2_extract_lane";
OperatorCode[OperatorCode["i64x2_replace_lane"] = 64785] = "i64x2_replace_lane";
OperatorCode[OperatorCode["f32x4_splat"] = 64786] = "f32x4_splat";
OperatorCode[OperatorCode["f32x4_extract_lane"] = 64787] = "f32x4_extract_lane";
OperatorCode[OperatorCode["f32x4_replace_lane"] = 64788] = "f32x4_replace_lane";
OperatorCode[OperatorCode["f64x2_splat"] = 64789] = "f64x2_splat";
OperatorCode[OperatorCode["f64x2_extract_lane"] = 64790] = "f64x2_extract_lane";
OperatorCode[OperatorCode["f64x2_replace_lane"] = 64791] = "f64x2_replace_lane";
OperatorCode[OperatorCode["i8x16_eq"] = 64792] = "i8x16_eq";
OperatorCode[OperatorCode["i8x16_ne"] = 64793] = "i8x16_ne";
OperatorCode[OperatorCode["i8x16_lt_s"] = 64794] = "i8x16_lt_s";
OperatorCode[OperatorCode["i8x16_lt_u"] = 64795] = "i8x16_lt_u";
OperatorCode[OperatorCode["i8x16_gt_s"] = 64796] = "i8x16_gt_s";
OperatorCode[OperatorCode["i8x16_gt_u"] = 64797] = "i8x16_gt_u";
OperatorCode[OperatorCode["i8x16_le_s"] = 64798] = "i8x16_le_s";
OperatorCode[OperatorCode["i8x16_le_u"] = 64799] = "i8x16_le_u";
OperatorCode[OperatorCode["i8x16_ge_s"] = 64800] = "i8x16_ge_s";
OperatorCode[OperatorCode["i8x16_ge_u"] = 64801] = "i8x16_ge_u";
OperatorCode[OperatorCode["i16x8_eq"] = 64802] = "i16x8_eq";
OperatorCode[OperatorCode["i16x8_ne"] = 64803] = "i16x8_ne";
OperatorCode[OperatorCode["i16x8_lt_s"] = 64804] = "i16x8_lt_s";
OperatorCode[OperatorCode["i16x8_lt_u"] = 64805] = "i16x8_lt_u";
OperatorCode[OperatorCode["i16x8_gt_s"] = 64806] = "i16x8_gt_s";
OperatorCode[OperatorCode["i16x8_gt_u"] = 64807] = "i16x8_gt_u";
OperatorCode[OperatorCode["i16x8_le_s"] = 64808] = "i16x8_le_s";
OperatorCode[OperatorCode["i16x8_le_u"] = 64809] = "i16x8_le_u";
OperatorCode[OperatorCode["i16x8_ge_s"] = 64810] = "i16x8_ge_s";
OperatorCode[OperatorCode["i16x8_ge_u"] = 64811] = "i16x8_ge_u";
OperatorCode[OperatorCode["i32x4_eq"] = 64812] = "i32x4_eq";
OperatorCode[OperatorCode["i32x4_ne"] = 64813] = "i32x4_ne";
OperatorCode[OperatorCode["i32x4_lt_s"] = 64814] = "i32x4_lt_s";
OperatorCode[OperatorCode["i32x4_lt_u"] = 64815] = "i32x4_lt_u";
OperatorCode[OperatorCode["i32x4_gt_s"] = 64816] = "i32x4_gt_s";
OperatorCode[OperatorCode["i32x4_gt_u"] = 64817] = "i32x4_gt_u";
OperatorCode[OperatorCode["i32x4_le_s"] = 64818] = "i32x4_le_s";
OperatorCode[OperatorCode["i32x4_le_u"] = 64819] = "i32x4_le_u";
OperatorCode[OperatorCode["i32x4_ge_s"] = 64820] = "i32x4_ge_s";
OperatorCode[OperatorCode["i32x4_ge_u"] = 64821] = "i32x4_ge_u";
OperatorCode[OperatorCode["f32x4_eq"] = 64832] = "f32x4_eq";
OperatorCode[OperatorCode["f32x4_ne"] = 64833] = "f32x4_ne";
OperatorCode[OperatorCode["f32x4_lt"] = 64834] = "f32x4_lt";
OperatorCode[OperatorCode["f32x4_gt"] = 64835] = "f32x4_gt";
OperatorCode[OperatorCode["f32x4_le"] = 64836] = "f32x4_le";
OperatorCode[OperatorCode["f32x4_ge"] = 64837] = "f32x4_ge";
OperatorCode[OperatorCode["f64x2_eq"] = 64838] = "f64x2_eq";
OperatorCode[OperatorCode["f64x2_ne"] = 64839] = "f64x2_ne";
OperatorCode[OperatorCode["f64x2_lt"] = 64840] = "f64x2_lt";
OperatorCode[OperatorCode["f64x2_gt"] = 64841] = "f64x2_gt";
OperatorCode[OperatorCode["f64x2_le"] = 64842] = "f64x2_le";
OperatorCode[OperatorCode["f64x2_ge"] = 64843] = "f64x2_ge";
OperatorCode[OperatorCode["v128_not"] = 64844] = "v128_not";
OperatorCode[OperatorCode["v128_and"] = 64845] = "v128_and";
OperatorCode[OperatorCode["v128_or"] = 64846] = "v128_or";
OperatorCode[OperatorCode["v128_xor"] = 64847] = "v128_xor";
OperatorCode[OperatorCode["v128_bitselect"] = 64848] = "v128_bitselect";
OperatorCode[OperatorCode["i8x16_neg"] = 64849] = "i8x16_neg";
OperatorCode[OperatorCode["i8x16_any_true"] = 64850] = "i8x16_any_true";
OperatorCode[OperatorCode["i8x16_all_true"] = 64851] = "i8x16_all_true";
OperatorCode[OperatorCode["i8x16_shl"] = 64852] = "i8x16_shl";
OperatorCode[OperatorCode["i8x16_shr_s"] = 64853] = "i8x16_shr_s";
OperatorCode[OperatorCode["i8x16_shr_u"] = 64854] = "i8x16_shr_u";
OperatorCode[OperatorCode["i8x16_add"] = 64855] = "i8x16_add";
OperatorCode[OperatorCode["i8x16_add_saturate_s"] = 64856] = "i8x16_add_saturate_s";
OperatorCode[OperatorCode["i8x16_add_saturate_u"] = 64857] = "i8x16_add_saturate_u";
OperatorCode[OperatorCode["i8x16_sub"] = 64858] = "i8x16_sub";
OperatorCode[OperatorCode["i8x16_sub_saturate_s"] = 64859] = "i8x16_sub_saturate_s";
OperatorCode[OperatorCode["i8x16_sub_saturate_u"] = 64860] = "i8x16_sub_saturate_u";
OperatorCode[OperatorCode["i8x16_mul"] = 64861] = "i8x16_mul";
OperatorCode[OperatorCode["i16x8_neg"] = 64866] = "i16x8_neg";
OperatorCode[OperatorCode["i16x8_any_true"] = 64867] = "i16x8_any_true";
OperatorCode[OperatorCode["i16x8_all_true"] = 64868] = "i16x8_all_true";
OperatorCode[OperatorCode["i16x8_shl"] = 64869] = "i16x8_shl";
OperatorCode[OperatorCode["i16x8_shr_s"] = 64870] = "i16x8_shr_s";
OperatorCode[OperatorCode["i16x8_shr_u"] = 64871] = "i16x8_shr_u";
OperatorCode[OperatorCode["i16x8_add"] = 64872] = "i16x8_add";
OperatorCode[OperatorCode["i16x8_add_saturate_s"] = 64873] = "i16x8_add_saturate_s";
OperatorCode[OperatorCode["i16x8_add_saturate_u"] = 64874] = "i16x8_add_saturate_u";
OperatorCode[OperatorCode["i16x8_sub"] = 64875] = "i16x8_sub";
OperatorCode[OperatorCode["i16x8_sub_saturate_s"] = 64876] = "i16x8_sub_saturate_s";
OperatorCode[OperatorCode["i16x8_sub_saturate_u"] = 64877] = "i16x8_sub_saturate_u";
OperatorCode[OperatorCode["i16x8_mul"] = 64878] = "i16x8_mul";
OperatorCode[OperatorCode["i32x4_neg"] = 64883] = "i32x4_neg";
OperatorCode[OperatorCode["i32x4_any_true"] = 64884] = "i32x4_any_true";
OperatorCode[OperatorCode["i32x4_all_true"] = 64885] = "i32x4_all_true";
OperatorCode[OperatorCode["i32x4_shl"] = 64886] = "i32x4_shl";
OperatorCode[OperatorCode["i32x4_shr_s"] = 64887] = "i32x4_shr_s";
OperatorCode[OperatorCode["i32x4_shr_u"] = 64888] = "i32x4_shr_u";
OperatorCode[OperatorCode["i32x4_add"] = 64889] = "i32x4_add";
OperatorCode[OperatorCode["i32x4_sub"] = 64892] = "i32x4_sub";
OperatorCode[OperatorCode["i32x4_mul"] = 64895] = "i32x4_mul";
OperatorCode[OperatorCode["i64x2_neg"] = 64900] = "i64x2_neg";
OperatorCode[OperatorCode["i64x2_any_true"] = 64901] = "i64x2_any_true";
OperatorCode[OperatorCode["i64x2_all_true"] = 64902] = "i64x2_all_true";
OperatorCode[OperatorCode["i64x2_shl"] = 64903] = "i64x2_shl";
OperatorCode[OperatorCode["i64x2_shr_s"] = 64904] = "i64x2_shr_s";
OperatorCode[OperatorCode["i64x2_shr_u"] = 64905] = "i64x2_shr_u";
OperatorCode[OperatorCode["i64x2_add"] = 64906] = "i64x2_add";
OperatorCode[OperatorCode["i64x2_sub"] = 64909] = "i64x2_sub";
OperatorCode[OperatorCode["f32x4_abs"] = 64917] = "f32x4_abs";
OperatorCode[OperatorCode["f32x4_neg"] = 64918] = "f32x4_neg";
OperatorCode[OperatorCode["f32x4_sqrt"] = 64919] = "f32x4_sqrt";
OperatorCode[OperatorCode["f32x4_add"] = 64922] = "f32x4_add";
OperatorCode[OperatorCode["f32x4_sub"] = 64923] = "f32x4_sub";
OperatorCode[OperatorCode["f32x4_mul"] = 64924] = "f32x4_mul";
OperatorCode[OperatorCode["f32x4_div"] = 64925] = "f32x4_div";
OperatorCode[OperatorCode["f32x4_min"] = 64926] = "f32x4_min";
OperatorCode[OperatorCode["f32x4_max"] = 64927] = "f32x4_max";
OperatorCode[OperatorCode["f64x2_abs"] = 64928] = "f64x2_abs";
OperatorCode[OperatorCode["f64x2_neg"] = 64929] = "f64x2_neg";
OperatorCode[OperatorCode["f64x2_sqrt"] = 64930] = "f64x2_sqrt";
OperatorCode[OperatorCode["f64x2_add"] = 64933] = "f64x2_add";
OperatorCode[OperatorCode["f64x2_sub"] = 64934] = "f64x2_sub";
OperatorCode[OperatorCode["f64x2_mul"] = 64935] = "f64x2_mul";
OperatorCode[OperatorCode["f64x2_div"] = 64936] = "f64x2_div";
OperatorCode[OperatorCode["f64x2_min"] = 64937] = "f64x2_min";
OperatorCode[OperatorCode["f64x2_max"] = 64938] = "f64x2_max";
OperatorCode[OperatorCode["i32x4_trunc_s_f32x4_sat"] = 64939] = "i32x4_trunc_s_f32x4_sat";
OperatorCode[OperatorCode["i32x4_trunc_u_f32x4_sat"] = 64940] = "i32x4_trunc_u_f32x4_sat";
OperatorCode[OperatorCode["i64x2_trunc_s_f64x2_sat"] = 64941] = "i64x2_trunc_s_f64x2_sat";
OperatorCode[OperatorCode["i64x2_trunc_u_f64x2_sat"] = 64942] = "i64x2_trunc_u_f64x2_sat";
OperatorCode[OperatorCode["f32x4_convert_s_i32x4"] = 64943] = "f32x4_convert_s_i32x4";
OperatorCode[OperatorCode["f32x4_convert_u_i32x4"] = 64944] = "f32x4_convert_u_i32x4";
OperatorCode[OperatorCode["f64x2_convert_s_i64x2"] = 64945] = "f64x2_convert_s_i64x2";
OperatorCode[OperatorCode["f64x2_convert_u_i64x2"] = 64946] = "f64x2_convert_u_i64x2";
})(OperatorCode = exports.OperatorCode || (exports.OperatorCode = {}));
;
exports.OperatorCodeNames = [
@ -297,6 +438,9 @@ exports.OperatorCodeNames = [
["i32.trunc_s:sat/f32", "i32.trunc_u:sat/f32", "i32.trunc_s:sat/f64", "i32.trunc_u:sat/f64", "i64.trunc_s:sat/f32", "i64.trunc_u:sat/f32", "i64.trunc_s:sat/f64", "i64.trunc_u:sat/f64"].forEach(function (s, i) {
exports.OperatorCodeNames[0xfc00 | i] = s;
});
["v128.load", "v128.store", "v128.const", "v8x16.shuffle", "i8x16.splat", "i8x16.extract_lane_s", "i8x16.extract_lane_u", "i8x16.replace_lane", "i16x8.splat", "i16x8.extract_lane_s", "i16x8.extract_lane_u", "i16x8.replace_lane", "i32x4.splat", "i32x4.extract_lane", "i32x4.replace_lane", "i64x2.splat", "i64x2.extract_lane", "i64x2.replace_lane", "f32x4.splat", "f32x4.extract_lane", "f32x4.replace_lane", "f64x2.splat", "f64x2.extract_lane", "f64x2.replace_lane", "i8x16.eq", "i8x16.ne", "i8x16.lt_s", "i8x16.lt_u", "i8x16.gt_s", "i8x16.gt_u", "i8x16.le_s", "i8x16.le_u", "i8x16.ge_s", "i8x16.ge_u", "i16x8.eq", "i16x8.ne", "i16x8.lt_s", "i16x8.lt_u", "i16x8.gt_s", "i16x8.gt_u", "i16x8.le_s", "i16x8.le_u", "i16x8.ge_s", "i16x8.ge_u", "i32x4.eq", "i32x4.ne", "i32x4.lt_s", "i32x4.lt_u", "i32x4.gt_s", "i32x4.gt_u", "i32x4.le_s", "i32x4.le_u", "i32x4.ge_s", "i32x4.ge_u", undefined, null, null, null, null, null, null, null, null, null, "f32x4.eq", "f32x4.ne", "f32x4.lt", "f32x4.gt", "f32x4.le", "f32x4.ge", "f64x2.eq", "f64x2.ne", "f64x2.lt", "f64x2.gt", "f64x2.le", "f64x2.ge", "v128.not", "v128.and", "v128.or", "v128.xor", "v128.bitselect", "i8x16.neg", "i8x16.any_true", "i8x16.all_true", "i8x16.shl", "i8x16.shr_s", "i8x16.shr_u", "i8x16.add", "i8x16.add_saturate_s", "i8x16.add_saturate_u", "i8x16.sub", "i8x16.sub_saturate_s", "i8x16.sub_saturate_u", "i8x16.mul", null, null, null, null, "i16x8.neg", "i16x8.any_true", "i16x8.all_true", "i16x8.shl", "i16x8.shr_s", "i16x8.shr_u", "i16x8.add", "i16x8.add_saturate_s", "i16x8.add_saturate_u", "i16x8.sub", "i16x8.sub_saturate_s", "i16x8.sub_saturate_u", "i16x8.mul", null, null, null, null, "i32x4.neg", "i32x4.any_true", "i32x4.all_true", "i32x4.shl", "i32x4.shr_s", "i32x4.shr_u", "i32x4.add", null, null, "i32x4.sub", null, null, "i32x4.mul", null, null, null, null, "i64x2.neg", "i64x2.any_true", "i64x2.all_true", "i64x2.shl", "i64x2.shr_s", "i64x2.shr_u", "i64x2.add", null, null, "i64x2.sub", null, null, null, null, null, null, null, "f32x4.abs", "f32x4.neg", "f32x4.sqrt", null, null, "f32x4.add", "f32x4.sub", "f32x4.mul", "f32x4.div", "f32x4.min", "f32x4.max", "f64x2.abs", "f64x2.neg", "f64x2.sqrt", null, null, "f64x2.add", "f64x2.sub", "f64x2.mul", "f64x2.div", "f64x2.min", "f64x2.max", "i32x4.trunc_s/f32x4:sat", "i32x4.trunc_u/f32x4:sat", "i64x2.trunc_s/f64x2:sat", "i64x2.trunc_u/f64x2:sat", "f32x4.convert_s/i32x4", "f32x4.convert_u/i32x4", "f64x2.convert_s/i64x2", "f64x2.convert_u/i64x2"].forEach(function (s, i) {
exports.OperatorCodeNames[0xfd00 | i] = s;
});
["atomic.wake", "i32.atomic.wait", "i64.atomic.wait", undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, "i32.atomic.load", "i64.atomic.load", "i32.atomic.load8_u", "i32.atomic.load16_u", "i64.atomic.load8_u", "i64.atomic.load16_u", "i64.atomic.load32_u", "i32.atomic.store", "i64.atomic.store", "i32.atomic.store8", "i32.atomic.store16", "i64.atomic.store8", "i64.atomic.store16", "i64.atomic.store32", "i32.atomic.rmw.add", "i64.atomic.rmw.add", "i32.atomic.rmw8_u.add", "i32.atomic.rmw16_u.add", "i64.atomic.rmw8_u.add", "i64.atomic.rmw16_u.add", "i64.atomic.rmw32_u.add", "i32.atomic.rmw.sub", "i64.atomic.rmw.sub", "i32.atomic.rmw8_u.sub", "i32.atomic.rmw16_u.sub", "i64.atomic.rmw8_u.sub", "i64.atomic.rmw16_u.sub", "i64.atomic.rmw32_u.sub", "i32.atomic.rmw.and", "i64.atomic.rmw.and", "i32.atomic.rmw8_u.and", "i32.atomic.rmw16_u.and", "i64.atomic.rmw8_u.and", "i64.atomic.rmw16_u.and", "i64.atomic.rmw32_u.and", "i32.atomic.rmw.or", "i64.atomic.rmw.or", "i32.atomic.rmw8_u.or", "i32.atomic.rmw16_u.or", "i64.atomic.rmw8_u.or", "i64.atomic.rmw16_u.or", "i64.atomic.rmw32_u.or", "i32.atomic.rmw.xor", "i64.atomic.rmw.xor", "i32.atomic.rmw8_u.xor", "i32.atomic.rmw16_u.xor", "i64.atomic.rmw8_u.xor", "i64.atomic.rmw16_u.xor", "i64.atomic.rmw32_u.xor", "i32.atomic.rmw.xchg", "i64.atomic.rmw.xchg", "i32.atomic.rmw8_u.xchg", "i32.atomic.rmw16_u.xchg", "i64.atomic.rmw8_u.xchg", "i64.atomic.rmw16_u.xchg", "i64.atomic.rmw32_u.xchg", "i32.atomic.rmw.cmpxchg", "i64.atomic.rmw.cmpxchg", "i32.atomic.rmw8_u.cmpxchg", "i32.atomic.rmw16_u.cmpxchg", "i64.atomic.rmw8_u.cmpxchg", "i64.atomic.rmw16_u.cmpxchg", "i64.atomic.rmw32_u.cmpxchg"].forEach(function (s, i) {
exports.OperatorCodeNames[0xfe00 | i] = s;
});
@ -313,6 +457,7 @@ var Type;
Type[Type["i64"] = -2] = "i64";
Type[Type["f32"] = -3] = "f32";
Type[Type["f64"] = -4] = "f64";
Type[Type["v128"] = -5] = "v128";
Type[Type["anyfunc"] = -16] = "anyfunc";
Type[Type["func"] = -32] = "func";
Type[Type["empty_block_type"] = -64] = "empty_block_type";
@ -864,6 +1009,10 @@ var BinaryReader = /** @class */ (function () {
var offset = this.readVarUint32() >>> 0;
return { flags: flags, offset: offset };
};
BinaryReader.prototype.readLineIndex = function (max) {
var index = this.readUint8();
return index;
};
BinaryReader.prototype.readNameMap = function () {
var count = this.readVarUint32();
var result = [];
@ -1059,7 +1208,189 @@ var BinaryReader = /** @class */ (function () {
this.result = { code: code,
blockType: undefined, brDepth: undefined, brTable: undefined,
funcIndex: undefined, typeIndex: undefined, localIndex: undefined,
globalIndex: undefined, memoryAddress: undefined, literal: undefined };
globalIndex: undefined, memoryAddress: undefined, literal: undefined,
lines: undefined, lineIndex: undefined, };
return true;
};
BinaryReader.prototype.readCodeOperator_0xfd = function () {
var MAX_CODE_OPERATOR_0XFD_SIZE = 17;
var pos = this._pos;
if (!this._eof && pos + MAX_CODE_OPERATOR_0XFD_SIZE > this._length) {
return false;
}
var code = this._data[this._pos++] | 0xfd00;
var memoryAddress;
var literal;
var lineIndex;
var lines;
switch (code) {
case 64768 /* v128_load */:
case 64769 /* v128_store */:
memoryAddress = this.readMemoryImmediate();
break;
case 64770 /* v128_const */:
literal = this.readBytes(16);
break;
case 64771 /* v8x16_shuffle */:
lines = new Uint8Array(16);
for (var i = 0; i < lines.length; i++)
lines[i] = this.readLineIndex(32);
break;
case 64773 /* i8x16_extract_lane_s */:
case 64774 /* i8x16_extract_lane_u */:
case 64775 /* i8x16_replace_lane */:
lineIndex = this.readLineIndex(16);
break;
case 64777 /* i16x8_extract_lane_s */:
case 64778 /* i16x8_extract_lane_u */:
case 64779 /* i16x8_replace_lane */:
lineIndex = this.readLineIndex(8);
break;
case 64781 /* i32x4_extract_lane */:
case 64782 /* i32x4_replace_lane */:
case 64787 /* f32x4_extract_lane */:
case 64788 /* f32x4_replace_lane */:
lineIndex = this.readLineIndex(4);
break;
case 64784 /* i64x2_extract_lane */:
case 64785 /* i64x2_replace_lane */:
case 64790 /* f64x2_extract_lane */:
case 64791 /* f64x2_replace_lane */:
lineIndex = this.readLineIndex(2);
break;
case 64772 /* i8x16_splat */:
case 64776 /* i16x8_splat */:
case 64780 /* i32x4_splat */:
case 64783 /* i64x2_splat */:
case 64786 /* f32x4_splat */:
case 64789 /* f64x2_splat */:
case 64792 /* i8x16_eq */:
case 64793 /* i8x16_ne */:
case 64794 /* i8x16_lt_s */:
case 64795 /* i8x16_lt_u */:
case 64796 /* i8x16_gt_s */:
case 64797 /* i8x16_gt_u */:
case 64798 /* i8x16_le_s */:
case 64799 /* i8x16_le_u */:
case 64800 /* i8x16_ge_s */:
case 64801 /* i8x16_ge_u */:
case 64802 /* i16x8_eq */:
case 64803 /* i16x8_ne */:
case 64804 /* i16x8_lt_s */:
case 64805 /* i16x8_lt_u */:
case 64806 /* i16x8_gt_s */:
case 64807 /* i16x8_gt_u */:
case 64808 /* i16x8_le_s */:
case 64809 /* i16x8_le_u */:
case 64810 /* i16x8_ge_s */:
case 64811 /* i16x8_ge_u */:
case 64812 /* i32x4_eq */:
case 64813 /* i32x4_ne */:
case 64814 /* i32x4_lt_s */:
case 64815 /* i32x4_lt_u */:
case 64816 /* i32x4_gt_s */:
case 64817 /* i32x4_gt_u */:
case 64818 /* i32x4_le_s */:
case 64819 /* i32x4_le_u */:
case 64820 /* i32x4_ge_s */:
case 64821 /* i32x4_ge_u */:
case 64832 /* f32x4_eq */:
case 64833 /* f32x4_ne */:
case 64834 /* f32x4_lt */:
case 64835 /* f32x4_gt */:
case 64836 /* f32x4_le */:
case 64837 /* f32x4_ge */:
case 64838 /* f64x2_eq */:
case 64839 /* f64x2_ne */:
case 64840 /* f64x2_lt */:
case 64841 /* f64x2_gt */:
case 64842 /* f64x2_le */:
case 64843 /* f64x2_ge */:
case 64844 /* v128_not */:
case 64845 /* v128_and */:
case 64846 /* v128_or */:
case 64847 /* v128_xor */:
case 64848 /* v128_bitselect */:
case 64849 /* i8x16_neg */:
case 64850 /* i8x16_any_true */:
case 64851 /* i8x16_all_true */:
case 64852 /* i8x16_shl */:
case 64853 /* i8x16_shr_s */:
case 64854 /* i8x16_shr_u */:
case 64855 /* i8x16_add */:
case 64856 /* i8x16_add_saturate_s */:
case 64857 /* i8x16_add_saturate_u */:
case 64858 /* i8x16_sub */:
case 64859 /* i8x16_sub_saturate_s */:
case 64860 /* i8x16_sub_saturate_u */:
case 64861 /* i8x16_mul */:
case 64866 /* i16x8_neg */:
case 64867 /* i16x8_any_true */:
case 64868 /* i16x8_all_true */:
case 64869 /* i16x8_shl */:
case 64870 /* i16x8_shr_s */:
case 64871 /* i16x8_shr_u */:
case 64872 /* i16x8_add */:
case 64873 /* i16x8_add_saturate_s */:
case 64874 /* i16x8_add_saturate_u */:
case 64875 /* i16x8_sub */:
case 64876 /* i16x8_sub_saturate_s */:
case 64877 /* i16x8_sub_saturate_u */:
case 64878 /* i16x8_mul */:
case 64883 /* i32x4_neg */:
case 64884 /* i32x4_any_true */:
case 64885 /* i32x4_all_true */:
case 64886 /* i32x4_shl */:
case 64887 /* i32x4_shr_s */:
case 64888 /* i32x4_shr_u */:
case 64889 /* i32x4_add */:
case 64892 /* i32x4_sub */:
case 64895 /* i32x4_mul */:
case 64900 /* i64x2_neg */:
case 64901 /* i64x2_any_true */:
case 64902 /* i64x2_all_true */:
case 64903 /* i64x2_shl */:
case 64904 /* i64x2_shr_s */:
case 64905 /* i64x2_shr_u */:
case 64906 /* i64x2_add */:
case 64909 /* i64x2_sub */:
case 64917 /* f32x4_abs */:
case 64918 /* f32x4_neg */:
case 64919 /* f32x4_sqrt */:
case 64922 /* f32x4_add */:
case 64923 /* f32x4_sub */:
case 64924 /* f32x4_mul */:
case 64925 /* f32x4_div */:
case 64926 /* f32x4_min */:
case 64927 /* f32x4_max */:
case 64928 /* f64x2_abs */:
case 64929 /* f64x2_neg */:
case 64930 /* f64x2_sqrt */:
case 64933 /* f64x2_add */:
case 64934 /* f64x2_sub */:
case 64935 /* f64x2_mul */:
case 64936 /* f64x2_div */:
case 64937 /* f64x2_min */:
case 64938 /* f64x2_max */:
case 64939 /* i32x4_trunc_s_f32x4_sat */:
case 64940 /* i32x4_trunc_u_f32x4_sat */:
case 64941 /* i64x2_trunc_s_f64x2_sat */:
case 64942 /* i64x2_trunc_u_f64x2_sat */:
case 64943 /* f32x4_convert_s_i32x4 */:
case 64944 /* f32x4_convert_u_i32x4 */:
case 64945 /* f64x2_convert_s_i64x2 */:
case 64946 /* f64x2_convert_u_i64x2 */:
break;
default:
this.error = new Error("Unknown operator: " + code);
this.state = -1 /* ERROR */;
return true;
}
this.result = { code: code,
blockType: undefined, brDepth: undefined, brTable: undefined,
funcIndex: undefined, typeIndex: undefined, localIndex: undefined,
globalIndex: undefined, memoryAddress: memoryAddress, literal: literal,
lines: lines, lineIndex: lineIndex, };
return true;
};
BinaryReader.prototype.readCodeOperator_0xfe = function () {
@ -1147,7 +1478,8 @@ var BinaryReader = /** @class */ (function () {
this.result = { code: code,
blockType: undefined, brDepth: undefined, brTable: undefined,
funcIndex: undefined, typeIndex: undefined, localIndex: undefined,
globalIndex: undefined, memoryAddress: memoryAddress, literal: undefined };
globalIndex: undefined, memoryAddress: memoryAddress, literal: undefined,
lines: undefined, lineIndex: undefined, };
return true;
};
BinaryReader.prototype.readCodeOperator = function () {
@ -1261,6 +1593,12 @@ var BinaryReader = /** @class */ (function () {
}
this._pos = pos;
return false;
case 253 /* prefix_0xfd */:
if (this.readCodeOperator_0xfd()) {
return true;
}
this._pos = pos;
return false;
case 254 /* prefix_0xfe */:
if (this.readCodeOperator_0xfe()) {
return true;
@ -1411,7 +1749,8 @@ var BinaryReader = /** @class */ (function () {
this.result = { code: code,
blockType: blockType, brDepth: brDepth, brTable: brTable,
funcIndex: funcIndex, typeIndex: typeIndex, localIndex: localIndex,
globalIndex: globalIndex, memoryAddress: memoryAddress, literal: literal };
globalIndex: globalIndex, memoryAddress: memoryAddress, literal: literal,
lines: undefined, lineIndex: undefined, };
return true;
};
BinaryReader.prototype.readFunctionBody = function () {

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

До

Ширина:  |  Высота:  |  Размер: 1.4 KiB

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

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

До

Ширина:  |  Высота:  |  Размер: 582 B

После

Ширина:  |  Высота:  |  Размер: 582 B

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

@ -221,7 +221,7 @@ a {
}
.message:hover > .icon.rewindable {
background-image: url(resource://devtools/client/debugger/new/images/next-circle.svg);
background-image: url(chrome://devtools/skin/images/next-circle.svg);
cursor: pointer;
transform: rotate(180deg);
}

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

@ -19,6 +19,7 @@ const { div } = dom;
const markerWidth = 7;
const imgResource = "resource://devtools/client/debugger/new/images";
const imgChrome = "chrome://devtools/skin/images";
const shouldLog = false;
function classname(name, bools) {
@ -47,6 +48,9 @@ function CommandButton({ img, className, onClick }) {
play: "resume",
};
const filename = images[img];
const path = filename == "next" ? imgChrome : imgResource;
return dom.div(
{
className: `command-button ${className}`,
@ -55,7 +59,7 @@ function CommandButton({ img, className, onClick }) {
dom.img({
className: `btn ${img}`,
style: {
maskImage: `url("${imgResource}/${images[img]}.svg")`,
maskImage: `url("${path}/${filename}.svg")`,
},
})
);

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

@ -728,6 +728,8 @@ class ContentChild final : public PContentChild,
#ifdef NIGHTLY_BUILD
virtual PContentChild::Result OnMessageReceived(const Message& aMsg) override;
#else
using PContentChild::OnMessageReceived;
#endif
virtual PContentChild::Result OnMessageReceived(const Message& aMsg,

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Двоичные данные
dom/localstorage/test/unit/corruptedDatabase_profile.zip Normal file

Двоичный файл не отображается.

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

@ -84,6 +84,20 @@ function resetOriginLimit()
Services.prefs.clearUserPref("dom.storage.default_quota");
}
function init()
{
let request = Services.qms.init();
return request;
}
function initOrigin(principal, persistence)
{
let request = Services.qms.initStoragesForPrincipal(principal, persistence);
return request;
}
function getOriginUsage(principal)
{
let request = Services.qms.getUsageForPrincipal(principal, function() { });
@ -120,10 +134,9 @@ function clearOrigin(principal, persistence)
return request;
}
function reset(callback)
function reset()
{
let request = Services.qms.reset();
request.callback = callback;
return request;
}

Двоичные данные
dom/localstorage/test/unit/stringLength_profile.zip Normal file

Двоичный файл не отображается.

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

@ -0,0 +1,42 @@
/**
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
async function testSteps()
{
const principal = getPrincipal("http://example.org");
info("Setting pref");
Services.prefs.setBoolPref("dom.storage.next_gen", true);
info("Clearing");
let request = clear();
await requestFinished(request);
info("Installing package");
// The profile contains one localStorage, all localStorage related files, a
// script for localStorage creation and the storage database:
// - storage/default/http+++example.org/ls
// - storage/ls-archive.sqlite
// - create_db.js
// - storage.sqlite
// - webappsstore.sqlite
// The file create_db.js in the package was run locally, specifically it was
// temporarily added to xpcshell.ini and then executed:
// mach xpcshell-test --interactive dom/localstorage/test/unit/create_db.js
// Note: to make it become the profile in the test, additional manual steps
// are needed.
// 1. Manually change first 6 chars in data.sqlite to "foobar".
// 2. Remove the folder "storage/temporary".
installPackage("corruptedDatabase_profile");
let storage = getLocalStorage(principal);
let length = storage.length;
ok(length === 0, "Correct length");
}

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

@ -0,0 +1,294 @@
/**
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
async function testSteps()
{
const principal = getPrincipal("http://example.com")
const dataFile =
getRelativeFile("storage/default/http+++example.com/ls/data.sqlite");
const usageJournalFile =
getRelativeFile("storage/default/http+++example.com/ls/usage-journal");
const usageFile =
getRelativeFile("storage/default/http+++example.com/ls/usage");
const data = {};
data.key = "key1";
data.value = "value1";
data.usage = data.key.length + data.value.length;
const usageFileCookie = 0x420a420a;
async function createTestOrigin() {
let storage = getLocalStorage(principal);
storage.setItem(data.key, data.value);
let request = reset();
await requestFinished(request);
}
function removeFile(file) {
file.remove(false);
}
function createEmptyFile(file) {
file.create(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt("0644", 8));
}
function getBinaryOutputStream(file) {
var ostream = Cc["@mozilla.org/network/file-output-stream;1"]
.createInstance(Ci.nsIFileOutputStream);
ostream.init(file, -1, parseInt("0644", 8), 0);
let bstream = Cc["@mozilla.org/binaryoutputstream;1"]
.createInstance(Ci.nsIBinaryOutputStream);
bstream.setOutputStream(ostream);
return bstream;
}
async function readUsageFromUsageFile() {
let file = await File.createFromNsIFile(usageFile);
let buffer = await new Promise(resolve => {
let reader = new FileReader();
reader.onloadend = () => resolve(reader.result);
reader.readAsArrayBuffer(file);
});
let view = new DataView(buffer, 8, 4);
return view.getUint32();
}
async function initTestOrigin() {
let request = initOrigin(principal, "default");
await requestFinished(request);
}
async function checkFiles(wantData, wantUsage) {
let exists = dataFile.exists();
if (wantData) {
ok(exists, "Data file does exist");
} else {
ok(!exists, "Data file doesn't exist");
}
exists = usageJournalFile.exists();
ok(!exists, "Usage journal file doesn't exist");
exists = usageFile.exists();
if (wantUsage) {
ok(exists, "Usage file does exist");
} else {
ok(!exists, "Usage file doesn't exist");
return;
}
let usage = await readUsageFromUsageFile();
ok (usage == data.usage, "Correct usage");
}
async function clearTestOrigin() {
let request = clearOrigin(principal, "default");
await requestFinished(request);
}
info("Setting prefs");
Services.prefs.setBoolPref("dom.storage.next_gen", true);
info("Stage 1 - " +
"data.sqlite file doesn't exist, " +
"usage-journal file doesn't exist, " +
"any usage file exists");
await createTestOrigin();
removeFile(dataFile);
await initTestOrigin();
await checkFiles(/* wantData */ false,
/* wantUsage */ false);
await clearTestOrigin();
info("Stage 2 - " +
"data.sqlite file doesn't exist, " +
"any usage-journal file exists, " +
"any usage file exists");
await createTestOrigin();
removeFile(dataFile);
createEmptyFile(usageJournalFile);
await initTestOrigin();
await checkFiles(/* wantData */ false,
/* wantUsage */ false);
await clearTestOrigin();
info("Stage 3 - " +
"valid data.sqlite file exists, " +
"usage-journal file doesn't exist, " +
"usage file doesn't exist");
await createTestOrigin();
removeFile(usageFile);
await initTestOrigin();
await checkFiles(/* wantData */ true,
/* wantUsage */ true);
await clearTestOrigin();
info("Stage 4 - " +
"valid data.sqlite file exists, " +
"usage-journal file doesn't exist, " +
"invalid (wrong file size) usage file exists");
await createTestOrigin();
removeFile(usageFile);
createEmptyFile(usageFile);
await initTestOrigin();
await checkFiles(/* wantData */ true,
/* wantUsage */ true);
await clearTestOrigin();
info("Stage 5 - " +
"valid data.sqlite file exists, " +
"usage-journal file doesn't exist, " +
"invalid (wrong cookie) usage file exists");
await createTestOrigin();
let stream = getBinaryOutputStream(usageFile);
stream.write32(usageFileCookie - 1);
stream.write64(data.usage);
stream.close();
await initTestOrigin();
await checkFiles(/* wantData */ true,
/* wantUsage */ true);
await clearTestOrigin();
info("Stage 6 - " +
"valid data.sqlite file exists, " +
"usage-journal file doesn't exist, " +
"valid usage file exists");
await createTestOrigin();
await initTestOrigin();
await checkFiles(/* wantData */ true,
/* wantUsage */ true);
await clearTestOrigin();
info("Stage 7 - " +
"valid data.sqlite file exists, " +
"any usage-journal exists, " +
"usage file doesn't exist");
await createTestOrigin();
createEmptyFile(usageJournalFile);
removeFile(usageFile);
await initTestOrigin();
await checkFiles(/* wantData */ true,
/* wantUsage */ true);
await clearTestOrigin();
info("Stage 8 - " +
"valid data.sqlite file exists, " +
"any usage-journal exists, " +
"invalid (wrong file size) usage file exists");
await createTestOrigin();
createEmptyFile(usageJournalFile);
removeFile(usageFile);
createEmptyFile(usageFile);
await initTestOrigin();
await checkFiles(/* wantData */ true,
/* wantUsage */ true);
await clearTestOrigin();
info("Stage 9 - " +
"valid data.sqlite file exists, " +
"any usage-journal exists, " +
"invalid (wrong cookie) usage file exists");
await createTestOrigin();
createEmptyFile(usageJournalFile);
stream = getBinaryOutputStream(usageFile);
stream.write32(usageFileCookie - 1);
stream.write64(data.usage);
stream.close();
await initTestOrigin();
await checkFiles(/* wantData */ true,
/* wantUsage */ true);
await clearTestOrigin();
info("Stage 10 - " +
"valid data.sqlite file exists, " +
"any usage-journal exists, " +
"invalid (wrong usage) usage file exists");
await createTestOrigin();
createEmptyFile(usageJournalFile);
stream = getBinaryOutputStream(usageFile);
stream.write32(usageFileCookie);
stream.write64(data.usage - 1);
stream.close();
await initTestOrigin();
await checkFiles(/* wantData */ true,
/* wantUsage */ true);
await clearTestOrigin();
info("Stage 11 - " +
"valid data.sqlite file exists, " +
"any usage-journal exists, " +
"valid usage file exists");
await createTestOrigin();
createEmptyFile(usageJournalFile);
await initTestOrigin();
await checkFiles(/* wantData */ true,
/* wantUsage */ true);
await clearTestOrigin();
}

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

@ -0,0 +1,71 @@
/**
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
async function testSteps() {
const principal = getPrincipal("http://example.org");
const data = {};
data.key = "foobar";
data.secondKey = "foobaz";
data.value = {
length: 25637,
};
data.usage = data.key.length + data.value.length;
async function checkUsage(expectedUsage) {
info("Checking usage");
// This forces any pending changes to be flushed to disk. It also forces
// data to be reloaded from disk at next localStorage API call.
request = resetOrigin(principal);
await requestFinished(request);
request = getOriginUsage(principal);
await requestFinished(request);
is(request.result.usage, expectedUsage, "Correct usage");
}
info("Setting pref");
Services.prefs.setBoolPref("dom.storage.next_gen", true);
info("Stage 1 - Checking usage after profile installation");
info("Clearing");
let request = clear();
await requestFinished(request);
info("Installing package");
// The profile contains storage.sqlite and webappsstore.sqlite.
installPackage("stringLength_profile");
await checkUsage(0);
info("Stage 2 - Checking usage after archived data migration");
info("Opening database");
let storage = getLocalStorage(principal);
storage.open();
await checkUsage(data.usage);
info("Stage 3 - Checking usage after copying the value");
info("Adding a second copy of the value");
let value = storage.getItem(data.key);
storage.setItem(data.secondKey, value);
await checkUsage(2 * data.usage);
info("Stage 4 - Checking length of the copied value");
value = storage.getItem(data.secondKey);
ok(value.length === data.value.length, "Correct string length");
}

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

@ -6,9 +6,12 @@
head = head.js
support-files =
archive_profile.zip
corruptedDatabase_profile.zip
migration_profile.zip
stringLength_profile.zip
[test_archive.js]
[test_corruptedDatabase.js]
[test_databaseShadowing1.js]
run-sequentially = test_databaseShadowing2.js depends on a file produced by this test
[test_databaseShadowing2.js]
@ -28,5 +31,7 @@ run-sequentially = this test depends on a file produced by test_databaseShadowin
[test_eviction.js]
[test_groupLimit.js]
[test_migration.js]
[test_originInit.js]
[test_snapshotting.js]
[test_stringLength.js]
[test_usage.js]

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

@ -289,6 +289,7 @@ void LoadContextOptions(const char* aPrefName, void* /* aClosure */) {
#ifdef ENABLE_WASM_GC
.setWasmGc(GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm_gc")))
#endif
.setWasmVerbose(GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm_verbose")))
.setThrowOnAsmJSValidationFailure(GetWorkerPref<bool>(
NS_LITERAL_CSTRING("throw_on_asmjs_validation_failure")))
.setBaseline(GetWorkerPref<bool>(NS_LITERAL_CSTRING("baselinejit")))

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

@ -329,12 +329,8 @@ PropertyName* TokenStreamAnyChars::reservedWordToPropertyName(
TokenStreamAnyChars::SourceCoords::SourceCoords(JSContext* cx,
uint32_t initialLineNumber,
uint32_t initialColumnNumber,
uint32_t initialOffset)
: lineStartOffsets_(cx),
initialLineNum_(initialLineNumber),
initialColumn_(initialColumnNumber),
lastIndex_(0) {
: lineStartOffsets_(cx), initialLineNum_(initialLineNumber), lastIndex_(0) {
// This is actually necessary! Removing it causes compile errors on
// GCC and clang. You could try declaring this:
//
@ -472,7 +468,7 @@ TokenStreamAnyChars::SourceCoords::lineToken(uint32_t offset) const {
TokenStreamAnyChars::TokenStreamAnyChars(JSContext* cx,
const ReadOnlyCompileOptions& options,
StrictModeGetter* smg)
: srcCoords(cx, options.lineno, options.column, options.scriptSourceOffset),
: srcCoords(cx, options.lineno, options.scriptSourceOffset),
options_(options),
tokens(),
cursor_(0),
@ -657,6 +653,40 @@ inline void SourceUnits<Utf8Unit>::assertNextCodePoint(
#endif // DEBUG
template <typename Unit>
static size_t ComputeColumn(const Unit* begin, const Unit* end) {
#if JS_COLUMN_DIMENSION_IS_CODE_POINTS
return unicode::CountCodePoints(begin, end);
#else
return PointerRangeSize(begin, end);
#endif
}
template <typename Unit, class AnyCharsAccess>
uint32_t GeneralTokenStreamChars<Unit, AnyCharsAccess>::computeColumn(
LineToken lineToken, uint32_t offset) const {
lineToken.assertConsistentOffset(offset);
const TokenStreamAnyChars& anyChars = anyCharsAccess();
const Unit* begin =
this->sourceUnits.codeUnitPtrAt(anyChars.lineStart(lineToken));
const Unit* end = this->sourceUnits.codeUnitPtrAt(offset);
auto partialCols = AssertedCast<uint32_t>(ComputeColumn(begin, end));
return (lineToken.isFirstLine() ? anyChars.options_.column : 0) + partialCols;
}
template <typename Unit, class AnyCharsAccess>
void GeneralTokenStreamChars<Unit, AnyCharsAccess>::computeLineAndColumn(
uint32_t offset, uint32_t* line, uint32_t* column) const {
const TokenStreamAnyChars& anyChars = anyCharsAccess();
auto lineToken = anyChars.lineToken(offset);
*line = anyChars.lineNumber(lineToken);
*column = computeColumn(lineToken, offset);
}
template <class AnyCharsAccess>
MOZ_COLD void TokenStreamChars<Utf8Unit, AnyCharsAccess>::internalEncodingError(
uint8_t relevantUnits, unsigned errorNumber, ...) {

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

@ -733,6 +733,10 @@ class TokenStreamAnyChars : public TokenStreamShared {
// This class maps a sourceUnits offset (which is 0-indexed) to a line
// number (which is 1-indexed) and an offset (which is 0-indexed) in
// code *units* (not code points, not bytes) into the line.
//
// If you need a column number (i.e. an offset in code *points*),
// GeneralTokenStreamChars<Unit> contains functions that consult this and
// use Unit-specific source text to determine the correct column.
class SourceCoords {
// For a given buffer holding source code, |lineStartOffsets_| has one
// element per line of source code, plus one sentinel element. Each
@ -771,9 +775,6 @@ class TokenStreamAnyChars : public TokenStreamShared {
/** The line number on which the source text begins. */
uint32_t initialLineNum_;
/** The column number at which the source text begins. */
uint32_t initialColumn_;
/**
* The index corresponding to the last offset lookup -- used so that if
* offset lookups proceed in increasing order, and and the offset appears
@ -797,26 +798,9 @@ class TokenStreamAnyChars : public TokenStreamShared {
return lineNum - initialLineNum_;
}
uint32_t lineOffsetFromIndexAndOffset(uint32_t index,
uint32_t offset) const {
uint32_t lineStartOffset = lineStartOffsets_[index];
MOZ_RELEASE_ASSERT(offset >= lineStartOffset);
return offset - lineStartOffset;
}
// This function is BAD because it's lies in the presence of multi-unit
// code points -- unlike lineOffsetFromIndexAndOffset that doesn't
// promise a column number. This name segregates the initial-line
// column adjustment and the false "column" sense to a function that
// will be removed later in this patch stack.
uint32_t columnFromIndexAndOffset(uint32_t index, uint32_t offset) const {
uint32_t lineOffset = lineOffsetFromIndexAndOffset(index, offset);
return (index == 0 ? initialColumn_ : 0) + lineOffset;
}
public:
SourceCoords(JSContext* cx, uint32_t initialLineNumber,
uint32_t initialColumnNumber, uint32_t initialOffset);
uint32_t initialOffset);
MOZ_MUST_USE bool add(uint32_t lineNum, uint32_t lineStartOffset);
MOZ_MUST_USE bool fill(const SourceCoords& other);
@ -862,6 +846,10 @@ class TokenStreamAnyChars : public TokenStreamShared {
bool isFirstLine() const { return index == 0; }
bool isSameLine(LineToken other) const { return index == other.index; }
void assertConsistentOffset(uint32_t offset) const {
MOZ_ASSERT(offset_ == offset);
}
};
/**
@ -881,23 +869,9 @@ class TokenStreamAnyChars : public TokenStreamShared {
return lineNumberFromIndex(lineToken.index);
}
/**
* Compute the offset *in code units* of |offset| from the start of the
* line containing it, plus any contribution from |initialColumnNumber|
* passed to the |SourceCoords| constructor.
*
* This is only really a "column". A subsequent patch in this stack
* removes it, computing a multi-unit-aware column number elsewhere in
* Unit-sensitive manner.
*/
uint32_t columnIndex(LineToken lineToken, uint32_t offset) const {
MOZ_ASSERT(lineToken.offset_ == offset, "use a consistent token");
uint32_t lineStartOffset = lineStartOffsets_[lineToken.index];
MOZ_RELEASE_ASSERT(offset >= lineStartOffset);
uint32_t relative = offset - lineStartOffset;
return (lineToken.isFirstLine() ? initialColumn_ : 0) + relative;
/** Return the offset of the start of the line for |lineToken|. */
uint32_t lineStart(LineToken lineToken) const {
return lineStartOffsets_[lineToken.index];
}
};
@ -915,16 +889,8 @@ class TokenStreamAnyChars : public TokenStreamShared {
return srcCoords.lineNumber(lineToken);
}
uint32_t columnIndex(LineToken lineToken, uint32_t offset) const {
return srcCoords.columnIndex(lineToken, offset);
}
// A helper function if you want an offset's line *and* "column" info.
void lineAndColumnAt(uint32_t offset, uint32_t* lineNum,
uint32_t* column) const {
LineToken token = srcCoords.lineToken(offset);
*lineNum = srcCoords.lineNumber(token);
*column = srcCoords.columnIndex(token, offset);
uint32_t lineStart(LineToken lineToken) const {
return srcCoords.lineStart(lineToken);
}
/**
@ -1904,11 +1870,19 @@ class TokenStart {
uint32_t offset() const { return startOffset_; }
};
// Column numbers *ought* be in terms of counts of code points, but in the past
// we counted code units. Set this to 0 to keep returning counts of code units
// (even for UTF-8, which is clearly wrong, but we don't ship UTF-8 yet so this
// is fine until we can fix users that depend on code-unit counting).
#define JS_COLUMN_DIMENSION_IS_CODE_POINTS 0
template <typename Unit, class AnyCharsAccess>
class GeneralTokenStreamChars : public SpecializedTokenStreamCharsBase<Unit> {
using CharsBase = TokenStreamCharsBase<Unit>;
using SpecializedCharsBase = SpecializedTokenStreamCharsBase<Unit>;
using LineToken = TokenStreamAnyChars::LineToken;
private:
Token* newTokenInternal(TokenKind kind, TokenStart start, TokenKind* out);
@ -1968,10 +1942,9 @@ class GeneralTokenStreamChars : public SpecializedTokenStreamCharsBase<Unit> {
return static_cast<TokenStreamSpecific*>(this);
}
uint32_t computeColumn(LineToken lineToken, uint32_t offset) const;
void computeLineAndColumn(uint32_t offset, uint32_t* line,
uint32_t* column) const {
anyCharsAccess().lineAndColumnAt(offset, line, column);
}
uint32_t* column) const;
/**
* Fill in |err| completely, except for line-of-context information.
@ -2440,6 +2413,7 @@ class MOZ_STACK_CLASS TokenStreamSpecific
using CharsBase::fillCharBufferFromSourceNormalizingAsciiLineBreaks;
using CharsBase::matchCodeUnit;
using CharsBase::matchLineTerminator;
using GeneralCharsBase::computeColumn;
using GeneralCharsBase::fillExceptingContext;
using GeneralCharsBase::getCodeUnit;
using GeneralCharsBase::getFullAsciiCodePoint;
@ -2501,7 +2475,7 @@ class MOZ_STACK_CLASS TokenStreamSpecific
void lineAndColumnAt(size_t offset, uint32_t* line,
uint32_t* column) const final {
anyCharsAccess().lineAndColumnAt(offset, line, column);
computeLineAndColumn(offset, line, column);
}
void currentLineAndColumn(uint32_t* line, uint32_t* column) const final {
@ -2521,9 +2495,7 @@ class MOZ_STACK_CLASS TokenStreamSpecific
}
uint32_t columnAt(size_t offset) const final {
const TokenStreamAnyChars& anyChars = anyCharsAccess();
auto lineToken = anyChars.lineToken(offset);
return anyChars.columnIndex(lineToken, offset);
return computeColumn(anyCharsAccess().lineToken(offset), offset);
}
bool hasTokenizationStarted() const final;

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

@ -31,18 +31,22 @@
#include "irregexp/RegExpParser.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Casting.h"
#include "mozilla/Move.h"
#include "mozilla/Range.h"
#include "frontend/TokenStream.h"
#include "gc/GC.h"
#include "irregexp/RegExpCharacters.h"
#include "util/StringBuffer.h"
#include "util/Text.h"
#include "util/Unicode.h"
#include "vm/ErrorReporting.h"
using namespace js;
using namespace js::irregexp;
using mozilla::AssertedCast;
using mozilla::PointerRangeSize;
// ----------------------------------------------------------------------------
@ -258,6 +262,18 @@ RegExpParser<CharT>::RegExpParser(frontend::TokenStreamAnyChars& ts, LifoAlloc*
Advance();
}
static size_t ComputeColumn(const Latin1Char* begin, const Latin1Char* end) {
return PointerRangeSize(begin, end);
}
static size_t ComputeColumn(const char16_t* begin, const char16_t* end) {
#if JS_COLUMN_DIMENSION_IS_CODE_POINTS
return unicode::CountCodePoints(begin, end);
#else
return PointerRangeSize(begin, end);
#endif
}
template <typename CharT>
void
RegExpParser<CharT>::SyntaxError(unsigned errorNumber, ...)
@ -269,7 +285,13 @@ RegExpParser<CharT>::SyntaxError(unsigned errorNumber, ...)
// a line of context based on the expression source.
uint32_t location = ts.currentToken().pos.begin;
if (ts.fillExceptingContext(&err, location)) {
ts.lineAndColumnAt(location, &err.lineNumber, &err.columnNumber);
// Line breaks are not significant in pattern text in the same way as
// in source text, so act as though pattern text is a single line, then
// compute a column based on "code point" count (treating a lone
// surrogate as a "code point" in UTF-16). Gak.
err.lineNumber = 1;
err.columnNumber =
AssertedCast<uint32_t>(ComputeColumn(start_, next_pos_ - 1));
}
// For most error reporting, the line of context derives from the token

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

@ -370,6 +370,7 @@ MSG_DEF(JSMSG_USE_ASM_LINK_FAIL, 1, JSEXN_TYPEERR, "asm.js link error: {0}
MSG_DEF(JSMSG_USE_ASM_TYPE_OK, 1, JSEXN_WARN, "Successfully compiled asm.js code ({0})")
// wasm
MSG_DEF(JSMSG_WASM_VERBOSE, 1, JSEXN_WARN, "WebAssembly verbose: {0}")
MSG_DEF(JSMSG_WASM_COMPILE_WARNING, 1, JSEXN_WARN, "WebAssembly module validated with warning: {0}")
MSG_DEF(JSMSG_WASM_COMPILE_ERROR, 1, JSEXN_WASMCOMPILEERROR, "{0}")
MSG_DEF(JSMSG_WASM_NO_SHMEM_COMPILE, 0, JSEXN_WASMCOMPILEERROR, "shared memory is disabled")

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

@ -466,6 +466,7 @@ class JS_PUBLIC_API ContextOptions {
ion_(true),
asmJS_(true),
wasm_(true),
wasmVerbose_(false),
wasmBaseline_(true),
wasmIon_(true),
#ifdef ENABLE_WASM_CRANELIFT
@ -530,25 +531,23 @@ class JS_PUBLIC_API ContextOptions {
return *this;
}
bool wasmVerbose() const { return wasmVerbose_; }
ContextOptions& setWasmVerbose(bool flag) {
wasmVerbose_ = flag;
return *this;
}
bool wasmBaseline() const { return wasmBaseline_; }
ContextOptions& setWasmBaseline(bool flag) {
wasmBaseline_ = flag;
return *this;
}
ContextOptions& toggleWasmBaseline() {
wasmBaseline_ = !wasmBaseline_;
return *this;
}
bool wasmIon() const { return wasmIon_; }
ContextOptions& setWasmIon(bool flag) {
wasmIon_ = flag;
return *this;
}
ContextOptions& toggleWasmIon() {
wasmIon_ = !wasmIon_;
return *this;
}
#ifdef ENABLE_WASM_CRANELIFT
bool wasmForceCranelift() const { return wasmForceCranelift_; }
@ -556,10 +555,6 @@ class JS_PUBLIC_API ContextOptions {
wasmForceCranelift_ = flag;
return *this;
}
ContextOptions& toggleWasmForceCranelift() {
wasmForceCranelift_ = !wasmForceCranelift_;
return *this;
}
#endif
bool testWasmAwaitTier2() const { return testWasmAwaitTier2_; }
@ -567,10 +562,6 @@ class JS_PUBLIC_API ContextOptions {
testWasmAwaitTier2_ = flag;
return *this;
}
ContextOptions& toggleTestWasmAwaitTier2() {
testWasmAwaitTier2_ = !testWasmAwaitTier2_;
return *this;
}
#ifdef ENABLE_WASM_GC
bool wasmGc() const { return wasmGc_; }
@ -674,6 +665,7 @@ class JS_PUBLIC_API ContextOptions {
bool ion_ : 1;
bool asmJS_ : 1;
bool wasm_ : 1;
bool wasmVerbose_ : 1;
bool wasmBaseline_ : 1;
bool wasmIon_ : 1;
#ifdef ENABLE_WASM_CRANELIFT

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

@ -498,7 +498,6 @@ dnl ========================================================
CFLAGS="$CFLAGS $MOZ_HARDENING_CFLAGS_JS"
CPPFLAGS="$CPPFLAGS $MOZ_HARDENING_CFLAGS_JS"
CXXFLAGS="$CXXFLAGS $MOZ_HARDENING_CFLAGS_JS"
LDFLAGS="$LDFLAGS $MOZ_HARDENING_LDFLAGS_JS"
dnl ========================================================
dnl System overrides of the defaults for target
@ -654,9 +653,6 @@ case "$target" in
if test -z "$MOZ_ASAN"; then
CFLAGS="$CFLAGS -Gw"
CXXFLAGS="$CXXFLAGS -Gw"
else
# String tail merging doesn't play nice with ASan's ODR checker.
LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
fi
# khuey says we can safely ignore MSVC warning C4251
# MSVC warning C4244 (implicit type conversion may lose data) warns

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

@ -492,6 +492,7 @@ static bool wasmForceCranelift = false;
#ifdef ENABLE_WASM_GC
static bool enableWasmGc = false;
#endif
static bool enableWasmVerbose = false;
static bool enableTestWasmAwaitTier2 = false;
static bool enableAsyncStacks = false;
static bool enableStreams = false;
@ -10089,6 +10090,7 @@ static bool SetContextOptions(JSContext* cx, const OptionParser& op) {
enableWasmGc = enableWasmGc && !wasmForceCranelift;
#endif
#endif
enableWasmVerbose = op.getBoolOption("wasm-verbose");
enableTestWasmAwaitTier2 = op.getBoolOption("test-wasm-await-tier2");
enableAsyncStacks = !op.getBoolOption("no-async-stacks");
enableStreams = !op.getBoolOption("no-streams");
@ -10109,6 +10111,7 @@ static bool SetContextOptions(JSContext* cx, const OptionParser& op) {
#ifdef ENABLE_WASM_GC
.setWasmGc(enableWasmGc)
#endif
.setWasmVerbose(enableWasmVerbose)
.setTestWasmAwaitTier2(enableTestWasmAwaitTier2)
.setNativeRegExp(enableNativeRegExp)
.setAsyncStack(enableAsyncStacks);
@ -10435,6 +10438,7 @@ static void SetWorkerContextOptions(JSContext* cx) {
#ifdef ENABLE_WASM_GC
.setWasmGc(enableWasmGc)
#endif
.setWasmVerbose(enableWasmVerbose)
.setTestWasmAwaitTier2(enableTestWasmAwaitTier2)
.setNativeRegExp(enableNativeRegExp);
@ -10723,9 +10727,11 @@ int main(int argc, char** argv, char** envp) {
|| !op.addBoolOption('\0', "wasm-force-cranelift",
"Enable wasm Cranelift compiler")
#endif
|| !op.addBoolOption('\0', "test-wasm-await-tier2",
"Forcibly activate tiering and block "
"instantiation on completion of tier2")
|| !op.addBoolOption('\0', "wasm-verbose",
"Enable WebAssembly verbose logging") ||
!op.addBoolOption('\0', "test-wasm-await-tier2",
"Forcibly activate tiering and block "
"instantiation on completion of tier2")
#ifdef ENABLE_WASM_GC
|| !op.addBoolOption('\0', "wasm-gc", "Enable wasm GC features")
#else

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

@ -768,12 +768,14 @@ static bool CreateBuffer(
RawbufT* buffer = RawbufT::Allocate(initialSize, maxSize);
if (!buffer) {
#ifdef WASM_HUGE_MEMORY
wasm::Log(cx, "huge Memory allocation failed");
ReportOutOfMemory(cx);
return false;
#else
// If we fail, and have a maxSize, try to reserve the biggest chunk in
// the range [initialSize, maxSize) using log backoff.
if (!maxSize) {
wasm::Log(cx, "new Memory({initial=%u bytes}) failed", initialSize);
ReportOutOfMemory(cx);
return false;
}
@ -789,6 +791,7 @@ static bool CreateBuffer(
}
if (!buffer) {
wasm::Log(cx, "new Memory({initial=%u bytes}) failed", initialSize);
ReportOutOfMemory(cx);
return false;
}
@ -826,6 +829,22 @@ static bool CreateBuffer(
allocatedSinceLastTrigger = 0;
}
if (maxSize) {
#ifdef WASM_HUGE_MEMORY
wasm::Log(cx, "new Memory({initial:%u bytes, maximum:%u bytes}) succeeded",
unsigned(initialSize), unsigned(*maxSize));
#else
wasm::Log(cx,
"new Memory({initial:%u bytes, maximum:%u bytes}) succeeded "
"with internal maximum of %u",
unsigned(initialSize), unsigned(*maxSize),
unsigned(object->wasmMaxSize().value()));
#endif
} else {
wasm::Log(cx, "new Memory({initial:%u bytes}) succeeded",
unsigned(initialSize));
}
return true;
}

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

@ -1062,6 +1062,8 @@ static bool ReportCompileWarnings(JSContext* cx,
Value* vp) {
CallArgs callArgs = CallArgsFromVp(argc, vp);
Log(cx, "sync new Module() started");
if (!ThrowIfNotConstructing(cx, callArgs, "Module")) {
return false;
}
@ -1112,6 +1114,8 @@ static bool ReportCompileWarnings(JSContext* cx,
return false;
}
Log(cx, "sync new Module() succeded");
callArgs.rval().setObject(*moduleObj);
return true;
}
@ -1317,6 +1321,8 @@ static bool Instantiate(JSContext* cx, const Module& module,
Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
Log(cx, "sync new Instance() started");
if (!ThrowIfNotConstructing(cx, args, "Instance")) {
return false;
}
@ -1342,6 +1348,8 @@ static bool Instantiate(JSContext* cx, const Module& module,
return false;
}
Log(cx, "sync new Instance() succeeded");
args.rval().setObject(*instanceObj);
return true;
}
@ -2725,7 +2733,8 @@ static bool Reject(JSContext* cx, const CompileArgs& args,
static bool Resolve(JSContext* cx, const Module& module,
Handle<PromiseObject*> promise, bool instantiate,
HandleObject importObj, const UniqueCharsVector& warnings) {
HandleObject importObj, const UniqueCharsVector& warnings,
const char* methodSuffix = "") {
if (!ReportCompileWarnings(cx, warnings)) {
return false;
}
@ -2769,6 +2778,9 @@ static bool Resolve(JSContext* cx, const Module& module,
return RejectWithPendingException(cx, promise);
}
Log(cx, "async %s%s() succeeded", (instantiate ? "instantiate" : "compile"),
methodSuffix);
return true;
}
@ -2850,6 +2862,8 @@ static bool WebAssembly_compile(JSContext* cx, unsigned argc, Value* vp) {
return false;
}
Log(cx, "async compile() started");
Rooted<PromiseObject*> promise(cx, PromiseObject::createSkippingExecutor(cx));
if (!promise) {
return false;
@ -2897,6 +2911,8 @@ static bool WebAssembly_instantiate(JSContext* cx, unsigned argc, Value* vp) {
return false;
}
Log(cx, "async instantiate() started");
Rooted<PromiseObject*> promise(cx, PromiseObject::createSkippingExecutor(cx));
if (!promise) {
return false;
@ -2921,6 +2937,8 @@ static bool WebAssembly_instantiate(JSContext* cx, unsigned argc, Value* vp) {
if (!PromiseObject::resolve(cx, promise, resolutionValue)) {
return false;
}
Log(cx, "async instantiate() succeeded");
} else {
auto task = cx->make_unique<CompileBufferTask>(cx, promise, importObj);
if (!task || !task->init(cx, "WebAssembly.instantiate")) {
@ -2960,6 +2978,11 @@ static bool WebAssembly_validate(JSContext* cx, unsigned argc, Value* vp) {
return false;
}
if (error) {
MOZ_ASSERT(!validated);
Log(cx, "validate() failed with: %s", error.get());
}
callArgs.rval().setBoolean(validated);
return true;
}
@ -3001,32 +3024,43 @@ static bool RejectWithStreamErrorNumber(JSContext* cx, size_t errorCode,
}
class CompileStreamTask : public PromiseHelperTask, public JS::StreamConsumer {
// The stream progresses monotonically through these states; the helper
// thread wait()s for streamState_ to reach Closed.
enum StreamState { Env, Code, Tail, Closed };
typedef ExclusiveWaitableData<StreamState> ExclusiveStreamState;
ExclusiveWaitableData<StreamState> streamState_;
// Immutable:
const MutableCompileArgs compileArgs_; // immutable during streaming
const bool instantiate_;
const PersistentRootedObject importObj_;
// Mutated on a stream thread (consumeChunk(), streamEnd(), streamError()):
ExclusiveStreamState streamState_;
Bytes envBytes_; // immutable after Env state
SectionRange codeSection_; // immutable after Env state
Bytes codeBytes_; // not resized after Env state
// Immutable after noteResponseURLs() which is called at most once before
// first call on stream thread:
const MutableCompileArgs compileArgs_;
// Immutable after Env state:
Bytes envBytes_;
SectionRange codeSection_;
// The code section vector is resized once during the Env state and filled
// in chunk by chunk during the Code state, updating the end-pointer after
// each chunk:
Bytes codeBytes_;
uint8_t* codeBytesEnd_;
ExclusiveBytesPtr exclusiveCodeBytesEnd_;
Bytes tailBytes_; // immutable after Tail state
ExclusiveStreamEndData exclusiveStreamEnd_;
Maybe<size_t> streamError_;
Atomic<bool> streamFailed_;
Tier2Listener tier2Listener_;
// Mutated on helper thread (execute()):
// Immutable after Tail state:
Bytes tailBytes_;
ExclusiveStreamEndData exclusiveStreamEnd_;
// Written once before Closed state and read in Closed state on main thread:
SharedModule module_;
Maybe<size_t> streamError_;
UniqueChars compileError_;
UniqueCharsVector warnings_;
// Set on stream thread and read racily on helper thread to abort compilation:
Atomic<bool> streamFailed_;
// Called on some thread before consumeChunk(), streamEnd(), streamError()):
void noteResponseURLs(const char* url, const char* sourceMapUrl) override {
@ -3178,14 +3212,16 @@ class CompileStreamTask : public PromiseHelperTask, public JS::StreamConsumer {
return;
}
case Code:
case Tail: {
auto streamEnd = exclusiveStreamEnd_.lock();
MOZ_ASSERT(!streamEnd->reached);
streamEnd->reached = true;
streamEnd->tailBytes = &tailBytes_;
streamEnd->tier2Listener = tier2Listener;
streamEnd.notify_one();
}
case Tail:
// Unlock exclusiveStreamEnd_ before locking streamState_.
{
auto streamEnd = exclusiveStreamEnd_.lock();
MOZ_ASSERT(!streamEnd->reached);
streamEnd->reached = true;
streamEnd->tailBytes = &tailBytes_;
streamEnd->tier2Listener = tier2Listener;
streamEnd.notify_one();
}
setClosedAndDestroyAfterHelperThreadStarted();
return;
case Closed:
@ -3236,13 +3272,18 @@ class CompileStreamTask : public PromiseHelperTask, public JS::StreamConsumer {
bool resolve(JSContext* cx, Handle<PromiseObject*> promise) override {
MOZ_ASSERT(streamState_.lock() == Closed);
MOZ_ASSERT_IF(module_, !streamFailed_ && !streamError_ && !compileError_);
return module_
? Resolve(cx, *module_, promise, instantiate_, importObj_,
warnings_)
: streamError_
? RejectWithStreamErrorNumber(cx, *streamError_, promise)
: Reject(cx, *compileArgs_, promise, compileError_);
if (module_) {
MOZ_ASSERT(!streamFailed_ && !streamError_ && !compileError_);
return Resolve(cx, *module_, promise, instantiate_, importObj_, warnings_,
"Streaming");
}
if (streamError_) {
return RejectWithStreamErrorNumber(cx, *streamError_, promise);
}
return Reject(cx, *compileArgs_, promise, compileError_);
}
public:
@ -3250,10 +3291,10 @@ class CompileStreamTask : public PromiseHelperTask, public JS::StreamConsumer {
CompileArgs& compileArgs, bool instantiate,
HandleObject importObj)
: PromiseHelperTask(cx, promise),
compileArgs_(&compileArgs),
streamState_(mutexid::WasmStreamStatus, Env),
instantiate_(instantiate),
importObj_(cx, importObj),
streamState_(mutexid::WasmStreamStatus, Env),
compileArgs_(&compileArgs),
codeSection_{},
codeBytesEnd_(nullptr),
exclusiveCodeBytesEnd_(mutexid::WasmCodeBytesEnd, nullptr),
@ -3446,6 +3487,8 @@ static bool WebAssembly_compileStreaming(JSContext* cx, unsigned argc,
return false;
}
Log(cx, "async compileStreaming() started");
Rooted<PromiseObject*> promise(cx, PromiseObject::createSkippingExecutor(cx));
if (!promise) {
return false;
@ -3467,6 +3510,8 @@ static bool WebAssembly_instantiateStreaming(JSContext* cx, unsigned argc,
return false;
}
Log(cx, "async instantiateStreaming() started");
Rooted<PromiseObject*> promise(cx, PromiseObject::createSkippingExecutor(cx));
if (!promise) {
return false;

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

@ -18,6 +18,7 @@
#include "wasm/WasmTypes.h"
#include "js/Printf.h"
#include "vm/ArrayBufferObject.h"
#include "wasm/WasmBaselineCompile.h"
#include "wasm/WasmInstance.h"
@ -857,3 +858,24 @@ void TlsData::resetInterrupt(JSContext* cx) {
interrupt = false;
stackLimit = cx->stackLimitForJitCode(JS::StackForUntrustedScript);
}
void wasm::Log(JSContext* cx, const char* fmt, ...) {
MOZ_ASSERT(!cx->isExceptionPending());
if (!cx->options().wasmVerbose()) {
return;
}
va_list args;
va_start(args, fmt);
if (UniqueChars chars = JS_vsmprintf(fmt, args)) {
JS_ReportErrorFlagsAndNumberASCII(cx, JSREPORT_WARNING, GetErrorMessage,
nullptr, JSMSG_WASM_VERBOSE, chars.get());
if (cx->isExceptionPending()) {
cx->clearPendingException();
}
}
va_end(args);
}

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

@ -2519,6 +2519,10 @@ class DebugFrame {
static void alignmentStaticAsserts();
};
// Verbose logging support.
extern void Log(JSContext* cx, const char* fmt, ...) MOZ_FORMAT_PRINTF(2, 3);
} // namespace wasm
} // namespace js

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

@ -777,6 +777,7 @@ static void ReloadPrefsCallback(const char* pref, XPCJSContext* xpccx) {
#ifdef ENABLE_WASM_GC
bool useWasmGc = Preferences::GetBool(JS_OPTIONS_DOT_STR "wasm_gc");
#endif
bool useWasmVerbose = Preferences::GetBool(JS_OPTIONS_DOT_STR "wasm_verbose");
bool throwOnAsmJSValidationFailure = Preferences::GetBool(
JS_OPTIONS_DOT_STR "throw_on_asmjs_validation_failure");
bool useNativeRegExp =
@ -869,6 +870,7 @@ static void ReloadPrefsCallback(const char* pref, XPCJSContext* xpccx) {
#ifdef ENABLE_WASM_GC
.setWasmGc(useWasmGc)
#endif
.setWasmVerbose(useWasmVerbose)
.setThrowOnAsmJSValidationFailure(throwOnAsmJSValidationFailure)
.setNativeRegExp(useNativeRegExp)
.setAsyncStack(useAsyncStack)

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

@ -1454,6 +1454,7 @@ pref("javascript.options.ion.threshold", 1000);
pref("javascript.options.ion.frequent_bailout_threshold", 10);
pref("javascript.options.asmjs", true);
pref("javascript.options.wasm", true);
pref("javascript.options.wasm_verbose", false);
pref("javascript.options.wasm_ionjit", true);
pref("javascript.options.wasm_baselinejit", true);
#ifdef ENABLE_WASM_CRANELIFT

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

@ -382,7 +382,6 @@ dnl ========================================================
CFLAGS="$CFLAGS $MOZ_HARDENING_CFLAGS"
CPPFLAGS="$CPPFLAGS $MOZ_HARDENING_CFLAGS"
CXXFLAGS="$CXXFLAGS $MOZ_HARDENING_CFLAGS"
LDFLAGS="$LDFLAGS $MOZ_HARDENING_LDFLAGS"
dnl ========================================================
dnl GNU specific defaults
@ -805,9 +804,6 @@ case "$target" in
if test -z "$MOZ_ASAN"; then
CFLAGS="$CFLAGS -Gw"
CXXFLAGS="$CXXFLAGS -Gw"
else
# String tail merging doesn't play nice with ASan's ODR checker.
LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
fi
# khuey says we can safely ignore MSVC warning C4251
# MSVC warning C4244 (implicit type conversion may lose data) warns

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

@ -235,10 +235,16 @@ bool SandboxBroker::LaunchApp(const wchar_t* aPath, const wchar_t* aArguments,
key.AppendInt(static_cast<uint32_t>(last_error), 16);
// Only accumulate for each combination once per session.
if (!sLaunchErrors->Contains(key)) {
if (sLaunchErrors) {
if (!sLaunchErrors->Contains(key)) {
Telemetry::Accumulate(Telemetry::SANDBOX_FAILED_LAUNCH_KEYED, key,
result);
sLaunchErrors->PutEntry(key);
}
} else {
// If sLaunchErrors not created yet then always accumulate.
Telemetry::Accumulate(Telemetry::SANDBOX_FAILED_LAUNCH_KEYED, key,
result);
sLaunchErrors->PutEntry(key);
}
LOG_E(

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

@ -238,6 +238,9 @@ int registerFunctions(sqlite3 *aDB) {
{"levenshteinDistance", 2, SQLITE_UTF16, 0, levenshteinDistanceFunction},
{"levenshteinDistance", 2, SQLITE_UTF8, 0, levenshteinDistanceFunction},
{"utf16Length", 1, SQLITE_UTF16, 0, utf16LengthFunction},
{"utf16Length", 1, SQLITE_UTF8, 0, utf16LengthFunction},
};
int rv = SQLITE_OK;
@ -339,5 +342,18 @@ void levenshteinDistanceFunction(sqlite3_context *aCtx, int aArgc,
}
}
void utf16LengthFunction(sqlite3_context *aCtx, int aArgc,
sqlite3_value **aArgv) {
NS_ASSERTION(1 == aArgc, "Invalid number of arguments!");
nsDependentString data(
static_cast<const char16_t *>(::sqlite3_value_text16(aArgv[0])));
int len = data.Length();
// Set the result.
::sqlite3_result_int(aCtx, len);
}
} // namespace storage
} // namespace mozilla

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

@ -65,6 +65,20 @@ void likeFunction(sqlite3_context *aCtx, int aArgc, sqlite3_value **aArgv);
void levenshteinDistanceFunction(sqlite3_context *aCtx, int aArgc,
sqlite3_value **aArgv);
/**
* An alternative string length function that uses XPCOM string classes for
* string length calculation.
*
* @param aCtx
* The sqlite_context that this function is being called on.
* @param aArgc
* The number of arguments the function is being called with.
* @param aArgv
* An array of the arguments the functions is being called with.
*/
void utf16LengthFunction(sqlite3_context *aCtx, int aArgc,
sqlite3_value **aArgv);
} // namespace storage
} // namespace mozilla