import changes from `dev' branch of rmottola/Arctic-Fox:

- missing bit of Bug 1209403 - Build xpidl stuff in the faster make backend. (2b46f612d4)
- Bug 1209875 - Get rid of XULPPFLAGS. r=gps (84b1e0140e)
- Bug 1220731 - Refactor embedjs script for use from moz.build rather than makefiles r=shu r=glandium (064363aef4)
- Bug 1212015 - Fix an unchecked allocation in AsmJS r=terrence (c77978cae6)
- Bug 1218641 - IonMonkey: MIPS64: Add support into asmjs. r=lth (c856ea1842)
- Bug 1219821 - remove static failure, make it dynamic r=arai a=me (eec5ffaa57)
- Bug 1210611 - Globally define MOZILLA_OFFICIAL. r=glandium (c06518f942)
- Bug 1211765 - Remove remnants from --with-libxul-sdk. r=bsmedberg (79a4d4e4aa)
- Bug 1221453 - Use SourcePaths for LOCAL_INCLUDES. r=gps (abb032990d)
- Bug 1176094 - [ATK] Assign role SECTION to math groups instead of PANEL/UNKNOWN. r=surkov (18b059a017)
- Bug 1175182 - Expose fractions and roots as ATK_ROLE_PANEL for ATK < 2.16. r=surkov (6d00256e56)
- bug 1171728 - null check the result of ProxyAccessible::OuterDocOfRemoteBrowser (378533bdaf)
- Bug 1207253 - make getChildCountCB correctly deal with outerdoc accessibles with proxy children, r=tbsaunde (303d37a9d3)
- bug 1209615 - make remote primary docs RELATION_EMBEDS targets for atk r=davidb (782635334d)
- bug 1196880 - correctly compute interfaces for proxies r=davidb (2ee6b6ffdd)
- bug 1210803 - expose the selection interface on proxied accessibles r=davidb (006b68ee32)
- bug 1210884 - expose the action interface on proxied accessibles r=davidb (837add2013)
- bug 1185122 - don't try and fire platform events in the child process r=lsocks (622e18ed2c)
- Bug 1210108 - Emit object:state-changed:showing event for doorhangers, r=tbsaunde (bd2d410651)
- bug 1164193 - emit a few more events on proxied accessibles for atk r=davidb (79b0d7a324)
- bug 1213516 - fire showing state change event for atk in place of an alert event r=davidb (08efdc7620)
- Bug 1209470 - Remove use of expression closure from Add-on SDK. r=mossop (736026d0e9)
- Bug 1212693 - Remove skipCOWCallableChecks. r=bz (e1b7c21fe5)
- Bug 877896 - Print stack trace in the console service. r=bholley (4667c5df15)
- Bug 1157648 - Make nsScriptError::ToString use only the first 512 characters of mSourceName and mSourceLine. r=bholley (8cabd24397)
- Bug 1052139 - Continued work on making the global object's prototype chain immutable, once a switch is flipped. r=bz (3f7549bd11)
- Bug 1052139 - Adjust sandbox code to create the sandbox with an (observably) immutable [[Prototype]], once the flag's flipped. r=bz (66b846642c)
- Bug 1184382 - Handle a sandboxPrototype we don't subsume. r=gabor (1736954a3e)
- Bug 1205707 part 1 - Clean up some is-TypedArrayObject code in Ion. r=Waldo (08d95d5db4)
- Bug 1205707 part 2 - Add test. r=Waldo (d1af75fe83)
This commit is contained in:
2022-11-01 15:07:30 +08:00
parent 1f56788b39
commit 45942a6da5
123 changed files with 921 additions and 694 deletions
+3 -4
View File
@@ -39,13 +39,11 @@ ifndef MOZ_PROFILE_USE
# otherwise the rule in rules.mk doesn't run early enough.
$(TIERS) binaries:: CLOBBER $(configure_dir)/configure config.status backend.RecursiveMakeBackend
ifndef JS_STANDALONE
ifndef LIBXUL_SDK
ifdef COMPILE_ENVIRONMENT
$(TIERS) binaries:: $(topsrcdir)/js/src/configure js/src/config.status
endif
endif
endif
endif
ifdef JS_STANDALONE
.PHONY: CLOBBER
@@ -106,7 +104,6 @@ install_manifest_depends = \
$(NULL)
ifndef JS_STANDALONE
ifndef LIBXUL_SDK
ifdef COMPILE_ENVIRONMENT
install_manifest_depends += \
$(topsrcdir)/js/src/configure \
@@ -114,7 +111,6 @@ install_manifest_depends += \
$(NULL)
endif
endif
endif
.PHONY: install-manifests
install-manifests: $(addprefix install-,$(install_manifests))
@@ -132,6 +128,9 @@ endif
$(addprefix install-,$(filter dist/%,$(install_manifests))): install-dist/%: $(install_manifest_depends)
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )$(DIST)/$* _build_manifests/install/dist_$*)
# Dummy wrapper rule to allow the faster backend to piggy back
install-dist_%: install-dist/% ;
install-_tests: $(install_manifest_depends)
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )_tests _build_manifests/install/tests)
+71 -10
View File
@@ -685,12 +685,12 @@ getRoleCB(AtkObject *aAtkObj)
else if (aAtkObj->role == ATK_ROLE_TABLE_ROW && !IsAtkVersionAtLeast(2, 1))
aAtkObj->role = ATK_ROLE_LIST_ITEM;
else if (aAtkObj->role == ATK_ROLE_MATH && !IsAtkVersionAtLeast(2, 12))
aAtkObj->role = ATK_ROLE_PANEL;
aAtkObj->role = ATK_ROLE_SECTION;
else if (aAtkObj->role == ATK_ROLE_STATIC && !IsAtkVersionAtLeast(2, 16))
aAtkObj->role = ATK_ROLE_TEXT;
else if ((aAtkObj->role == ATK_ROLE_MATH_FRACTION ||
aAtkObj->role == ATK_ROLE_MATH_ROOT) && !IsAtkVersionAtLeast(2, 16))
aAtkObj->role = ATK_ROLE_UNKNOWN;
aAtkObj->role = ATK_ROLE_SECTION;
return aAtkObj->role;
}
@@ -807,7 +807,11 @@ getParentCB(AtkObject *aAtkObj)
atkParent = GetWrapperFor(parent);
} else {
// Otherwise this should be the proxy for the tab's top level document.
atkParent = AccessibleWrap::GetAtkObject(proxy->OuterDocOfRemoteBrowser());
Accessible* outerDocParent = proxy->OuterDocOfRemoteBrowser();
NS_ASSERTION(outerDocParent, "this document should have an outerDoc as a parent");
if (outerDocParent) {
atkParent = AccessibleWrap::GetAtkObject(outerDocParent);
}
}
}
@@ -825,7 +829,15 @@ getChildCountCB(AtkObject *aAtkObj)
return 0;
}
return static_cast<gint>(accWrap->EmbeddedChildCount());
uint32_t count = accWrap->EmbeddedChildCount();
if (count) {
return static_cast<gint>(count);
}
OuterDocAccessible* outerDoc = accWrap->AsOuterDoc();
if (outerDoc && outerDoc->RemoteChildDoc()) {
return 1;
}
}
ProxyAccessible* proxy = GetProxy(aAtkObj);
@@ -973,6 +985,13 @@ UpdateAtkRelation(RelationType aType, Accessible* aAcc,
while ((tempAcc = rel.Next()))
targets.AppendElement(AccessibleWrap::GetAtkObject(tempAcc));
if (aType == RelationType::EMBEDS && aAcc->IsRoot()) {
if (ProxyAccessible* proxyDoc =
aAcc->AsRoot()->GetPrimaryRemoteTopLevelContentDoc()) {
targets.AppendElement(GetWrapperFor(proxyDoc));
}
}
if (targets.Length()) {
atkRelation = atk_relation_new(targets.Elements(),
targets.Length(), aAtkType);
@@ -1091,19 +1110,27 @@ GetInterfacesForProxy(ProxyAccessible* aProxy, uint32_t aInterfaces)
| (1 << MAI_INTERFACE_EDITABLE_TEXT);
if (aInterfaces & Interfaces::HYPERLINK)
interfaces |= MAI_INTERFACE_HYPERLINK_IMPL;
interfaces |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
if (aInterfaces & Interfaces::VALUE)
interfaces |= MAI_INTERFACE_VALUE;
interfaces |= 1 << MAI_INTERFACE_VALUE;
if (aInterfaces & Interfaces::TABLE)
interfaces |= MAI_INTERFACE_TABLE;
interfaces |= 1 << MAI_INTERFACE_TABLE;
if (aInterfaces & Interfaces::IMAGE)
interfaces |= MAI_INTERFACE_IMAGE;
interfaces |= 1 << MAI_INTERFACE_IMAGE;
if (aInterfaces & Interfaces::DOCUMENT)
interfaces |= MAI_INTERFACE_DOCUMENT;
interfaces |= 1 << MAI_INTERFACE_DOCUMENT;
if (aInterfaces & Interfaces::SELECTION) {
interfaces |= 1 << MAI_INTERFACE_SELECTION;
}
if (aInterfaces & Interfaces::ACTION) {
interfaces |= 1 << MAI_INTERFACE_ACTION;
}
return interfaces;
}
@@ -1142,6 +1169,10 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
nsresult rv = Accessible::HandleAccEvent(aEvent);
NS_ENSURE_SUCCESS(rv, rv);
if (IPCAccessibilityActive()) {
return NS_OK;
}
Accessible* accessible = aEvent->GetAccessible();
NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
@@ -1238,6 +1269,11 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
break;
}
case nsIAccessibleEvent::EVENT_ALERT:
// A hack using state change showing events as alert events.
atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, true);
break;
case nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED:
g_signal_emit_by_name(atkObj, "text_selection_changed");
break;
@@ -1411,9 +1447,34 @@ void
a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType)
{
AtkObject* wrapper = GetWrapperFor(aTarget);
if (aEventType == nsIAccessibleEvent::EVENT_FOCUS) {
switch (aEventType) {
case nsIAccessibleEvent::EVENT_FOCUS:
atk_focus_tracker_notify(wrapper);
atk_object_notify_state_change(wrapper, ATK_STATE_FOCUSED, true);
break;
case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE:
g_signal_emit_by_name(wrapper, "load_complete");
break;
case nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD:
g_signal_emit_by_name(wrapper, "reload");
break;
case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED:
g_signal_emit_by_name(wrapper, "load_stopped");
break;
case nsIAccessibleEvent::EVENT_MENUPOPUP_START:
atk_focus_tracker_notify(wrapper); // fire extra focus event
atk_object_notify_state_change(wrapper, ATK_STATE_VISIBLE, true);
atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, true);
break;
case nsIAccessibleEvent::EVENT_MENUPOPUP_END:
atk_object_notify_state_change(wrapper, ATK_STATE_VISIBLE, false);
atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, false);
break;
case nsIAccessibleEvent::EVENT_ALERT:
// A hack using state change showing events as alert events.
atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, true);
break;
}
}
+13 -13
View File
@@ -1122,7 +1122,7 @@ ROLE(MATHML_GLYPH,
ROLE(MATHML_ROW,
"mathml row",
ATK_ROLE_PANEL,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1154,7 +1154,7 @@ ROLE(MATHML_ROOT,
ROLE(MATHML_FENCED,
"mathml fenced",
ATK_ROLE_PANEL,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1162,7 +1162,7 @@ ROLE(MATHML_FENCED,
ROLE(MATHML_ENCLOSED,
"mathml enclosed",
ATK_ROLE_PANEL,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1170,7 +1170,7 @@ ROLE(MATHML_ENCLOSED,
ROLE(MATHML_STYLE,
"mathml style",
ATK_ROLE_PANEL,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1178,7 +1178,7 @@ ROLE(MATHML_STYLE,
ROLE(MATHML_SUB,
"mathml sub",
ATK_ROLE_UNKNOWN,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1186,7 +1186,7 @@ ROLE(MATHML_SUB,
ROLE(MATHML_SUP,
"mathml sup",
ATK_ROLE_UNKNOWN,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1194,7 +1194,7 @@ ROLE(MATHML_SUP,
ROLE(MATHML_SUB_SUP,
"mathml sub sup",
ATK_ROLE_UNKNOWN,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1202,7 +1202,7 @@ ROLE(MATHML_SUB_SUP,
ROLE(MATHML_UNDER,
"mathml under",
ATK_ROLE_UNKNOWN,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1210,7 +1210,7 @@ ROLE(MATHML_UNDER,
ROLE(MATHML_OVER,
"mathml over",
ATK_ROLE_UNKNOWN,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1218,7 +1218,7 @@ ROLE(MATHML_OVER,
ROLE(MATHML_UNDER_OVER,
"mathml under over",
ATK_ROLE_UNKNOWN,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1226,7 +1226,7 @@ ROLE(MATHML_UNDER_OVER,
ROLE(MATHML_MULTISCRIPTS,
"mathml multiscripts",
ATK_ROLE_UNKNOWN,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1266,7 +1266,7 @@ ROLE(MATHML_CELL,
ROLE(MATHML_ACTION,
"mathml action",
ATK_ROLE_UNKNOWN,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
@@ -1274,7 +1274,7 @@ ROLE(MATHML_ACTION,
ROLE(MATHML_ERROR,
"mathml error",
ATK_ROLE_PANEL,
ATK_ROLE_SECTION,
NSAccessibilityGroupRole,
0,
IA2_ROLE_UNKNOWN,
+8
View File
@@ -46,6 +46,14 @@ InterfacesFor(Accessible* aAcc)
if (aAcc->IsDoc())
interfaces |= Interfaces::DOCUMENT;
if (aAcc->IsSelect()) {
interfaces |= Interfaces::SELECTION;
}
if (aAcc->ActionCount()) {
interfaces |= Interfaces::ACTION;
}
return interfaces;
}
+2
View File
@@ -379,6 +379,8 @@ enum Interfaces
TABLE = 16,
TABLECELL = 32,
DOCUMENT = 64,
SELECTION = 128,
ACTION = 256,
};
}
+4
View File
@@ -94,6 +94,10 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
nsresult rv = Accessible::HandleAccEvent(aEvent);
NS_ENSURE_SUCCESS(rv, rv);
if (IPCAccessibilityActive()) {
return NS_OK;
}
uint32_t eventType = aEvent->GetEventType();
// ignore everything but focus-changed, value-changed, caret and selection
@@ -1180,6 +1180,10 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
nsresult rv = Accessible::HandleAccEvent(aEvent);
NS_ENSURE_SUCCESS(rv, rv);
if (IPCAccessibilityActive()) {
return NS_OK;
}
uint32_t eventType = aEvent->GetEventType();
static_assert(sizeof(gWinEventMap)/sizeof(gWinEventMap[0]) == nsIAccessibleEvent::EVENT_LAST_ENTRY,
+2 -4
View File
@@ -3,10 +3,8 @@
# 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/.
if not CONFIG['LIBXUL_SDK']:
include('/toolkit/toolkit.mozbuild')
elif CONFIG['ENABLE_TESTS']:
DIRS += ['/testing/mochitest']
include('/toolkit/toolkit.mozbuild')
if CONFIG['MOZ_EXTENSIONS']:
DIRS += ['/extensions']
-10
View File
@@ -62,24 +62,14 @@ tools repackage:: $(libs-preqs)
sed -e 's/%APP_VERSION%/$(APP_VERSION)/' -e 's/%APP_NAME%/$(APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/$(LPROJ)/InfoPlist.strings
rsync -a --exclude 'mangle' --exclude 'shlibsign' --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/Resources
rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/MacOS
ifdef LIBXUL_SDK
cp $(LIBXUL_DIST)/bin/xulrunner$(BIN_SUFFIX) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(APP_BINARY)
rsync -a --exclude nsinstall --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(APP_NAME).app/Contents/Frameworks
else
$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
endif
cp -RL $(srcdir)/b2g.icns $(DIST)/$(APP_NAME).app/Contents/Resources/$(MOZ_APP_NAME).icns
printf APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
else # MOZ_WIDGET_TOOLKIT != cocoa
libs::
ifdef LIBXUL_SDK
cp $(LIBXUL_DIST)/bin/xulrunner-stub$(BIN_SUFFIX) $(DIST)/bin/$(APP_BINARY)
$(NSINSTALL) -D $(DIST)/bin/xulrunner
(cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)
endif
$(NSINSTALL) -D $(DIST)/bin/chrome/icons/default
# Copy the app icon for b2g-desktop
+17 -18
View File
@@ -4,27 +4,26 @@
# 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/.
if not CONFIG['LIBXUL_SDK']:
if CONFIG['GAIADIR']:
GeckoProgram(CONFIG['MOZ_APP_NAME'] + "-bin")
else:
GeckoProgram(CONFIG['MOZ_APP_NAME'])
if CONFIG['MOZ_B2G_LOADER']:
SOURCES += [
'B2GLoader.cpp',
]
if CONFIG['GAIADIR']:
GeckoProgram(CONFIG['MOZ_APP_NAME'] + "-bin")
else:
GeckoProgram(CONFIG['MOZ_APP_NAME'])
if CONFIG['MOZ_B2G_LOADER']:
SOURCES += [
'nsBrowserApp.cpp',
'B2GLoader.cpp',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
USE_LIBS += [
'zlib',
]
SOURCES += [
'nsBrowserApp.cpp',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
USE_LIBS += [
'zlib',
]
for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION', 'MOZ_UPDATER'):
DEFINES[var] = CONFIG[var]
-4
View File
@@ -48,11 +48,7 @@ fi
# use custom widget for html:select
MOZ_USE_NATIVE_POPUP_WINDOWS=1
if test "$LIBXUL_SDK"; then
MOZ_XULRUNNER=1
else
MOZ_XULRUNNER=
fi
MOZ_MEDIA_NAVIGATOR=1
+1 -2
View File
@@ -3,8 +3,7 @@
# 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/.
if not CONFIG['LIBXUL_SDK']:
include('/toolkit/toolkit.mozbuild')
include('/toolkit/toolkit.mozbuild')
if CONFIG['MOZ_EXTENSIONS']:
DIRS += ['/extensions']
+1 -9
View File
@@ -57,7 +57,7 @@ $(DIST)/branding:
libs::
@if test -f '$(LOCALE_SRCDIR)/existing-profile-defaults.js'; then \
$(PYTHON) -m mozbuild.action.preprocessor $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
$(PYTHON) -m mozbuild.action.preprocessor $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) \
$(LOCALE_SRCDIR)/existing-profile-defaults.js -o $(FINAL_TARGET)/defaults/existing-profile-defaults.js; \
fi
@@ -117,18 +117,10 @@ installers-%: clobber-% langpack-% repackage-win32-installer-% repackage-zip-%
# When we unpack b2g on MacOS X the platform.ini and application.ini are in slightly
# different locations that on all other platforms
ifeq (Darwin, $(OS_ARCH))
ifdef LIBXUL_SDK
GECKO_PLATFORM_INI_PATH='$(STAGEDIST)/../Frameworks/XUL.framework/Versions/$(MOZILLA_VERSION)/platform.ini'
else
GECKO_PLATFORM_INI_PATH='$(STAGEDIST)/platform.ini'
endif
B2G_APPLICATION_INI_PATH='$(STAGEDIST)/application.ini'
else
ifdef LIBXUL_SDK
GECKO_PLATFORM_INI_PATH='$(STAGEDIST)/xulrunner/platform.ini'
else
GECKO_PLATFORM_INI_PATH='$(STAGEDIST)/platform.ini'
endif
B2G_APPLICATION_INI_PATH='$(STAGEDIST)/application.ini'
endif
+1 -2
View File
@@ -3,8 +3,7 @@
# 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/.
if not CONFIG['LIBXUL_SDK']:
include('/toolkit/toolkit.mozbuild')
include('/toolkit/toolkit.mozbuild')
if CONFIG['MOZ_EXTENSIONS']:
DIRS += ['/extensions']
-14
View File
@@ -56,12 +56,10 @@ libs::
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(FINAL_TARGET)/chrome/icons/default
endif
ifndef LIBXUL_SDK
# channel-prefs.js is handled separate from other prefs due to bug 756325
libs:: $(srcdir)/profile/channel-prefs.js
$(NSINSTALL) -D $(DIST)/bin/defaults/pref
$(call py_action,preprocessor,-Fsubstitution $(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)
endif
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
@@ -101,15 +99,3 @@ tools repackage:: $(PROGRAM)
cp -RL $(DIST)/branding/document.icns $(dist_dest)/Contents/Resources/document.icns
printf APPLMOZB > $(dist_dest)/Contents/PkgInfo
endif
ifdef LIBXUL_SDK #{
ifndef SKIP_COPY_XULRUNNER #{
libs::
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) #{
rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(dist_dest)/Contents/Frameworks
else
$(NSINSTALL) -D $(DIST)/bin/xulrunner
(cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)
endif #} cocoa
endif #} SKIP_COPY_XULRUNNER
endif #} LIBXUL_SDK
-9
View File
@@ -16,11 +16,6 @@ JS_PREFERENCE_FILES += [
'profile/palemoon.js',
]
if CONFIG['LIBXUL_SDK']:
PREF_JS_EXPORTS += [
'profile/channel-prefs.js',
]
SOURCES += [
'nsBrowserApp.cpp',
]
@@ -30,10 +25,6 @@ FINAL_TARGET_FILES.defaults.profile += ['profile/prefs.js']
DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
for var in ('MOZILLA_OFFICIAL', 'LIBXUL_SDK'):
if CONFIG[var]:
DEFINES[var] = True
DEFINES['XPCOM_GLUE'] = True
GENERATED_INCLUDES += [
+3 -50
View File
@@ -224,11 +224,6 @@ FileExists(const char *path)
#endif
}
#ifdef LIBXUL_SDK
# define XPCOM_PATH "xulrunner" XPCOM_FILE_PATH_SEPARATOR XPCOM_DLL
#else
# define XPCOM_PATH XPCOM_DLL
#endif
static nsresult
InitXPCOMGlue(const char *argv0, nsIFile **xreDirectory)
{
@@ -241,55 +236,13 @@ InitXPCOMGlue(const char *argv0, nsIFile **xreDirectory)
}
char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
if (!lastSlash || (size_t(lastSlash - exePath) > MAXPATHLEN - sizeof(XPCOM_PATH) - 1))
if (!lastSlash || (size_t(lastSlash - exePath) > MAXPATHLEN -
sizeof(XPCOM_DLL) - 1))
return NS_ERROR_FAILURE;
strcpy(lastSlash + 1, XPCOM_PATH);
lastSlash += sizeof(XPCOM_PATH) - sizeof(XPCOM_DLL);
strcpy(lastSlash + 1, XPCOM_DLL);
if (!FileExists(exePath)) {
#if defined(LIBXUL_SDK) && defined(XP_MACOSX)
// Check for <bundle>/Contents/Frameworks/XUL.framework/libxpcom.dylib
bool greFound = false;
CFBundleRef appBundle = CFBundleGetMainBundle();
if (!appBundle)
return NS_ERROR_FAILURE;
CFURLRef fwurl = CFBundleCopyPrivateFrameworksURL(appBundle);
CFURLRef absfwurl = nullptr;
if (fwurl) {
absfwurl = CFURLCopyAbsoluteURL(fwurl);
CFRelease(fwurl);
}
if (absfwurl) {
CFURLRef xulurl =
CFURLCreateCopyAppendingPathComponent(nullptr, absfwurl,
CFSTR("XUL.framework"),
true);
if (xulurl) {
CFURLRef xpcomurl =
CFURLCreateCopyAppendingPathComponent(nullptr, xulurl,
CFSTR("libxpcom.dylib"),
false);
if (xpcomurl) {
if (CFURLGetFileSystemRepresentation(xpcomurl, true,
(UInt8*) exePath,
sizeof(exePath)) &&
access(tbuffer, R_OK | X_OK) == 0) {
if (realpath(tbuffer, exePath)) {
greFound = true;
}
}
CFRelease(xpcomurl);
}
CFRelease(xulurl);
}
CFRelease(absfwurl);
}
}
if (!greFound) {
#endif
Output("Could not find the Mozilla runtime.\n");
return NS_ERROR_FAILURE;
}
-6
View File
@@ -22,10 +22,6 @@ endif
DEFINES += -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
ifdef LIBXUL_SDK
DEFINES += -DLIBXUL_SDK=1
endif
ifdef MOZ_DEBUG
DEFINES += -DMOZ_DEBUG=1
endif
@@ -115,9 +111,7 @@ MOZ_PKG_MAC_ICON=branding/disk.icns
MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
endif
ifndef LIBXUL_SDK
INSTALL_SDK = 1
endif
include $(topsrcdir)/toolkit/mozapps/installer/signing.mk
include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
-5
View File
@@ -696,15 +696,10 @@
@RESPATH@/defaults/autoconfig/prefcalls.js
@RESPATH@/browser/defaults/profile/prefs.js
#ifndef LIBXUL_SDK
; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325)
; Technically this is an app pref file, but we are keeping it in the original
; gre location for now.
@RESPATH@/defaults/pref/channel-prefs.js
#else
; For Fx-on-xr, channel-prefs lives with the app preferences. (Bug 762588)
@RESPATH@/@PREF_DIR@/channel-prefs.js
#endif
; Services (gre) prefs
#ifdef MOZ_SERVICES_NOTIFICATIONS
-3
View File
@@ -36,6 +36,3 @@ EXTRA_PP_JS_MODULES += [
'AboutHome.jsm',
'RecentWindow.jsm',
]
if CONFIG['MOZILLA_OFFICIAL']:
DEFINES['MOZILLA_OFFICIAL'] = 1
-4
View File
@@ -7,11 +7,7 @@ USE_RCS_MK := 1
include $(topsrcdir)/config/makefiles/makeutils.mk
ifdef MOZ_APP_BASENAME
ifdef LIBXUL_SDK
APP_INI_DEPS = $(LIBXUL_DIST)/bin/platform.ini
else
APP_INI_DEPS = $(topsrcdir)/config/milestone.txt
endif
APP_BUILDID := $(shell cat $(DEPTH)/config/buildid)
APP_INI_DEPS += $(DEPTH)/config/buildid
+6 -2
View File
@@ -134,8 +134,6 @@ MOZ_ARG_WITH_STRING(debug-label,
MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
done])
MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
if test -n "$MOZ_DEBUG"; then
AC_MSG_CHECKING([for valid debug flags])
_SAVE_CFLAGS=$CFLAGS
@@ -149,8 +147,14 @@ if test -n "$MOZ_DEBUG"; then
AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
fi
CFLAGS=$_SAVE_CFLAGS
MOZ_DEBUG_DEFINES="$MOZ_DEBUG_ENABLE_DEFS"
else
MOZ_DEBUG_DEFINES="-DNDEBUG -DTRIMMED"
fi
AC_SUBST(MOZ_DEBUG_DEFINES)
dnl ========================================================
dnl = Enable generation of debug symbols
dnl ========================================================
+4 -9
View File
@@ -157,16 +157,11 @@ if test -n "$MOZ_NATIVE_NSPR" -o -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then
AC_MSG_ERROR([system NSPR does not support PR_UINT64 or including prtypes.h does not provide it]))
CFLAGS=$_SAVE_CFLAGS
elif test -z "$JS_POSIX_NSPR"; then
if test -z "$LIBXUL_SDK"; then
NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
if test -n "$GNU_CC"; then
NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
else
NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
fi
NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
if test -n "$GNU_CC"; then
NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
else
NSPR_CFLAGS=`"${LIBXUL_DIST}"/sdk/bin/nspr-config --prefix="${LIBXUL_DIST}" --includedir="${LIBXUL_DIST}/include/nspr" --cflags`
NSPR_LIBS=`"${LIBXUL_DIST}"/sdk/bin/nspr-config --prefix="${LIBXUL_DIST}" --libdir="${LIBXUL_DIST}"/lib --libs`
NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
fi
fi
+1 -13
View File
@@ -176,13 +176,7 @@ _DEBUG_ASFLAGS :=
_DEBUG_CFLAGS :=
_DEBUG_LDFLAGS :=
ifdef MOZ_DEBUG
_DEBUG_CFLAGS += $(MOZ_DEBUG_ENABLE_DEFS)
XULPPFLAGS += $(MOZ_DEBUG_ENABLE_DEFS)
else
_DEBUG_CFLAGS += $(MOZ_DEBUG_DISABLE_DEFS)
XULPPFLAGS += $(MOZ_DEBUG_DISABLE_DEFS)
endif
_DEBUG_CFLAGS += $(MOZ_DEBUG_DEFINES)
ifneq (,$(MOZ_DEBUG)$(MOZ_DEBUG_SYMBOLS))
ifeq ($(AS),yasm)
@@ -331,7 +325,6 @@ ifndef IS_GYP_DIR
# NSPR_CFLAGS and NSS_CFLAGS must appear ahead of the other flags to avoid Linux
# builds wrongly picking up system NSPR/NSS header files.
OS_INCLUDES := \
$(if $(LIBXUL_SDK),-I$(LIBXUL_SDK)/include) \
$(NSPR_CFLAGS) $(NSS_CFLAGS) \
$(MOZ_JPEG_CFLAGS) \
$(MOZ_PNG_CFLAGS) \
@@ -456,13 +449,8 @@ HOST_CXXFLAGS += $(HOST_DEFINES) $(MOZBUILD_HOST_CXXFLAGS)
# Override defaults
# Default location of include files
ifndef LIBXUL_SDK
IDL_PARSER_DIR = $(topsrcdir)/xpcom/idl-parser
IDL_PARSER_CACHE_DIR = $(DEPTH)/xpcom/idl-parser
else
IDL_PARSER_DIR = $(LIBXUL_SDK)/sdk/bin
IDL_PARSER_CACHE_DIR = $(LIBXUL_SDK)/sdk/bin
endif
SDK_LIB_DIR = $(DIST)/sdk/lib
SDK_BIN_DIR = $(DIST)/sdk/bin
-3
View File
@@ -5,9 +5,6 @@
include $(topsrcdir)/config/rules.mk
ifdef LIBXUL_SDK
$(error config/external/nspr/Makefile.in is not compatible with --enable-libxul-sdk=)
endif
ifdef MOZ_BUILD_NSPR
# Copy NSPR to the SDK
+1 -1
View File
@@ -364,7 +364,7 @@ nspr_def_file := $(srcdir)/nspr-dummy.def
nss3.def: $(nss_def_file) $(sqlite_def_file) $(nspr_def_file) $(NSS_EXTRA_SYMBOLS_FILE)
@$(call py_action,convert_def_file, \
$(DEFINES) $(ACDEFINES) $(XULPPFLAGS) -o $@ $^)
$(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) -o $@ $^)
GARBAGE += \
nss3.def \
+1 -1
View File
@@ -21,7 +21,7 @@ GARBAGE += \
# Convert to the format we need for ld.
$(LD_VERSION_SCRIPT): $(topsrcdir)/db/sqlite3/src/sqlite.def
@$(call py_action,convert_def_file, \
$(DEFINES) $(ACDEFINES) $(XULPPFLAGS) -o $@ $^)
$(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) -o $@ $^)
endif
endif
-4
View File
@@ -30,10 +30,6 @@ dist_idl_dir := $(DIST)/idl
dist_include_dir := $(DIST)/include
process_py := $(topsrcdir)/python/mozbuild/mozbuild/action/xpidl-process.py
ifdef LIBXUL_SDK
libxul_sdk_includes := -I$(LIBXUL_SDK)/idl
endif
# TODO we should use py_action, but that would require extra directories to be
# in the virtualenv.
%.xpt:
+3 -5
View File
@@ -496,10 +496,8 @@ endif
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
OUTOPTION = -Fo# eol
PREPROCESS_OPTION = -P -Fi# eol
else
OUTOPTION = -o # eol
PREPROCESS_OPTION = -E -o #eol
endif # WINNT && !GNU_CC
ifneq (,$(filter ml%,$(AS)))
@@ -1126,7 +1124,7 @@ PREF_DIR = defaults/pref
# If DIST_SUBDIR is defined it indicates that app and gre dirs are
# different and that we are building app related resources. Hence,
# PREF_DIR should point to the app prefs location.
ifneq (,$(DIST_SUBDIR)$(XPI_NAME)$(LIBXUL_SDK))
ifneq (,$(DIST_SUBDIR)$(XPI_NAME))
PREF_DIR = defaults/preferences
endif
@@ -1240,7 +1238,7 @@ endif
libs realchrome:: $(FINAL_TARGET)/chrome
$(call py_action,jar_maker,\
$(QUIET) -j $(FINAL_TARGET)/chrome \
$(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
$(MAKE_JARS_FLAGS) $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) \
$(JAR_MANIFEST))
endif
@@ -1494,7 +1492,7 @@ PP_TARGETS_ALL_RESULTS := $(sort $(foreach tier,$(PP_TARGETS_TIERS),$(PP_TARGETS
$(PP_TARGETS_ALL_RESULTS):
$(if $(filter-out $(notdir $@),$(notdir $(<:.in=))),$(error Looks like $@ has an unexpected dependency on $< which breaks PP_TARGETS))
$(RM) '$@'
$(call py_action,preprocessor,--depend $(MDDEPDIR)/$(@F).pp $(PP_TARGET_FLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) '$<' -o '$@')
$(call py_action,preprocessor,--depend $(MDDEPDIR)/$(@F).pp $(PP_TARGET_FLAGS) $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) '$<' -o '$@')
# The depfile is based on the filename, and we don't want conflicts. So check
# there's only one occurrence of any given filename in PP_TARGETS_ALL_RESULTS.
+18 -28
View File
@@ -3313,11 +3313,7 @@ MOZ_CONFIG_NSPR()
dnl set GRE_MILESTONE
dnl ========================================================
if test -n "$LIBXUL_SDK"; then
GRE_MILESTONE=`$PYTHON "$_topsrcdir"/config/printconfigsetting.py "$LIBXUL_DIST"/bin/platform.ini Build Milestone`
else
GRE_MILESTONE=`tail -n 1 "$_topsrcdir"/config/milestone.txt 2>/dev/null || tail -1 "$_topsrcdir"/config/milestone.txt`
fi
GRE_MILESTONE=`tail -n 1 "$_topsrcdir"/config/milestone.txt 2>/dev/null || tail -1 "$_topsrcdir"/config/milestone.txt`
AC_SUBST(GRE_MILESTONE)
# set RELEASE_BUILD and NIGHTLY_BUILD variables depending on the cycle we're in
@@ -3922,15 +3918,6 @@ if test -n "$WITH_APP_BASENAME" ; then
MOZ_APP_BASENAME="$WITH_APP_BASENAME"
fi
# Now is a good time to test for logic errors, define mismatches, etc.
case "$MOZ_BUILD_APP" in
xulrunner)
if test "$LIBXUL_SDK"; then
AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
fi
;;
esac
# Special cases where we need to AC_DEFINE something. Also a holdover for apps
# that haven't made a confvars.sh yet. Don't add new stuff here, use
# MOZ_BUILD_APP.
@@ -5976,11 +5963,6 @@ if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; th
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
fi
dnl Do not build gio with libxul based apps
if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
fi
if test `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
MOZ_GIO_COMPONENT=1
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
@@ -8165,8 +8147,6 @@ AC_SUBST(MOZ_AUTH_EXTENSION)
AC_SUBST(MOZ_PREF_EXTENSIONS)
AC_SUBST(MOZ_DEBUG)
AC_SUBST(MOZ_DEBUG_SYMBOLS)
AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
AC_SUBST(MOZ_DEBUG_LDFLAGS)
AC_SUBST(WARNINGS_AS_ERRORS)
AC_SUBST(MOZ_EXTENSIONS)
@@ -8377,9 +8357,9 @@ AC_SUBST(MOZ_APP_STATIC_INI)
AC_SUBST(MOZ_PKG_SPECIAL)
AC_SUBST(MOZILLA_OFFICIAL)
# Build revisions should always be present in official builds
if test "$MOZILLA_OFFICIAL"; then
AC_DEFINE(MOZILLA_OFFICIAL)
# Build revisions should always be present in official builds
MOZ_INCLUDE_SOURCE_INFO=1
fi
@@ -8728,6 +8708,18 @@ HAVE_SYS_VFS_H
HAVE_SYS_MOUNT_H
"
dnl ========================================================
dnl Determine options to use for running the preprocessor.
dnl ========================================================
if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT"; then
PREPROCESS_OPTION="-P -Fi"
else
PREPROCESS_OPTION="-E -o "
fi
AC_SUBST(PREPROCESS_OPTION)
dnl ========================================================
dnl ICU Support
dnl ========================================================
@@ -8756,8 +8748,7 @@ AC_SUBST(JS_SHARED_LIBRARY)
MOZ_CREATE_CONFIG_STATUS()
# No need to run subconfigures when building with LIBXUL_SDK_DIR
if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
if test "$COMPILE_ENVIRONMENT"; then
MOZ_SUBCONFIGURE_ICU()
MOZ_SUBCONFIGURE_FFI()
fi
@@ -8826,8 +8817,7 @@ if test -n "$_subconfigure_subdir"; then
srcdir="$_save_srcdir"
fi
# No need to run subconfigures when building with LIBXUL_SDK_DIR
if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
if test "$COMPILE_ENVIRONMENT"; then
export WRAP_LDFLAGS
@@ -8908,7 +8898,7 @@ fi
AC_OUTPUT_SUBDIRS(js/src,$cache_file)
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
fi # COMPILE_ENVIRONMENT
export WRITE_MOZINFO=1
dnl we need to run config.status after js/src subconfigure because we're
+1 -1
View File
@@ -15,6 +15,6 @@ GARBAGE += \
# We have to preprocess our def file because we need different symbols in debug
# builds exposed that are not built in non-debug builds.
$(DEFFILE): sqlite.def
@$(call py_action,preprocessor,$(DEFINES) $(XULPPFLAGS) \
@$(call py_action,preprocessor,$(DEFINES) $(MOZ_DEBUG_DEFINES) \
$(srcdir)/sqlite.def -o $(DEFFILE))
endif
+3 -3
View File
@@ -31,7 +31,7 @@ else:
if os_posix and not CONFIG['MOZ_NATIVE_LIBEVENT']:
DEFINES['HAVE_CONFIG_H'] = True
LOCAL_INCLUDES += sorted([
libevent_path_prefix + '/libevent',
libevent_path_prefix + '/libevent/include',
libevent_path_prefix + '/libevent/' + libevent_include_suffix,
'libevent',
'libevent/include',
'libevent/' + libevent_include_suffix,
])
-46
View File
@@ -277,52 +277,6 @@ $(CURDIR)/javascript-trace.h: $(srcdir)/devtools/javascript-trace.d
$(addsuffix .$(OBJ_SUFFIX),Probes jsinterp jsobj): $(CURDIR)/javascript-trace.h
endif
# Prepare self-hosted JS code for embedding
export:: selfhosting
selfhosting:: selfhosted.out.h
selfhosting_srcs := \
$(srcdir)/builtin/Utilities.js \
$(srcdir)/builtin/Array.js \
$(srcdir)/builtin/Date.js \
$(srcdir)/builtin/Error.js \
$(srcdir)/builtin/Generator.js \
$(srcdir)/builtin/Intl.js \
$(srcdir)/builtin/IntlData.js \
$(srcdir)/builtin/Iterator.js \
$(srcdir)/builtin/Map.js \
$(srcdir)/builtin/Module.js \
$(srcdir)/builtin/Number.js \
$(srcdir)/builtin/Object.js \
$(srcdir)/builtin/Reflect.js \
$(srcdir)/builtin/RegExp.js \
$(srcdir)/builtin/String.js \
$(srcdir)/builtin/Set.js \
$(srcdir)/builtin/TypedArray.js \
$(srcdir)/builtin/TypedObject.js \
$(srcdir)/builtin/WeakSet.js \
$(NULL)
selfhosted_out_h_deps := \
$(selfhosting_srcs) \
$(srcdir)/js.msg \
$(srcdir)/builtin/embedjs.py \
$(srcdir)/builtin/TypedObjectConstants.h \
$(srcdir)/builtin/SelfHostingDefines.h \
$(NULL)
SELFHOSTED_DEFINES += $(DEFINES) $(ACDEFINES)
ifdef MOZ_DEBUG
SELFHOSTED_DEFINES += $(MOZ_DEBUG_ENABLE_DEFS)
else
SELFHOSTED_DEFINES += $(MOZ_DEBUG_DISABLE_DEFS)
endif
selfhosted.out.h: $(selfhosted_out_h_deps)
$(PYTHON) $(srcdir)/builtin/embedjs.py $(SELFHOSTED_DEFINES) \
-c '$(CCC)' -p '$(PREPROCESS_OPTION)' -m $(srcdir)/js.msg \
-o $@ $(selfhosting_srcs)
###############################################
# Generating source package tarballs
# (only possible when tar is found)
+14 -5
View File
@@ -136,7 +136,7 @@ static const unsigned PushedRetAddr = 0;
static const unsigned PushedFP = 0;
static const unsigned StoredFP = 0;
static const unsigned PostStorePrePopFP = 0;
#elif defined(JS_CODEGEN_MIPS32)
#elif defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
static const unsigned PushedRetAddr = 8;
static const unsigned PushedFP = 24;
static const unsigned StoredFP = 28;
@@ -157,7 +157,7 @@ PushRetAddr(MacroAssembler& masm)
{
#if defined(JS_CODEGEN_ARM)
masm.push(lr);
#elif defined(JS_CODEGEN_MIPS32)
#elif defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
masm.push(ra);
#else
// The x86/x64 call instruction pushes the return address.
@@ -221,7 +221,8 @@ GenerateProfilingEpilogue(MacroAssembler& masm, unsigned framePushed, AsmJSExit:
Label* profilingReturn)
{
Register scratch = ABIArgGenerator::NonReturn_VolatileReg0;
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_ARM64) || defined(JS_CODEGEN_MIPS32)
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_ARM64) || \
defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
Register scratch2 = ABIArgGenerator::NonReturn_VolatileReg1;
#endif
@@ -245,7 +246,8 @@ GenerateProfilingEpilogue(MacroAssembler& masm, unsigned framePushed, AsmJSExit:
// and the async interrupt exit. Since activation.fp can be read at any
// time and still points to the current frame, be careful to only update
// sp after activation.fp has been repointed to the caller's frame.
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_ARM64) || defined(JS_CODEGEN_MIPS32)
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_ARM64) || \
defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
masm.loadPtr(Address(masm.getStackPointer(), 0), scratch2);
masm.storePtr(scratch2, Address(scratch, AsmJSActivation::offsetOfFP()));
DebugOnly<uint32_t> prePop = masm.currentOffset();
@@ -344,6 +346,13 @@ js::GenerateAsmJSFunctionEpilogue(MacroAssembler& masm, unsigned framePushed,
masm.nop();
masm.nop();
masm.nop();
#elif defined(JS_CODEGEN_MIPS64)
masm.nop();
masm.nop();
masm.nop();
masm.nop();
masm.nop();
masm.nop();
#endif
}
@@ -566,7 +575,7 @@ AsmJSProfilingFrameIterator::AsmJSProfilingFrameIterator(const AsmJSActivation&
MOZ_ASSERT(offsetInModule < codeRange->end());
uint32_t offsetInCodeRange = offsetInModule - codeRange->begin();
void** sp = (void**)state.sp;
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32)
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
if (offsetInCodeRange < PushedRetAddr) {
// First instruction of the ARM/MIPS function; the return address is
// still in lr and fp still holds the caller's fp.
+35 -1
View File
@@ -386,6 +386,17 @@ AsmJSModule::finish(ExclusiveContext* cx, TokenStream& tokenStream, MacroAssembl
if (!staticLinkData_.relativeLinks.append(link))
return false;
}
#elif defined(JS_CODEGEN_MIPS64)
// On MIPS64 we need to update all the long jumps because they contain an
// absolute adress.
for (size_t i = 0; i < masm.numLongJumps(); i++) {
RelativeLink link(RelativeLink::InstructionImmediate);
link.patchAtOffset = masm.longJump(i);
InstImm* inst = (InstImm*)(code_ + masm.longJump(i));
link.targetOffset = Assembler::ExtractLoad64Value(inst) - (uint64_t)code_;
if (!staticLinkData_.relativeLinks.append(link))
return false;
}
#endif
#if defined(JS_CODEGEN_X64)
@@ -828,7 +839,7 @@ AsmJSModule::initHeap(Handle<ArrayBufferObjectMaybeShared*> heap, JSContext* cx)
if (access.hasLengthCheck())
X86Encoding::AddInt32(access.patchLengthAt(code_), heapLength);
}
#elif defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32)
#elif defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
uint32_t heapLength = heap->byteLength();
for (unsigned i = 0; i < heapAccesses_.length(); i++) {
jit::Assembler::UpdateBoundsCheck(heapLength,
@@ -1747,6 +1758,9 @@ AsmJSModule::setProfilingEnabled(JSContext* cx, bool enabled)
#elif defined(JS_CODEGEN_MIPS32)
Instruction* instr = (Instruction*)(callerRetAddr - 4 * sizeof(uint32_t));
void* callee = (void*)Assembler::ExtractLuiOriValue(instr, instr->next());
#elif defined(JS_CODEGEN_MIPS64)
Instruction* instr = (Instruction*)(callerRetAddr - 6 * sizeof(uint32_t));
void* callee = (void*)Assembler::ExtractLoad64Value(instr);
#elif defined(JS_CODEGEN_NONE)
MOZ_CRASH();
void* callee = nullptr;
@@ -1774,6 +1788,9 @@ AsmJSModule::setProfilingEnabled(JSContext* cx, bool enabled)
Assembler::WriteLuiOriInstructions(instr, instr->next(),
ScratchRegister, (uint32_t)newCallee);
instr[2] = InstReg(op_special, ScratchRegister, zero, ra, ff_jalr);
#elif defined(JS_CODEGEN_MIPS64)
Assembler::WriteLoad64Instructions(instr, ScratchRegister, (uint64_t)newCallee);
instr[4] = InstReg(op_special, ScratchRegister, zero, ra, ff_jalr);
#elif defined(JS_CODEGEN_NONE)
MOZ_CRASH();
#else
@@ -1846,6 +1863,18 @@ AsmJSModule::setProfilingEnabled(JSContext* cx, bool enabled)
instr[1].makeNop();
instr[2].makeNop();
}
#elif defined(JS_CODEGEN_MIPS64)
Instruction* instr = (Instruction*)jump;
if (enabled) {
Assembler::WriteLoad64Instructions(instr, ScratchRegister, (uint64_t)profilingEpilogue);
instr[4] = InstReg(op_special, ScratchRegister, zero, zero, ff_jr);
} else {
instr[0].makeNop();
instr[1].makeNop();
instr[2].makeNop();
instr[3].makeNop();
instr[4].makeNop();
}
#elif defined(JS_CODEGEN_NONE)
MOZ_CRASH();
#else
@@ -1887,6 +1916,7 @@ GetCPUID(uint32_t* cpuId)
X64 = 0x2,
ARM = 0x3,
MIPS = 0x4,
MIPS64 = 0x5,
ARCH_BITS = 3
};
@@ -1906,6 +1936,10 @@ GetCPUID(uint32_t* cpuId)
MOZ_ASSERT(GetMIPSFlags() <= (UINT32_MAX >> ARCH_BITS));
*cpuId = MIPS | (GetMIPSFlags() << ARCH_BITS);
return true;
#elif defined(JS_CODEGEN_MIPS64)
MOZ_ASSERT(GetMIPSFlags() <= (UINT32_MAX >> ARCH_BITS));
*cpuId = MIPS64 | (GetMIPSFlags() << ARCH_BITS);
return true;
#else
return false;
#endif
+3 -3
View File
@@ -754,7 +754,7 @@ class AsmJSModule
explicit RelativeLink(Kind kind)
{
#if defined(JS_CODEGEN_MIPS32)
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
kind_ = kind;
#elif defined(JS_CODEGEN_ARM)
// On ARM, CodeLabels are only used to label raw pointers, so in
@@ -765,14 +765,14 @@ class AsmJSModule
}
bool isRawPointerPatch() {
#if defined(JS_CODEGEN_MIPS32)
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
return kind_ == RawPointer;
#else
return true;
#endif
}
#ifdef JS_CODEGEN_MIPS32
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
Kind kind_;
#endif
uint32_t patchAtOffset;
+15 -10
View File
@@ -6460,6 +6460,9 @@ CheckFunction(ModuleValidator& m, LifoAlloc& lifo, AsmFunction** funcOut)
}
AsmFunction* asmFunc = lifo.new_<AsmFunction>(lifo);
if (!asmFunc)
return false;
FunctionValidator f(m, *asmFunc, fn);
if (!f.init())
return false;
@@ -7103,7 +7106,7 @@ GenerateEntry(ModuleValidator& m, unsigned exportIndex)
// Save the return address if it wasn't already saved by the call insn.
#if defined(JS_CODEGEN_ARM)
masm.push(lr);
#elif defined(JS_CODEGEN_MIPS32)
#elif defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
masm.push(ra);
#elif defined(JS_CODEGEN_X86)
static const unsigned EntryFrameSize = sizeof(void*);
@@ -7115,15 +7118,15 @@ GenerateEntry(ModuleValidator& m, unsigned exportIndex)
masm.PushRegsInMask(NonVolatileRegs);
MOZ_ASSERT(masm.framePushed() == FramePushedAfterSave);
// ARM and MIPS have a globally-pinned GlobalReg (x64 uses RIP-relative
// ARM and MIPS/MIPS64 have a globally-pinned GlobalReg (x64 uses RIP-relative
// addressing, x86 uses immediates in effective addresses). For the
// AsmJSGlobalRegBias addition, see Assembler-(mips,arm).h.
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32)
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
masm.movePtr(IntArgReg1, GlobalReg);
masm.addPtr(Imm32(AsmJSGlobalRegBias), GlobalReg);
#endif
// ARM, MIPS and x64 have a globally-pinned HeapReg (x86 uses immediates in
// ARM, MIPS/MIPS64 and x64 have a globally-pinned HeapReg (x86 uses immediates in
// effective addresses). Loading the heap register depends on the global
// register already having been loaded.
masm.loadAsmJSHeapRegisterFromGlobalData();
@@ -7434,7 +7437,7 @@ GenerateFFIInterpExit(ModuleValidator& m, const Signature& sig, unsigned exitInd
return !masm.oom() && m.finishGeneratingInterpExit(exitIndex, &begin, &profilingReturn);
}
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32)
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
static const unsigned MaybeSavedGlobalReg = sizeof(void*);
#else
static const unsigned MaybeSavedGlobalReg = 0;
@@ -7478,7 +7481,7 @@ GenerateFFIIonExit(ModuleValidator& m, const Signature& sig, unsigned exitIndex,
m.masm().append(AsmJSGlobalAccess(masm.leaRipRelative(callee), globalDataOffset));
#elif defined(JS_CODEGEN_X86)
m.masm().append(AsmJSGlobalAccess(masm.movlWithPatch(Imm32(0), callee), globalDataOffset));
#elif defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32)
#elif defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
masm.computeEffectiveAddress(Address(GlobalReg, globalDataOffset - AsmJSGlobalRegBias), callee);
#endif
@@ -7514,7 +7517,7 @@ GenerateFFIIonExit(ModuleValidator& m, const Signature& sig, unsigned exitIndex,
// so they must be explicitly preserved. Only save GlobalReg since
// HeapReg must be reloaded (from global data) after the call since the
// heap may change during the FFI call.
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32)
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
static_assert(MaybeSavedGlobalReg == sizeof(void*), "stack frame accounting");
masm.storePtr(GlobalReg, Address(masm.getStackPointer(), ionFrameBytes));
#endif
@@ -7630,7 +7633,7 @@ GenerateFFIIonExit(ModuleValidator& m, const Signature& sig, unsigned exitIndex,
}
// Reload the global register since Ion code can clobber any register.
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32)
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
static_assert(MaybeSavedGlobalReg == sizeof(void*), "stack frame accounting");
masm.loadPtr(Address(masm.getStackPointer(), ionFrameBytes), GlobalReg);
#endif
@@ -7945,7 +7948,7 @@ GenerateAsyncInterruptExit(ModuleValidator& m, Label* throwLabel)
masm.PopRegsInMask(AllRegsExceptSP); // restore all GP/FP registers (except SP)
masm.popFlags(); // after this, nothing that sets conditions
masm.ret(); // pop resumePC into PC
#elif defined(JS_CODEGEN_MIPS32)
#elif defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
// Reserve space to store resumePC.
masm.subFromStackPtr(Imm32(sizeof(intptr_t)));
// set to zero so we can use masm.framePushed() below.
@@ -8203,7 +8206,9 @@ CheckModule(ExclusiveContext* cx, AsmJSParser& parser, ParseNode* stmtList,
m.startFunctionBodies();
#if !defined(ENABLE_SHARED_ARRAY_BUFFER)
MOZ_ASSERT(!m.module().hasArrayView() || !m.module().isSharedView());
if (m.module().hasArrayView() && m.module().isSharedView())
return m.failOffset(m.parser().tokenStream.currentToken().pos.begin,
"shared views not supported by this build");
#endif
ScopedJSDeletePtr<ModuleCompileResults> mcd;
+33 -40
View File
@@ -37,10 +37,10 @@
# It uses the C preprocessor to process its inputs.
from __future__ import with_statement
import re, sys, os, fileinput, subprocess
import re, sys, os, subprocess
import shlex
import which
from optparse import OptionParser
import buildconfig
def ToCAsciiArray(lines):
result = []
@@ -85,19 +85,17 @@ def embed(cxx, preprocessorOption, msgs, sources, c_out, js_out, env):
processed = '\n'.join([line for line in preprocessed.splitlines() if \
(line.strip() and not line.startswith('#'))])
with open(js_out, 'w') as output:
output.write(processed)
with open(c_out, 'w') as output:
import zlib
compressed = zlib.compress(processed)
data = ToCArray(compressed)
output.write(HEADER_TEMPLATE % {
'sources_type': 'unsigned char',
'sources_data': data,
'sources_name': 'compressedSources',
'compressed_total_length': len(compressed),
'raw_total_length': len(processed)
})
js_out.write(processed)
import zlib
compressed = zlib.compress(processed)
data = ToCArray(compressed)
c_out.write(HEADER_TEMPLATE % {
'sources_type': 'unsigned char',
'sources_data': data,
'sources_name': 'compressedSources',
'compressed_total_length': len(compressed),
'raw_total_length': len(processed)
})
def preprocess(cxx, preprocessorOption, source, args = []):
if (not os.path.exists(cxx[0])):
@@ -131,32 +129,27 @@ def messages(jsmsg):
assert not line.strip().startswith("MSG_DEF")
return '\n'.join(defines)
def main():
env = {}
def define_env(option, opt, value, parser):
pair = value.split('=', 1)
def get_config_defines(buildconfig):
# Collect defines equivalent to ACDEFINES and add MOZ_DEBUG_DEFINES.
env = {key: value for key, value in buildconfig.defines.iteritems()
if key not in buildconfig.non_global_defines}
for value in buildconfig.substs['MOZ_DEBUG_DEFINES'].split():
assert value[:2] == "-D"
pair = value[2:].split('=', 1)
if len(pair) == 1:
pair.append(1)
env[pair[0]] = pair[1]
p = OptionParser(usage="%prog [options] file")
p.add_option('-D', action='callback', callback=define_env, type="string",
metavar='var=[val]', help='Define a variable')
p.add_option('-m', type='string', metavar='jsmsg', default='../js.msg',
help='js.msg file')
p.add_option('-c', type='string', metavar='cxx', help='Path to C++ compiler')
p.add_option('-p', type='string', dest='p', metavar='cxxoption',
help='Argument to compiler for preprocessing into an output file')
p.add_option('-o', type='string', metavar='filename', default='selfhosted.out.h',
help='C array header file')
p.add_option('-s', type='string', metavar='jsfilename', default='selfhosted.js',
help='Combined postprocessed JS file')
(options, sources) = p.parse_args()
if not (options.p and sources):
p.print_help()
sys.exit(1)
cxx = shlex.split(options.c)
msgs = messages(options.m)
embed(cxx, options.p, msgs, sources, options.o, options.s, env)
return env
if __name__ == "__main__":
main()
def generate_selfhosted(c_out, msg_file, *inputs):
# Called from moz.build to embed selfhosted JS.
deps = [path for path in inputs if path.endswith(".h")]
sources = [path for path in inputs if path.endswith(".js")]
assert len(deps) + len(sources) == len(inputs)
cxx = shlex.split(buildconfig.substs['CXX'])
cxx_option = buildconfig.substs['PREPROCESS_OPTION']
env = get_config_defines(buildconfig)
js_path = re.sub(r"\.out\.h$", "", c_out.name) + ".js"
msgs = messages(msg_file)
with open(js_path, 'w') as js_out:
embed(cxx, cxx_option, msgs, sources, c_out, js_out, env)
+11 -2
View File
@@ -3597,8 +3597,6 @@ AC_SUBST(FILTER)
AC_SUBST(BIN_FLAGS)
AC_SUBST(MOZ_DEBUG)
AC_SUBST(MOZ_DEBUG_SYMBOLS)
AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
AC_SUBST(MOZ_DEBUG_LDFLAGS)
AC_SUBST(WARNINGS_AS_ERRORS)
AC_SUBST(MOZ_JPROF)
@@ -3768,6 +3766,17 @@ if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK" ; then
AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
fi
dnl ========================================================
dnl Determine options to use for running the preprocessor.
dnl ========================================================
if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT"; then
PREPROCESS_OPTION="-P -Fi"
else
PREPROCESS_OPTION="-E -o "
fi
AC_SUBST(PREPROCESS_OPTION)
dnl ========================================================
dnl ECMAScript Internationalization API Support (uses ICU)
+1 -1
View File
@@ -7,7 +7,7 @@
// Note code is not run, so the only issue here is whether it compiles
// properly as asm.js.
if (!isAsmJSCompilationAvailable())
if (!this.SharedArrayBuffer || !isAsmJSCompilationAvailable())
quit(0);
function module_a(stdlib, foreign, heap) {
@@ -0,0 +1,15 @@
load(libdir + 'oomTest.js');
function parseAsmJS() {
eval(`function m(stdlib)
{
"use asm";
var abs = stdlib.Math.abs;
function f(d)
{
d = +d;
return (~~(5.0 - +abs(d)))|0;
}
return f;
}`);
}
oomTest(parseAsmJS);
@@ -0,0 +1,6 @@
(new Int8Array(3)).join();
[Math.abs, Math.abs].forEach(x => {
try {
Int8Array.prototype.join.call(x);
} catch(e) {}
});
+4 -13
View File
@@ -2216,19 +2216,10 @@ IonBuilder::inlineSetDisjointTypedElements(CallInfo& callInfo)
// Only attempt to optimize if |target| and |sourceTypedArray| are both
// definitely typed arrays. (The former always is. The latter is not,
// necessarily, because of wrappers.)
MDefinition* arrays[] = { target, sourceTypedArray };
for (MDefinition* def : arrays) {
TemporaryTypeSet* types = def->resultTypeSet();
if (!types)
return InliningStatus_NotInlined;
if (types->forAllClasses(constraints(), IsTypedArrayClass) !=
TemporaryTypeSet::ForAllResult::ALL_TRUE)
{
return InliningStatus_NotInlined;
}
if (!IsTypedArrayObject(constraints(), target) ||
!IsTypedArrayObject(constraints(), sourceTypedArray))
{
return InliningStatus_NotInlined;
}
auto sets = MSetDisjointTypedElements::New(alloc(), target, targetOffset, sourceTypedArray);
+29
View File
@@ -679,3 +679,32 @@ if not CONFIG['GNU_CXX']:
NO_EXPAND_LIBS = True
DIST_INSTALL = True
# Prepare self-hosted JS code for embedding
GENERATED_FILES += ['selfhosted.out.h']
selfhosted = GENERATED_FILES['selfhosted.out.h']
selfhosted.script = 'builtin/embedjs.py:generate_selfhosted'
selfhosted.inputs = [
'js.msg',
'builtin/TypedObjectConstants.h',
'builtin/SelfHostingDefines.h',
'builtin/Utilities.js',
'builtin/Array.js',
'builtin/Date.js',
'builtin/Error.js',
'builtin/Generator.js',
'builtin/Intl.js',
'builtin/IntlData.js',
'builtin/Iterator.js',
'builtin/Map.js',
'builtin/Module.js',
'builtin/Number.js',
'builtin/Object.js',
'builtin/Reflect.js',
'builtin/RegExp.js',
'builtin/String.js',
'builtin/Set.js',
'builtin/TypedArray.js',
'builtin/TypedObject.js',
'builtin/WeakSet.js'
]
+1 -11
View File
@@ -123,7 +123,7 @@ interface ScheduledGCCallback : nsISupports
/**
* interface of Components.utils
*/
[scriptable, uuid(e04a4a58-2b5e-4a74-941a-0d344b057c5a)]
[scriptable, uuid(eaeab2c0-ada3-4c22-b36d-70320dd923ba)]
interface nsIXPCComponents_Utils : nsISupports
{
@@ -488,16 +488,6 @@ interface nsIXPCComponents_Utils : nsISupports
[implicit_jscontext]
void forcePermissiveCOWs();
/*
* Disables the XPConnect security checks that deny access to callables and
* accessor descriptors on COWs. Do not use this unless you are bholley.
*
* For the benefit of his magesty TCPSocket while he takes his sweet time
* converting to WebIDL. See bug 885982.
*/
[implicit_jscontext]
void skipCOWCallableChecks();
/*
* Forces the usage of a privileged |Components| object for a potentially-
* unprivileged scope. This will crash if used outside of automation.
+44 -19
View File
@@ -1038,20 +1038,55 @@ xpc::CreateSandboxObject(JSContext* cx, MutableHandleValue vp, nsISupports* prin
{
JSAutoCompartment ac(cx, sandbox);
nsCOMPtr<nsIScriptObjectPrincipal> sbp =
new SandboxPrivate(principal, sandbox);
// Pass on ownership of sbp to |sandbox|.
JS_SetPrivate(sandbox, sbp.forget().take());
{
// Don't try to mirror standard class properties, if we're using a
// mirroring sandbox. (This is meaningless for non-mirroring
// sandboxes.)
AutoSkipPropertyMirroring askip(CompartmentPrivate::Get(sandbox));
// Ensure |Object.prototype| is instantiated before prototype-
// splicing below. For write-to-global-prototype behavior, extend
// this to all builtin properties.
if (options.writeToGlobalPrototype) {
if (!JS_EnumerateStandardClasses(cx, sandbox))
return NS_ERROR_XPC_UNEXPECTED;
} else {
if (!JS_GetObjectPrototype(cx, sandbox))
return NS_ERROR_XPC_UNEXPECTED;
}
}
if (options.proto) {
bool ok = JS_WrapObject(cx, &options.proto);
if (!ok)
return NS_ERROR_XPC_UNEXPECTED;
// Now check what sort of thing we've got in |proto|
JSObject* unwrappedProto = js::CheckedUnwrap(options.proto, false);
if (!unwrappedProto) {
JS_ReportError(cx, "Sandbox must subsume sandboxPrototype");
return NS_ERROR_INVALID_ARG;
// Now check what sort of thing we've got in |proto|, and figure out
// if we need a SandboxProxyHandler.
//
// Note that, in the case of a window, we can't require that the
// Sandbox subsumes the prototype, because we have to hold our
// reference to it via an outer window, and the window may navigate
// at any time. So we have to handle that case separately.
bool useSandboxProxy = !!WindowOrNull(js::UncheckedUnwrap(options.proto, false));
if (!useSandboxProxy) {
JSObject* unwrappedProto = js::CheckedUnwrap(options.proto, false);
if (!unwrappedProto) {
JS_ReportError(cx, "Sandbox must subsume sandboxPrototype");
return NS_ERROR_INVALID_ARG;
}
const js::Class* unwrappedClass = js::GetObjectClass(unwrappedProto);
useSandboxProxy = IS_WN_CLASS(unwrappedClass) ||
mozilla::dom::IsDOMClass(Jsvalify(unwrappedClass));
}
const js::Class* unwrappedClass = js::GetObjectClass(unwrappedProto);
if (IS_WN_CLASS(unwrappedClass) ||
mozilla::dom::IsDOMClass(Jsvalify(unwrappedClass))) {
if (useSandboxProxy) {
// Wrap it up in a proxy that will do the right thing in terms
// of this-binding for methods.
RootedValue priv(cx, ObjectValue(*options.proto));
@@ -1061,17 +1096,11 @@ xpc::CreateSandboxObject(JSContext* cx, MutableHandleValue vp, nsISupports* prin
return NS_ERROR_OUT_OF_MEMORY;
}
ok = JS_SetPrototype(cx, sandbox, options.proto);
ok = JS_SplicePrototype(cx, sandbox, options.proto);
if (!ok)
return NS_ERROR_XPC_UNEXPECTED;
}
nsCOMPtr<nsIScriptObjectPrincipal> sbp =
new SandboxPrivate(principal, sandbox);
// Pass on ownership of sbp to |sandbox|.
JS_SetPrivate(sandbox, sbp.forget().take());
// Don't try to mirror the properties that are set below.
AutoSkipPropertyMirroring askip(CompartmentPrivate::Get(sandbox));
@@ -1101,10 +1130,6 @@ xpc::CreateSandboxObject(JSContext* cx, MutableHandleValue vp, nsISupports* prin
// every global.
if (!dom::PromiseBinding::GetConstructorObject(cx, sandbox))
return NS_ERROR_XPC_UNEXPECTED;
// Resolve standard classes eagerly to avoid triggering mirroring hooks for them.
if (options.writeToGlobalPrototype && !JS_EnumerateStandardClasses(cx, sandbox))
return NS_ERROR_XPC_UNEXPECTED;
}
// We handle the case where the context isn't in a compartment for the
-7
View File
@@ -2948,13 +2948,6 @@ nsXPCComponents_Utils::ForcePermissiveCOWs(JSContext* cx)
return NS_OK;
}
NS_IMETHODIMP
nsXPCComponents_Utils::SkipCOWCallableChecks(JSContext* cx)
{
CompartmentPrivate::Get(CurrentGlobalOrNull(cx))->skipCOWCallableChecks = true;
return NS_OK;
}
NS_IMETHODIMP
nsXPCComponents_Utils::ForcePrivilegedComponentsForScope(HandleValue vscope,
JSContext* cx)
+4 -2
View File
@@ -237,9 +237,11 @@ nsScriptErrorBase::ToString(nsACString& /*UTF8*/ aResult)
if (!mMessage.IsEmpty())
tempMessage = ToNewUTF8String(mMessage);
if (!mSourceName.IsEmpty())
tempSourceName = ToNewUTF8String(mSourceName);
// Use at most 512 characters from mSourceName.
tempSourceName = ToNewUTF8String(StringHead(mSourceName, 512));
if (!mSourceLine.IsEmpty())
tempSourceLine = ToNewUTF8String(mSourceLine);
// Use at most 512 characters from mSourceLine.
tempSourceLine = ToNewUTF8String(StringHead(mSourceLine, 512));
if (nullptr != tempSourceName && nullptr != tempSourceLine)
temp = JS_smprintf(format0,
@@ -16,6 +16,28 @@
#include "nsGlobalWindow.h"
#include "nsCycleCollectionParticipant.h"
namespace {
static nsCString
FormatStackString(JSContext* cx, HandleObject aStack) {
JS::RootedString formattedStack(cx);
if (!JS::BuildStackString(cx, aStack, &formattedStack)) {
return nsCString();
}
nsAutoJSString stackJSString;
if (!stackJSString.init(cx, formattedStack)) {
return nsCString();
}
return NS_ConvertUTF16toUTF8(stackJSString.get());
}
}
NS_IMPL_CYCLE_COLLECTION_CLASS(nsScriptErrorWithStack)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsScriptErrorWithStack)
@@ -67,3 +89,31 @@ nsScriptErrorWithStack::GetStack(JS::MutableHandleValue aStack) {
aStack.setObjectOrNull(mStack);
return NS_OK;
}
NS_IMETHODIMP
nsScriptErrorWithStack::ToString(nsACString& /*UTF8*/ aResult)
{
MOZ_ASSERT(NS_IsMainThread());
nsCString message;
nsresult rv = nsScriptErrorBase::ToString(message);
NS_ENSURE_SUCCESS(rv, rv);
if (!mStack) {
aResult.Assign(message);
return NS_OK;
}
AutoJSAPI jsapi;
if (!jsapi.Init(mStack)) {
return NS_ERROR_FAILURE;
}
JSContext* cx = jsapi.cx();
RootedObject stack(cx, mStack);
nsCString stackString = FormatStackString(cx, stack);
nsCString combined = message + NS_LITERAL_CSTRING("\n") + stackString;
aResult.Assign(combined);
return NS_OK;
}
+1 -4
View File
@@ -3040,6 +3040,7 @@ public:
const char* category) override;
NS_IMETHOD GetStack(JS::MutableHandleValue) override;
NS_IMETHOD ToString(nsACString& aResult) override;
private:
virtual ~nsScriptErrorWithStack();
@@ -3746,10 +3747,6 @@ public:
// Using it in production is inherently unsafe.
bool forcePermissiveCOWs;
// Disables the XPConnect security checks that deny access to callables and
// accessor descriptors on COWs. Do not use this unless you are bholley.
bool skipCOWCallableChecks;
// Whether we've emitted a warning about a property that was filtered out
// by a security wrapper. See XrayWrapper.cpp.
bool wrapperDenialWarnings[WrapperDenialTypeCount];
+2 -3
View File
@@ -412,18 +412,17 @@ ExposedPropertiesOnly::check(JSContext* cx, HandleObject wrapper, HandleId id, W
}
// Inspect the property on the underlying object to check for red flags.
bool skipCallableChecks = CompartmentPrivate::Get(wrappedObject)->skipCOWCallableChecks;
if (!JS_GetPropertyDescriptorById(cx, wrappedObject, id, &desc))
return false;
// Reject accessor properties.
if (!skipCallableChecks && desc.hasGetterOrSetter()) {
if (desc.hasGetterOrSetter()) {
EnterAndThrow(cx, wrapper, "Exposing privileged accessor properties is prohibited");
return false;
}
// Reject privileged or cross-origin callables.
if (!skipCallableChecks && desc.value().isObject()) {
if (desc.value().isObject()) {
RootedObject maybeCallable(cx, js::UncheckedUnwrap(&desc.value().toObject()));
if (JS::IsCallable(maybeCallable) && !AccessCheck::subsumes(wrapper, maybeCallable)) {
EnterAndThrow(cx, wrapper, "Exposing privileged or cross-origin callable is prohibited");
+1 -1
View File
@@ -3,4 +3,4 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Avoid Lock_impl code depending on mozilla::Logger
MOZ_DEBUG_ENABLE_DEFS=
MOZ_DEBUG_DEFINES=
+1 -1
View File
@@ -27,7 +27,7 @@ endif
endif
gecko.js: $(grepref_files)
$(call py_action,preprocessor,$(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $^ -o $@)
$(call py_action,preprocessor,$(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) $^ -o $@)
libs:: gecko.js
$(INSTALL) $^ $(DIST)/bin/
+14 -15
View File
@@ -32,24 +32,23 @@ if not CONFIG['JS_STANDALONE']:
'probes',
]
if not CONFIG['LIBXUL_SDK']:
DIRS += [
'mfbt',
'config/external/zlib',
]
if not CONFIG['JS_STANDALONE']:
if CONFIG['MOZ_MEMORY']:
DIRS += ['memory']
DIRS += [
'mfbt',
'config/external/zlib',
'mozglue',
'memory/fallible',
'memory/mozalloc',
'memory/volatile',
]
if not CONFIG['JS_STANDALONE']:
if CONFIG['MOZ_MEMORY']:
DIRS += ['memory']
DIRS += [
'mozglue',
'memory/fallible',
'memory/mozalloc',
'memory/volatile',
]
if not CONFIG['JS_STANDALONE']:
DIRS += ['xpcom/xpidl']
@@ -113,9 +113,7 @@ class FasterMakeBackend(CommonBackend):
elif isinstance(obj, JsPreferenceFile) and \
obj.install_target.startswith('dist/bin'):
# The condition for the directory value in config/rules.mk is:
# ifneq (,$(DIST_SUBDIR)$(XPI_NAME)$(LIBXUL_SDK))
# - LIBXUL_SDK is not supported (it likely doesn't work in the
# recursive backend anyways
# ifneq (,$(DIST_SUBDIR)$(XPI_NAME))
# - when XPI_NAME is set, obj.install_target will start with
# dist/xpi-stage
# - when DIST_SUBDIR is set, obj.install_target will start with
@@ -24,6 +24,11 @@ from mozpack.manifests import (
)
import mozpack.path as mozpath
from mozbuild.frontend.context import (
Path,
SourcePath,
ObjDirPath,
)
from .common import CommonBackend
from ..frontend.data import (
AndroidAssetsDirs,
@@ -867,6 +872,21 @@ class RecursiveMakeBackend(CommonBackend):
ensureParentDir(mozpath.join(self.environment.topobjdir, 'dist', 'foo'))
def _pretty_path(self, path, backend_file):
assert isinstance(path, Path)
if isinstance(path, SourcePath):
if path.full_path.startswith(backend_file.srcdir):
return '$(srcdir)' + path.full_path[len(backend_file.srcdir):]
if path.full_path.startswith(self.environment.topsrcdir):
return '$(topsrcdir)' + path.full_path[len(self.environment.topsrcdir):]
elif isinstance(path, ObjDirPath):
if path.full_path.startswith(backend_file.objdir):
return path.full_path[len(backend_file.objdir) + 1:]
if path.full_path.startswith(self.environment.topobjdir):
return '$(DEPTH)' + path.full_path[len(self.environment.topobjdir):]
return path.full_path
def _process_unified_sources(self, obj):
backend_file = self._get_backend_file_for(obj)
@@ -1218,11 +1238,11 @@ INSTALL_TARGETS += %(prefix)s
self.backend_input_files |= obj.manifest.manifests
def _process_local_include(self, local_include, backend_file):
if local_include.startswith('/'):
path = '$(topsrcdir)'
path = self._pretty_path(local_include, backend_file)
if ' ' in path:
backend_file.write('LOCAL_INCLUDES += -I\'%s\'\n' % path)
else:
path = '$(srcdir)/'
backend_file.write('LOCAL_INCLUDES += -I%s%s\n' % (path, local_include))
backend_file.write('LOCAL_INCLUDES += -I%s\n' % path)
def _process_generated_include(self, generated_include, backend_file):
if generated_include.startswith('/'):
@@ -1496,7 +1516,7 @@ INSTALL_TARGETS += %(prefix)s
# which would modify content in the source directory.
'$(RM) $@',
'$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) '
'$(XULPPFLAGS) $< -o $@)'
'$(MOZ_DEBUG_DEFINES) $< -o $@)'
])
self._add_unified_build_rules(mk,
@@ -119,13 +119,8 @@ class VisualStudioBackend(CommonBackend):
self._paths_to_defines.setdefault(reldir, {}).update(obj.defines)
elif isinstance(obj, LocalInclude):
p = obj.path
includes = self._paths_to_includes.setdefault(reldir, [])
if p.startswith('/'):
includes.append(os.path.join('$(TopSrcDir)', p[1:]))
else:
includes.append(os.path.join('$(TopSrcDir)', reldir, p))
includes.append(obj.path.full_path)
# Just acknowledge everything.
return True
+1 -1
View File
@@ -1169,7 +1169,7 @@ VARIABLES = {
"""List of system libraries for host programs and libraries.
""", None),
'LOCAL_INCLUDES': (StrictOrderingOnAppendList, list,
'LOCAL_INCLUDES': (ContextDerivedTypedList(SourcePath, StrictOrderingOnAppendList), list,
"""Additional directories to be searched for include files by the compiler.
""", None),
+3 -10
View File
@@ -671,17 +671,10 @@ class TreeMetadataEmitter(LoggingMixin):
yield klass(context, name)
for local_include in context.get('LOCAL_INCLUDES', []):
if local_include.startswith('/'):
path = context.config.topsrcdir
relative_include = local_include[1:]
else:
path = context.srcdir
relative_include = local_include
actual_include = os.path.join(path, relative_include)
if not os.path.exists(actual_include):
if not os.path.exists(local_include.full_path):
raise SandboxValidationError('Path specified in LOCAL_INCLUDES '
'does not exist: %s (resolved to %s)' % (local_include, actual_include), context)
'does not exist: %s (resolved to %s)' % (local_include,
local_include.full_path), context)
yield LocalInclude(context, local_include)
final_target_files = context.get('FINAL_TARGET_FILES')
@@ -610,7 +610,7 @@ class TestRecursiveMakeBackend(BackendTester):
lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
expected = [
'LOCAL_INCLUDES += -I$(topsrcdir)/bar/baz',
'LOCAL_INCLUDES += -I$(srcdir)/bar/baz',
'LOCAL_INCLUDES += -I$(srcdir)/foo',
]
@@ -647,6 +647,15 @@ class TestEmitterBasic(unittest.TestCase):
self.assertEqual(local_includes, expected)
local_includes = [o.path.full_path
for o in objs if isinstance(o, LocalInclude)]
expected = [
mozpath.join(reader.config.topsrcdir, 'bar/baz'),
mozpath.join(reader.config.topsrcdir, 'foo'),
]
self.assertEqual(local_includes, expected)
def test_generated_includes(self):
"""Test that GENERATED_INCLUDES is emitted correctly."""
reader = self.reader('generated_includes')
+3 -1
View File
@@ -51,4 +51,6 @@ exports.send = send;
* Implement internal structured cloning algorithm in the future?
* http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#internal-structured-cloning-algorithm
*/
function clone (obj) JSON.parse(JSON.stringify(obj || {}))
function clone (obj) {
return JSON.parse(JSON.stringify(obj || {}));
}
+25 -23
View File
@@ -62,31 +62,33 @@ function definePseudo(loader, id, exports) {
loader.modules[uri] = { exports: exports };
}
function startup(reason, options) Startup.onceInitialized.then(() => {
// Inject globals ASAP in order to have console API working ASAP
Object.defineProperties(options.loader.globals, descriptor(globals));
function startup(reason, options) {
return Startup.onceInitialized.then(() => {
// Inject globals ASAP in order to have console API working ASAP
Object.defineProperties(options.loader.globals, descriptor(globals));
// NOTE: Module is intentionally required only now because it relies
// on existence of hidden window, which does not exists until startup.
let { ready } = require('../addon/window');
// Load localization manifest and .properties files.
// Run the addon even in case of error (best effort approach)
require('../l10n/loader').
load(rootURI).
then(null, function failure(error) {
if (!isNative)
console.info("Error while loading localization: " + error.message);
}).
then(function onLocalizationReady(data) {
// Exports data to a pseudo module so that api-utils/l10n/core
// can get access to it
definePseudo(options.loader, '@l10n/data', data ? data : null);
return ready;
}).then(function() {
run(options);
}).then(null, console.exception);
// NOTE: Module is intentionally required only now because it relies
// on existence of hidden window, which does not exists until startup.
let { ready } = require('../addon/window');
// Load localization manifest and .properties files.
// Run the addon even in case of error (best effort approach)
require('../l10n/loader').
load(rootURI).
then(null, function failure(error) {
if (!isNative)
console.info("Error while loading localization: " + error.message);
}).
then(function onLocalizationReady(data) {
// Exports data to a pseudo module so that api-utils/l10n/core
// can get access to it
definePseudo(options.loader, '@l10n/data', data ? data : null);
return ready;
}).then(function() {
run(options);
}).then(null, console.exception);
return void 0; // otherwise we raise a warning, see bug 910304
});
});
}
function run(options) {
try {
+1 -1
View File
@@ -17,4 +17,4 @@ const { isBrowser } = require("../window/utils");
// implementation for `isBrowser`. Either way it's not really needed yet
// neither window tracker provides this event.
exports.events = filter(events, function({target}) isBrowser(target));
exports.events = filter(events, ({target}) => isBrowser(target));
+10 -10
View File
@@ -19,14 +19,14 @@ const { events: windowEvents } = require("sdk/window/events");
// it's not observable reliably since it's not always triggered
// when closing tabs. Implementation can be imrpoved once that
// event will be necessary.
let TYPES = ["DOMContentLoaded", "load", "pageshow", "pagehide"];
var TYPES = ["DOMContentLoaded", "load", "pageshow", "pagehide"];
let insert = observe("document-element-inserted");
let windowCreate = merge([
var insert = observe("document-element-inserted");
var windowCreate = merge([
observe("content-document-global-created"),
observe("chrome-document-global-created")
]);
let create = map(windowCreate, function({target, data, type}) {
var create = map(windowCreate, function({target, data, type}) {
return { target: target.document, type: type, data: data }
});
@@ -34,7 +34,7 @@ function streamEventsFrom({document}) {
// Map supported event types to a streams of those events on the given
// `window` for the inserted document and than merge these streams into
// single form stream off all window state change events.
let stateChanges = TYPES.map(function(type) {
var stateChanges = TYPES.map(function(type) {
return open(document, type, { capture: true });
});
@@ -45,13 +45,13 @@ function streamEventsFrom({document}) {
}
exports.streamEventsFrom = streamEventsFrom;
let opened = windows(null, { includePrivate: true });
let state = merge(opened.map(streamEventsFrom));
var opened = windows(null, { includePrivate: true });
var state = merge(opened.map(streamEventsFrom));
let futureReady = filter(windowEvents, function({type})
var futureReady = filter(windowEvents, ({type}) =>
type === "DOMContentLoaded");
let futureWindows = map(futureReady, function({target}) target);
let futureState = expand(futureWindows, streamEventsFrom);
var futureWindows = map(futureReady, ({target}) => target);
var futureState = expand(futureWindows, streamEventsFrom);
exports.events = merge([insert, create, state, futureState]);
+16 -8
View File
@@ -65,15 +65,23 @@ exports.validationAttributes = valid;
* @param {Object} validation
* validation rule passed to `api-utils`
*/
function validate(suspect, validation) validateOptions(
{ $: suspect },
{ $: validation }
).$
function validate(suspect, validation) {
return validateOptions(
{ $: suspect },
{ $: validation }
).$;
}
function Allow(script) ({
get script() script,
set script(value) script = !!value
})
function Allow(script) {
return {
get script() {
return script;
},
set script(value) {
script = !!value;
}
};
}
/**
* Trait is intended to be used in some composition. It provides set of core
+9 -3
View File
@@ -148,9 +148,15 @@ const WorkerSandbox = Class({
let parent = window.parent === window ? content : content.parent;
merge(content, {
// We need 'this === window === top' to be true in toplevel scope:
get window() content,
get top() top,
get parent() parent
get window() {
return content;
},
get top() {
return top;
},
get parent() {
return parent;
}
});
// Use the Greasemonkey naming convention to provide access to the
// unwrapped window object so the content script can access document
+8 -6
View File
@@ -192,7 +192,7 @@ let URLContext = Class({
patterns = Array.isArray(patterns) ? patterns : [patterns];
try {
internal(this).patterns = patterns.map(function (p) new MatchPattern(p));
internal(this).patterns = patterns.map(p => new MatchPattern(p));
}
catch (err) {
throw new Error("Patterns must be a string, regexp or an array of " +
@@ -203,7 +203,7 @@ let URLContext = Class({
isCurrent: function isCurrent(popupNode) {
let url = popupNode.ownerDocument.URL;
return internal(this).patterns.some(function (p) p.test(url));
return internal(this).patterns.some(p => p.test(url));
}
});
exports.URLContext = URLContext;
@@ -273,11 +273,13 @@ function populateCallbackNodeData(node) {
}
function removeItemFromArray(array, item) {
return array.filter(function(i) i !== item);
return array.filter(i => i !== item);
}
// Converts anything that isn't false, null or undefined into a string
function stringOrNull(val) val ? String(val) : val;
function stringOrNull(val) {
return val ? String(val) : val;
}
// Shared option validation rules for Item, Menu, and Separator
let baseItemRules = {
@@ -296,7 +298,7 @@ let baseItemRules = {
if (!v)
return true;
let arr = Array.isArray(v) ? v : [v];
return arr.every(function (o) o instanceof Context);
return arr.every(o => o instanceof Context);
},
msg: "The 'context' option must be a Context object or an array of " +
"Context objects."
@@ -312,7 +314,7 @@ let labelledItemRules = mix(baseItemRules, {
label: {
map: stringOrNull,
is: ["string"],
ok: function (v) !!v,
ok: v => !!v,
msg: "The item must have a non-empty string label."
},
accesskey: {
+4 -2
View File
@@ -34,14 +34,16 @@ let promised = (function() {
// Utility function that does following:
// execute([ f, self, args...]) => f.apply(self, args)
function execute (args) call.apply(call, args)
function execute (args) {
return call.apply(call, args);
}
// Utility function that takes promise of `a` array and maybe promise `b`
// as arguments and returns promise for `a.concat(b)`.
function promisedConcat(promises, unknown) {
return promises.then(function (values) {
return resolve(unknown)
.then(function (value) values.concat([value]));
.then(value => values.concat([value]));
});
}
+3 -1
View File
@@ -56,7 +56,9 @@ const TestRunner = function TestRunner(options) {
};
TestRunner.prototype = {
toString: function toString() "[object TestRunner]",
toString: function toString() {
return "[object TestRunner]";
},
DEFAULT_PAUSE_TIMEOUT: (cfxArgs.parseable ? 300000 : 15000), //Five minutes (5*60*1000ms)
PAUSE_DELAY: 500,
@@ -25,7 +25,9 @@ const appShellService = Cc['@mozilla.org/appshell/appShellService;1'].
getService(Ci.nsIAppShellService);
// Bug 834961: ignore private windows when they are not supported
function getWindows() windows(null, { includePrivate: isPrivateBrowsingSupported });
function getWindows() {
return windows(null, { includePrivate: isPrivateBrowsingSupported });
}
/**
* An iterator for XUL windows currently in the application.
+2 -2
View File
@@ -49,7 +49,7 @@ FrameOptions.validator = {
ok: function(v) {
if (getTypeOf(v) === "array") {
// make sure every item is a function
return v.every(function (item) typeof(item) === "function")
return v.every(item => typeof(item) === "function")
}
return true;
}
@@ -113,4 +113,4 @@ function removeHiddenFrame(frame) {
}
exports.remove = removeHiddenFrame;
unload(function() fromIterator(cache).forEach(removeHiddenFrame));
unload(() => fromIterator(cache).forEach(removeHiddenFrame));
+3 -2
View File
@@ -95,6 +95,7 @@ function create(target, options) {
}
exports.create = create;
function swapFrameLoaders(from, to)
from.QueryInterface(Ci.nsIFrameLoaderOwner).swapFrameLoaders(to)
function swapFrameLoaders(from, to) {
return from.QueryInterface(Ci.nsIFrameLoaderOwner).swapFrameLoaders(to);
}
exports.swapFrameLoaders = swapFrameLoaders;
+6 -2
View File
@@ -323,7 +323,9 @@ Object.defineProperties(Buffer.prototype, {
['readUInt8', 'getUint8'],
['readInt8', 'getInt8']].forEach(([alias, name, littleEndian]) => {
Object.defineProperty(Buffer.prototype, alias, {
value: function(offset) this.view[name](offset, littleEndian)
value: function(offset) {
return this.view[name](offset, littleEndian);
}
});
});
@@ -342,6 +344,8 @@ Object.defineProperties(Buffer.prototype, {
['writeUInt8', 'setUint8'],
['writeInt8', 'setInt8']].forEach(([alias, name, littleEndian]) => {
Object.defineProperty(Buffer.prototype, alias, {
value: function(value, offset) this.view[name](offset, value, littleEndian)
value: function(value, offset) {
return this.view[name](offset, value, littleEndian);
}
});
});
+69 -25
View File
@@ -82,11 +82,19 @@ let nsIBinaryOutputStream = accessor();
// needs to be read.
const ALL = new String("Read all of the file");
function isWritable(mode) !!(mode & PR_WRONLY || mode & PR_RDWR)
function isReadable(mode) !!(mode & PR_RDONLY || mode & PR_RDWR)
function isWritable(mode) {
return !!(mode & PR_WRONLY || mode & PR_RDWR);
}
function isReadable(mode) {
return !!(mode & PR_RDONLY || mode & PR_RDWR);
}
function isString(value) typeof(value) === "string"
function isFunction(value) typeof(value) === "function"
function isString(value) {
return typeof(value) === "string";
}
function isFunction(value) {
return typeof(value) === "function";
}
function toArray(enumerator) {
let value = [];
@@ -95,7 +103,9 @@ function toArray(enumerator) {
return value
}
function getFileName(file) file.QueryInterface(Ci.nsIFile).leafName
function getFileName(file) {
return file.QueryInterface(Ci.nsIFile).leafName;
}
function remove(path, recursive) {
@@ -249,33 +259,67 @@ const Stats = Class({
if (!file.exists()) throw FSError("stat", "ENOENT", 34, path);
nsIFile(this, file);
},
isDirectory: function() nsIFile(this).isDirectory(),
isFile: function() nsIFile(this).isFile(),
isSymbolicLink: function() nsIFile(this).isSymlink(),
get mode() nsIFile(this).permissions,
get size() nsIFile(this).fileSize,
get mtime() nsIFile(this).lastModifiedTime,
isBlockDevice: function() nsIFile(this).isSpecial(),
isCharacterDevice: function() nsIFile(this).isSpecial(),
isFIFO: function() nsIFile(this).isSpecial(),
isSocket: function() nsIFile(this).isSpecial(),
isDirectory: function() {
return nsIFile(this).isDirectory();
},
isFile: function() {
return nsIFile(this).isFile();
},
isSymbolicLink: function() {
return nsIFile(this).isSymlink();
},
get mode() {
return nsIFile(this).permissions;
},
get size() {
return nsIFile(this).fileSize;
},
get mtime() {
return nsIFile(this).lastModifiedTime;
},
isBlockDevice: function() {
return nsIFile(this).isSpecial();
},
isCharacterDevice: function() {
return nsIFile(this).isSpecial();
},
isFIFO: function() {
return nsIFile(this).isSpecial();
},
isSocket: function() {
return nsIFile(this).isSpecial();
},
// non standard
get exists() nsIFile(this).exists(),
get hidden() nsIFile(this).isHidden(),
get writable() nsIFile(this).isWritable(),
get readable() nsIFile(this).isReadable()
get exists() {
return nsIFile(this).exists();
},
get hidden() {
return nsIFile(this).isHidden();
},
get writable() {
return nsIFile(this).isWritable();
},
get readable() {
return nsIFile(this).isReadable();
}
});
exports.Stats = Stats;
const LStats = Class({
extends: Stats,
get size() this.isSymbolicLink() ? nsIFile(this).fileSizeOfLink :
nsIFile(this).fileSize,
get mtime() this.isSymbolicLink() ? nsIFile(this).lastModifiedTimeOfLink :
nsIFile(this).lastModifiedTime,
get size() {
return this.isSymbolicLink() ? nsIFile(this).fileSizeOfLink :
nsIFile(this).fileSize;
},
get mtime() {
return this.isSymbolicLink() ? nsIFile(this).lastModifiedTimeOfLink :
nsIFile(this).lastModifiedTime;
},
// non standard
get permissions() this.isSymbolicLink() ? nsIFile(this).permissionsOfLink :
nsIFile(this).permissions
get permissions() {
return this.isSymbolicLink() ? nsIFile(this).permissionsOfLink :
nsIFile(this).permissions;
}
});
const FStat = Class({
+3 -1
View File
@@ -181,7 +181,9 @@ const InputStream = Class({
this.inputStreamPump = inputStreamPump;
this.binaryInputStream = binaryInputStream;
},
get status() nsIInputStreamPump(this).status,
get status() {
return nsIInputStreamPump(this).status;
},
read: function() {
nsIInputStreamPump(this).asyncRead(nsIStreamListener(this), null);
},
+6 -2
View File
@@ -185,8 +185,12 @@ const LOCALES_TO_RULES = {
};
// Utility functions for plural rules methods
function isIn(n, list) list.indexOf(n) !== -1;
function isBetween(n, start, end) start <= n && n <= end;
function isIn(n, list) {
return list.indexOf(n) !== -1;
}
function isBetween(n, start, end) {
return start <= n && n <= end;
}
// List of all plural rules methods, that maps an integer to the plural form name to use
const RULES = {
+1 -1
View File
@@ -80,4 +80,4 @@ function get(key, n, locales) {
return undefined;
}
exports.get = function(k, n) get(k, n, Array.slice(preferedLocales));
exports.get = (k, n) => get(k, n, Array.slice(preferedLocales));
+1 -1
View File
@@ -65,7 +65,7 @@ exports.notify = function notifications_notify(options) {
function notifyUsingConsole(iconURL, title, text) {
title = title ? "[" + title + "]" : "";
text = text || "";
let str = [title, text].filter(function (s) s).join(" ");
let str = [title, text].filter(s => s).join(" ");
console.log(str);
}
+15 -5
View File
@@ -38,10 +38,18 @@ const readyEventNames = [
'load'
];
function workerFor(page) workers.get(page)
function pageFor(view) pages.get(view)
function viewFor(page) views.get(page)
function isDisposed (page) !views.get(page, false)
function workerFor(page) {
return workers.get(page);
}
function pageFor(view) {
return pages.get(view);
}
function viewFor(page) {
return views.get(page);
}
function isDisposed (page) {
return !views.get(page, false);
}
let pageContract = contract(merge({
allow: {
@@ -81,7 +89,9 @@ function injectWorker ({page}) {
attach(worker, view.contentWindow);
}
function isValidURL(page, url) !page.rules || page.rules.matchesAny(url)
function isValidURL(page, url) {
return !page.rules || page.rules.matchesAny(url);
}
const Page = Class({
implements: [
+30 -10
View File
@@ -95,7 +95,9 @@ function setScriptState(panel, value) {
view.setAttribute("sdkscriptenabled", "" + value);
}
function isDisposed(panel) !views.has(panel);
function isDisposed(panel) {
return !views.has(panel);
}
let panels = new WeakMap();
let models = new WeakMap();
@@ -201,27 +203,43 @@ const Panel = Class({
views.delete(this);
},
/* Public API: Panel.width */
get width() modelFor(this).width,
set width(value) this.resize(value, this.height),
get width() {
return modelFor(this).width;
},
set width(value) {
this.resize(value, this.height);
},
/* Public API: Panel.height */
get height() modelFor(this).height,
set height(value) this.resize(this.width, value),
get height() {
return modelFor(this).height;
},
set height(value) {
this.resize(this.width, value);
},
/* Public API: Panel.focus */
get focus() modelFor(this).focus,
get focus() {
return modelFor(this).focus;
},
/* Public API: Panel.position */
get position() modelFor(this).position,
get position() {
return modelFor(this).position;
},
/* Public API: Panel.contextMenu */
get contextMenu() modelFor(this).contextMenu,
get contextMenu() {
return modelFor(this).contextMenu;
},
set contextMenu(allow) {
let model = modelFor(this);
model.contextMenu = panelContract({ contextMenu: allow }).contextMenu;
domPanel.allowContextMenu(viewFor(this), model.contextMenu);
},
get contentURL() modelFor(this).contentURL,
get contentURL() {
return modelFor(this).contentURL;
},
set contentURL(value) {
let model = modelFor(this);
model.contentURL = panelContract({ contentURL: value }).contentURL;
@@ -238,7 +256,9 @@ const Panel = Class({
},
/* Public API: Panel.isShowing */
get isShowing() !isDisposed(this) && domPanel.isOpen(viewFor(this)),
get isShowing() {
return !isDisposed(this) && domPanel.isOpen(viewFor(this));
},
/* Public API: Panel.show */
show: function show(options={}, anchor) {
+4 -3
View File
@@ -16,11 +16,12 @@ const { emit } = require("../event/core");
let channel = {};
function forward({ subject, type, data })
emit(channel, "data", { target: subject, type: type, data: data });
function forward({ subject, type, data }) {
return emit(channel, "data", { target: subject, type: type, data: data });
}
["popupshowing", "popuphiding", "popupshown", "popuphidden",
"document-element-inserted", "DOMContentLoaded", "load"
].forEach(function(type) events.on(type, forward));
].forEach(type => events.on(type, forward));
exports.events = channel;
+3 -1
View File
@@ -413,7 +413,9 @@ let getContentFrame = panel =>
panel.backgroundFrame
exports.getContentFrame = getContentFrame;
function getContentDocument(panel) getContentFrame(panel).contentDocument
function getContentDocument(panel) {
return getContentFrame(panel).contentDocument;
}
exports.getContentDocument = getContentDocument;
function setURL(panel, url) {
+6 -3
View File
@@ -16,8 +16,9 @@ const { URL: parseURL } = require("../url");
const LoginInfo = CC("@mozilla.org/login-manager/loginInfo;1",
"nsILoginInfo", "init");
function filterMatchingLogins(loginInfo)
Object.keys(this).every(function(key) loginInfo[key] === this[key], this);
function filterMatchingLogins(loginInfo) {
return Object.keys(this).every(key => loginInfo[key] === this[key], this);
}
/**
* Removes `user`, `password` and `path` fields from the given `url` if it's
@@ -70,7 +71,9 @@ Login.prototype.toLoginInfo = function toLoginInfo() {
usernameField, passwordField);
};
function loginToJSON(value) Login(value).toJSON()
function loginToJSON(value) {
return Login(value).toJSON();
}
/**
* Returns array of `nsILoginInfo` objects that are stored in the login manager
+3 -3
View File
@@ -62,7 +62,7 @@ const Bookmark = Class({
merge(this, bookmarkContract(extend(defaults, options)));
},
type: 'bookmark',
toString: function () '[object Bookmark]'
toString: () => '[object Bookmark]'
});
exports.Bookmark = Bookmark;
@@ -78,7 +78,7 @@ const Group = Class({
merge(this, groupContract(extend(defaults, options)));
},
type: 'group',
toString: function () '[object Group]'
toString: () => '[object Group]'
});
exports.Group = Group;
@@ -90,7 +90,7 @@ const Separator = Class({
merge(this, separatorContract(extend(defaults, options)));
},
type: 'separator',
toString: function () '[object Separator]'
toString: () => '[object Separator]'
});
exports.Separator = Separator;
+2 -2
View File
@@ -31,7 +31,7 @@ const validItem = {
},
index: {
is: ['undefined', 'null', 'number'],
map: function (value) value == null ? -1 : value,
map: value => value == null ? -1 : value,
msg: 'The `index` property must be a number.'
},
updated: {
@@ -57,7 +57,7 @@ const validURL = {
const validTags = {
tags: {
is: ['object'],
ok: function (tags) tags instanceof Set,
ok: tags => tags instanceof Set,
map: function (tags) {
if (Array.isArray(tags))
return new Set(tags);
@@ -63,8 +63,9 @@ function typeMap (type) {
}
}
function getBookmarkLastUpdated ({id})
resolve(bmsrv.getItemLastModified(id))
function getBookmarkLastUpdated ({id}) {
return resolve(bmsrv.getItemLastModified(id));
}
exports.getBookmarkLastUpdated;
function createBookmarkItem (data) {
@@ -162,7 +162,7 @@ function normalize (historyObj) {
* Hook into host
*/
let reqStream = filter(request, function (data) /sdk-places-query/.test(data.event));
var reqStream = filter(request, data => /sdk-places-query/.test(data.event));
on(reqStream, 'data', function (e) {
if (EVENT_MAP[e.event]) EVENT_MAP[e.event](e);
});
@@ -60,7 +60,7 @@ function getURLsByTag (message) {
};
resData.data = taggingService
.getURIsForTag(data.tag).map(function (uri) uri.spec);
.getURIsForTag(data.tag).map(uri => uri.spec);
respond(resData);
}
+4 -3
View File
@@ -44,7 +44,7 @@ let TreeNode = Class({
},
get: method(get),
walk: method(walk),
toString: function () '[object TreeNode]'
toString: () => '[object TreeNode]'
});
exports.TreeNode = TreeNode;
@@ -103,8 +103,9 @@ exports.constructTree = constructTree;
* Shortcut for converting an id, or an object with an id, into
* an object with corresponding bookmark data
*/
function fetchItem (item)
send('sdk-places-bookmarks-get', { id: item.id || item })
function fetchItem (item) {
return send('sdk-places-bookmarks-get', { id: item.id || item });
}
exports.fetchItem = fetchItem;
/*
+20 -8
View File
@@ -21,8 +21,8 @@ const { uuid } = require('../util/uuid');
const Unknown = new function() {
function hasInterface(component, iid) {
return component && component.interfaces &&
( component.interfaces.some(function(id) iid.equals(Ci[id])) ||
component.implements.some(function($) hasInterface($, iid)) ||
( component.interfaces.some(id => iid.equals(Ci[id])) ||
component.implements.some($ => hasInterface($, iid)) ||
hasInterface(Object.getPrototypeOf(component), iid));
}
@@ -85,7 +85,9 @@ const Factory = Class({
* This method is required by `nsIFactory` interfaces, but as in most
* implementations it does nothing interesting.
*/
lockFactory: function lockFactory(lock) undefined,
lockFactory: function lockFactory(lock) {
return undefined;
},
/**
* If property is `true` XPCOM service / factory will be registered
* automatically on creation.
@@ -131,7 +133,9 @@ const Factory = Class({
throw error instanceof Ci.nsIException ? error : Cr.NS_ERROR_FAILURE;
}
},
create: function create() this.Component()
create: function create() {
return this.Component();
}
});
exports.Factory = Factory;
@@ -148,11 +152,15 @@ const Service = Class({
/**
* Creates an instance of the class associated with this factory.
*/
create: function create() this.component
create: function create() {
return this.component;
}
});
exports.Service = Service;
function isRegistered({ id }) isCIDRegistered(id)
function isRegistered({ id }) {
return isCIDRegistered(id);
}
exports.isRegistered = isRegistered;
/**
@@ -216,7 +224,9 @@ exports.autoRegister = autoRegister;
/**
* Returns registered factory that has a given `id` or `null` if not found.
*/
function factoryByID(id) classesByID[id] || null
function factoryByID(id) {
return classesByID[id] || null;
}
exports.factoryByID = factoryByID;
/**
@@ -225,5 +235,7 @@ exports.factoryByID = factoryByID;
* with a given `contract` this will return a factory currently associated
* with a `contract`.
*/
function factoryByContract(contract) factoryByID(Cm.contractIDToCID(contract))
function factoryByContract(contract) {
return factoryByID(Cm.contractIDToCID(contract));
}
exports.factoryByContract = factoryByContract;
+21 -10
View File
@@ -26,27 +26,27 @@ const request = ns();
const { validateOptions, validateSingleOption } = new OptionsValidator({
url: {
// Also converts a URL instance to string, bug 857902
map: function (url) url.toString(),
map: url => url.toString(),
ok: isValidURI
},
headers: {
map: function (v) v || {},
map: v => v || {},
is: ["object"],
},
content: {
map: function (v) v || null,
map: v => v || null,
is: ["string", "object", "null"],
},
contentType: {
map: function (v) v || "application/x-www-form-urlencoded",
map: v => v || "application/x-www-form-urlencoded",
is: ["string"],
},
overrideMimeType: {
map: function(v) v || null,
map: v => v || null,
is: ["string", "null"],
},
anonymous: {
map: function(v) v || false,
map: v => v || false,
is: ["boolean", "null"],
}
});
@@ -164,13 +164,22 @@ const Response = Class({
initialize: function initialize(request) {
response(this).request = request;
},
get text() response(this).request.responseText,
get url() {
return response(this).request.responseURL;
},
get text() {
return response(this).request.responseText;
},
get xml() {
throw new Error("Sorry, the 'xml' property is no longer available. " +
"see bug 611042 for more information.");
},
get status() response(this).request.status,
get statusText() response(this).request.statusText,
get status() {
return response(this).request.status;
},
get statusText() {
return response(this).request.statusText;
},
get json() {
try {
return JSON.parse(this.text);
@@ -210,7 +219,9 @@ const Response = Class({
});
return headers;
},
get anonymous() response(this).request.mozAnon
get anonymous() {
return response(this).request.mozAnon;
}
});
// apiUtils.validateOptions doesn't give the ability to easily validate single
+1 -1
View File
@@ -80,7 +80,7 @@ const Selection = Class({
const selectionListener = {
notifySelectionChanged: function (document, selection, reason) {
if (!["SELECTALL", "KEYPRESS", "MOUSEUP"].some(function(type) reason &
if (!["SELECTALL", "KEYPRESS", "MOUSEUP"].some(type => reason &
Ci.nsISelectionListener[type + "_REASON"]) || selection.toString() == "")
return;
+15 -11
View File
@@ -15,16 +15,18 @@ const { get, set, exists } = Cc['@mozilla.org/process/environment;1'].
exports.env = Proxy.create({
// XPCOM does not provides a way to enumerate environment variables, so we
// just don't support enumeration.
getPropertyNames: function() [],
getOwnPropertyNames: function() [],
enumerate: function() [],
keys: function() [],
getPropertyNames: () => [],
getOwnPropertyNames: () => [],
enumerate: () => [],
keys: () => [],
// We do not support freezing, cause it would make it impossible to set new
// environment variables.
fix: function() undefined,
fix: () => undefined,
// We present all environment variables as own properties of this object,
// so we just delegate this call to `getOwnPropertyDescriptor`.
getPropertyDescriptor: function(name) this.getOwnPropertyDescriptor(name),
getPropertyDescriptor: function(name) {
return this.getOwnPropertyDescriptor(name);
},
// If environment variable with this name is defined, we generate proprety
// descriptor for it, otherwise fall back to `undefined` so that for consumer
// this property does not exists.
@@ -39,22 +41,24 @@ exports.env = Proxy.create({
// New environment variables can be defined just by defining properties
// on this object.
defineProperty: function(name, { value }) set(name, value),
defineProperty: (name, { value }) => set(name, value),
delete: function(name) {
set(name, null);
return true;
},
// We present all properties as own, there for we just delegate to `hasOwn`.
has: function(name) this.hasOwn(name),
has: function(name) {
return this.hasOwn(name);
},
// We do support checks for existence of an environment variable, via `in`
// operator on this object.
hasOwn: function(name) exists(name),
hasOwn: name => exists(name),
// On property get / set we do read / write appropriate environment variables,
// please note though, that variables with names of standard object properties
// intentionally (so that this behaves as normal object) can not be
// read / set.
get: function(proxy, name) Object.prototype[name] || get(name) || undefined,
set: function(proxy, name, value) Object.prototype[name] || set(name, value)
get: (proxy, name) => Object.prototype[name] || get(name) || undefined,
set: (proxy, name, value) => Object.prototype[name] || set(name, value)
});
+6 -6
View File
@@ -35,25 +35,25 @@ function tabEventsFor(window) {
// Map supported event types to a streams of those events on the given
// `window` and than merge these streams into single form stream off
// all events.
let channels = TYPES.map(function(type) open(window, type));
let channels = TYPES.map(type => open(window, type));
return merge(channels);
}
// Filter DOMContentLoaded events from all the browser events.
let readyEvents = filter(events, function(e) e.type === "DOMContentLoaded");
var readyEvents = filter(events, e => e.type === "DOMContentLoaded");
// Map DOMContentLoaded events to it's target browser windows.
let futureWindows = map(readyEvents, function(e) e.target);
var futureWindows = map(readyEvents, e => e.target);
// Expand all browsers that will become interactive to supported tab events
// on these windows. Result will be a tab events from all tabs of all windows
// that will become interactive.
let eventsFromFuture = expand(futureWindows, tabEventsFor);
var eventsFromFuture = expand(futureWindows, tabEventsFor);
// Above covers only windows that will become interactive in a future, but some
// windows may already be interactive so we pick those and expand to supported
// tab events for them too.
let interactiveWindows = windows("navigator:browser", { includePrivate: true }).
var interactiveWindows = windows("navigator:browser", { includePrivate: true }).
filter(isInteractive);
let eventsFromInteractive = merge(interactiveWindows.map(tabEventsFor));
var eventsFromInteractive = merge(interactiveWindows.map(tabEventsFor));
// Finally merge stream of tab events from future windows and current windows
+9 -3
View File
@@ -57,8 +57,12 @@ const Tab = Class({
* Changing this property changes an actual title.
* @type {String}
*/
get title() getTabTitle(tabNS(this).tab),
set title(title) setTabTitle(tabNS(this).tab, title),
get title() {
return getTabTitle(tabNS(this).tab);
},
set title(title) {
setTabTitle(tabNS(this).tab, title);
},
/**
* Location of the page currently loaded in this tab.
@@ -150,7 +154,9 @@ const Tab = Class({
* rendered as.
* @type {String}
*/
get contentType() getTabContentType(tabNS(this).tab),
get contentType() {
return getTabContentType(tabNS(this).tab);
},
/**
* Create a worker for this tab, first argument is options given to Worker.
+7 -3
View File
@@ -17,7 +17,9 @@ const { windows, isBrowser } = require('../window/utils');
const { isPrivateBrowsingSupported } = require('../self');
// Bug 834961: ignore private windows when they are not supported
function getWindows() windows(null, { includePrivate: isPrivateBrowsingSupported });
function getWindows() {
return windows(null, { includePrivate: isPrivateBrowsingSupported });
}
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@@ -91,7 +93,7 @@ function getTabs(window) {
return window.BrowserApp.tabs;
// firefox - default
return Array.filter(getTabContainer(window).children, function(t) !t.closing);
return Array.filter(getTabContainer(window).children, t => !t.closing);
}
exports.getTabs = getTabs;
@@ -312,7 +314,9 @@ function unpin(tab) {
}
exports.unpin = unpin;
function isPinned(tab) !!tab.pinned
function isPinned(tab) {
return !!tab.pinned;
}
exports.isPinned = isPinned;
function reload(tab) {
+7 -3
View File
@@ -342,7 +342,9 @@ function getPotentialLeaks() {
principal: details[1],
location: details[2] ? details[2].replace("\\", "/", "g") : undefined,
source: details[3] ? details[3].split(" -> ").reverse() : undefined,
toString: function() this.location
toString: function() {
return this.location;
}
};
if (!isPossibleLeak(item))
@@ -366,7 +368,9 @@ function getPotentialLeaks() {
path: matches[1],
location: details[1].replace("\\", "/", "g"),
source: [details[1].replace("\\", "/", "g")],
toString: function() this.location
toString: function() {
return this.location;
}
};
if (!isPossibleLeak(item))
@@ -636,7 +640,7 @@ var runTests = exports.runTests = function runTests(options) {
fileName: { value: e.fileName, writable: true, configurable: true },
lineNumber: { value: e.lineNumber, writable: true, configurable: true },
stack: { value: stack, writable: true, configurable: true },
toString: { value: function() String(e), writable: true, configurable: true },
toString: { value: () => String(e), writable: true, configurable: true },
});
print("Error: " + error + " \n " + format(error));
+3 -1
View File
@@ -71,7 +71,9 @@ const ActionButton = Class({
unregister(this);
},
get id() this.state().id,
get id() {
return this.state().id;
},
click: function click() { view.click(toWidgetId(this.id)) }
});
+6 -2
View File
@@ -72,9 +72,13 @@ const ToggleButton = Class({
unregister(this);
},
get id() this.state().id,
get id() {
return this.state().id;
},
click: function click() view.click(toWidgetId(this.id))
click: function click() {
return view.click(toWidgetId(this.id));
}
});
exports.ToggleButton = ToggleButton;

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