Merge mozilla-inbound to mozilla-central. a=merge

This commit is contained in:
Andreea Pavel 2018-08-22 06:35:14 +03:00
Родитель d56d102ae0 9c245b8d05
Коммит 883da574e8
203 изменённых файлов: 6912 добавлений и 1376 удалений

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

@ -15,3 +15,4 @@ export CFLAGS="--coverage"
export CXXFLAGS="--coverage"
export LDFLAGS="--coverage -L$topsrcdir/clang/lib/clang/7.0.0/lib/linux/"
export LIBS="-lclang_rt.profile-x86_64"
export RUSTFLAGS="-Ccodegen-units=1 -Zprofile -Zno-landing-pads"

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

@ -17,6 +17,7 @@
"as": "/builds/worker/workspace/build/src/gcc/bin/gcc",
"patches": [
"find_symbolizer_linux.patch",
"r322325.patch",
"r322401.patch",
"r325356.patch",
"r339636.patch"

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

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

@ -199,6 +199,11 @@ INCLUDES = \
include $(MOZILLA_DIR)/config/static-checking-config.mk
ifdef MOZ_PROFILE_GENERATE
MOZ_LTO_CFLAGS :=
MOZ_LTO_LDFLAGS :=
endif
LDFLAGS = $(MOZ_LTO_LDFLAGS) $(COMPUTED_LDFLAGS) $(PGO_LDFLAGS) $(MK_LDFLAGS)
COMPILE_CFLAGS = $(MOZ_LTO_CFLAGS) $(COMPUTED_CFLAGS) $(PGO_CFLAGS) $(_DEPEND_CFLAGS) $(MK_COMPILE_DEFINES)

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

@ -878,7 +878,7 @@ ifeq (neon,$(MOZ_FPU))
rustflags_neon += -C target_feature=+neon
endif
rustflags_override = RUSTFLAGS='$(MOZ_RUST_DEFAULT_FLAGS) $(RUSTFLAGS) $(rustflags_neon)'
rustflags_override = $(MOZ_RUST_DEFAULT_FLAGS) $(rustflags_neon)
ifdef MOZ_MSVCBITS
# If we are building a MozillaBuild shell, we want to clear out the
@ -942,8 +942,9 @@ endif # WINNT
# don't use the prefix when make -n is used, so that cargo doesn't run
# in that case)
define RUN_CARGO
$(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env $(environment_cleaner) $(rust_unlock_unstable) $(rustflags_override) $(sccache_wrap) \
$(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env $(environment_cleaner) $(rust_unlock_unstable) $(sccache_wrap) \
CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
RUSTFLAGS='$(2)' \
RUSTC=$(RUSTC) \
RUSTDOC=$(RUSTDOC) \
RUSTFMT=$(RUSTFMT) \
@ -956,7 +957,7 @@ $(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env $(environment_cleane
RUST_BACKTRACE=full \
MOZ_TOPOBJDIR=$(topobjdir) \
$(cargo_incremental) \
$(2) \
$(3) \
$(CARGO) $(1) $(cargo_build_flags)
endef
@ -967,12 +968,20 @@ endef
# but, given the idiosyncracies of make, can also be called without arguments:
#
# $(call CARGO_BUILD)
define CARGO_BUILD_HOST
$(call RUN_CARGO,rustc,$(rustflags_override),$(1))
endef
define CARGO_CHECK_HOST
$(call RUN_CARGO,check,$(rustflags_override),$(1))
endef
define CARGO_BUILD
$(call RUN_CARGO,rustc,$(1))
$(call RUN_CARGO,rustc,$(rustflags_override) $(RUSTFLAGS),$(1))
endef
define CARGO_CHECK
$(call RUN_CARGO,check,$(1))
$(call RUN_CARGO,check,$(rustflags_override) $(RUSTFLAGS),$(1))
endef
cargo_linker_env_var := CARGO_TARGET_$(RUST_TARGET_ENV_NAME)_LINKER
@ -1037,7 +1046,7 @@ endif
rust_test_flag := --no-fail-fast
force-cargo-test-run:
$(call RUN_CARGO,test $(cargo_target_flag) $(rust_test_flag) $(rust_test_options) $(rust_features_flag),$(target_cargo_env_vars))
$(call RUN_CARGO,test $(cargo_target_flag) $(rust_test_flag) $(rust_test_options) $(rust_features_flag),$(rustflags_override) $(RUSTFLAGS),$(target_cargo_env_vars))
check:: force-cargo-test-run
endif
@ -1050,12 +1059,12 @@ endif
force-cargo-host-library-build:
$(REPORT_BUILD)
$(call CARGO_BUILD) --lib $(cargo_host_flag) $(host_rust_features_flag)
$(call CARGO_BUILD_HOST) --lib $(cargo_host_flag) $(host_rust_features_flag)
$(HOST_RUST_LIBRARY_FILE): force-cargo-host-library-build
force-cargo-host-library-check:
$(call CARGO_CHECK) --lib $(cargo_host_flag) $(host_rust_features_flag)
$(call CARGO_CHECK_HOST) --lib $(cargo_host_flag) $(host_rust_features_flag)
else
force-cargo-host-library-check:
@true
@ -1077,13 +1086,13 @@ endif # RUST_PROGRAMS
ifdef HOST_RUST_PROGRAMS
force-cargo-host-program-build:
$(REPORT_BUILD)
$(call CARGO_BUILD) $(addprefix --bin ,$(HOST_RUST_CARGO_PROGRAMS)) $(cargo_host_flag)
$(call CARGO_BUILD_HOST) $(addprefix --bin ,$(HOST_RUST_CARGO_PROGRAMS)) $(cargo_host_flag)
$(HOST_RUST_PROGRAMS): force-cargo-host-program-build
force-cargo-host-program-check:
$(REPORT_BUILD)
$(call CARGO_CHECK) $(addprefix --bin ,$(HOST_RUST_CARGO_PROGRAMS)) $(cargo_host_flag)
$(call CARGO_CHECK_HOST) $(addprefix --bin ,$(HOST_RUST_CARGO_PROGRAMS)) $(cargo_host_flag)
else
force-cargo-host-program-check:
@true

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

@ -7,7 +7,6 @@
interface nsISHEntry;
interface nsISHistoryListener;
interface nsISimpleEnumerator;
/**
* An interface to the primary properties of the Session History
@ -132,29 +131,6 @@ interface nsISHistory: nsISupports
*/
void removeSHistoryListener(in nsISHistoryListener aListener);
/**
* Called to obtain a enumerator for all the documents stored in
* session history. The enumerator object thus returned by this method
* can be traversed using nsISimpleEnumerator.
*
* @note To access individual history entries of the enumerator, perform the
* following steps:
* 1) Call nsISHistory->GetSHistoryEnumerator() to obtain handle
* the nsISimpleEnumerator object.
* 2) Use nsISimpleEnumerator->GetNext() on the object returned
* by step #1 to obtain handle to the next object in the list.
* The object returned by this step is of type nsISupports.
* 3) Perform a QueryInterface on the object returned by step #2
* to nsISHEntry.
* 4) Use nsISHEntry to access properties of each history entry.
*
* @see nsISimpleEnumerator
* @see nsISHEntry
* @see QueryInterface()
* @see do_QueryInterface()
*/
readonly attribute nsISimpleEnumerator SHistoryEnumerator;
void reloadCurrentEntry();
/**

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

@ -2110,55 +2110,3 @@ nsSHistory::SetRootDocShell(nsIDocShell* aDocShell)
return NS_OK;
}
NS_IMETHODIMP
nsSHistory::GetSHistoryEnumerator(nsISimpleEnumerator** aEnumerator)
{
NS_ENSURE_ARG_POINTER(aEnumerator);
RefPtr<nsSHEnumerator> iterator = new nsSHEnumerator(this);
iterator.forget(aEnumerator);
return NS_OK;
}
nsSHEnumerator::nsSHEnumerator(nsSHistory* aSHistory) : mIndex(-1)
{
mSHistory = aSHistory;
}
nsSHEnumerator::~nsSHEnumerator()
{
mSHistory = nullptr;
}
NS_IMPL_ISUPPORTS(nsSHEnumerator, nsISimpleEnumerator)
NS_IMETHODIMP
nsSHEnumerator::HasMoreElements(bool* aReturn)
{
int32_t cnt;
*aReturn = false;
mSHistory->GetCount(&cnt);
if (mIndex >= -1 && mIndex < (cnt - 1)) {
*aReturn = true;
}
return NS_OK;
}
NS_IMETHODIMP
nsSHEnumerator::GetNext(nsISupports** aItem)
{
NS_ENSURE_ARG_POINTER(aItem);
int32_t cnt = 0;
nsresult result = NS_ERROR_FAILURE;
mSHistory->GetCount(&cnt);
if (mIndex < (cnt - 1)) {
mIndex++;
nsCOMPtr<nsISHEntry> hEntry;
result = mSHistory->GetEntryAtIndex(mIndex, false, getter_AddRefs(hEntry));
if (hEntry) {
result = CallQueryInterface(hEntry, aItem);
}
}
return result;
}

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

@ -22,7 +22,6 @@
class nsIDocShell;
class nsDocShell;
class nsSHEnumerator;
class nsSHistoryObserver;
class nsISHEntry;
class nsISHTransaction;
@ -133,7 +132,6 @@ public:
private:
virtual ~nsSHistory();
friend class nsSHEnumerator;
friend class nsSHistoryObserver;
nsresult GetTransactionAtIndex(int32_t aIndex, nsISHTransaction** aResult);
@ -192,23 +190,6 @@ private:
static int32_t sHistoryMaxTotalViewers;
};
class nsSHEnumerator : public nsISimpleEnumerator
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISIMPLEENUMERATOR
explicit nsSHEnumerator(nsSHistory* aHistory);
protected:
friend class nsSHistory;
virtual ~nsSHEnumerator();
private:
int32_t mIndex;
nsSHistory* mSHistory;
};
inline nsISupports*
ToSupports(nsSHistory* aObj)
{

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

@ -66,7 +66,6 @@ using mozilla::DefaultXDisplay;
#include "nsContentCID.h"
#include "nsWidgetsCID.h"
static NS_DEFINE_CID(kWidgetCID, NS_CHILD_CID);
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
#ifdef XP_WIN
@ -2983,7 +2982,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void)
if (!mWidget) {
// native (single process)
mWidget = do_CreateInstance(kWidgetCID, &rv);
mWidget = nsIWidget::CreateChildWindow();
nsWidgetInitData initData;
initData.mWindowType = eWindowType_plugin;
initData.mUnicode = false;

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

@ -28,8 +28,6 @@ const wchar_t* kPluginWidgetContentParentProperty =
namespace mozilla {
namespace plugins {
static NS_DEFINE_CID(kWidgetCID, NS_CHILD_CID);
// This macro returns IPC_OK() to prevent an abort in the child process when
// ipc message delivery fails.
#define ENSURE_CHANNEL { \
@ -86,8 +84,8 @@ PluginWidgetParent::RecvCreate(nsresult* aResult, uint64_t* aScrollCaptureId,
*aScrollCaptureId = 0;
*aPluginInstanceId = 0;
mWidget = do_CreateInstance(kWidgetCID, aResult);
NS_ASSERTION(NS_SUCCEEDED(*aResult), "widget create failure");
mWidget = nsIWidget::CreateChildWindow();
*aResult = mWidget ? NS_OK : NS_ERROR_FAILURE;
// This returns the top level window widget
nsCOMPtr<nsIWidget> parentWidget = GetTabParent()->GetWidget();

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

@ -29,6 +29,7 @@
#include "mozilla/ipc/BackgroundChild.h"
#include "GeckoProfiler.h"
#include "jsfriendapi.h"
#include "js/LocaleSensitive.h"
#include "mozilla/AbstractThread.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/AsyncEventDispatcher.h"

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

@ -6,6 +6,7 @@
#include "WorkerPrivate.h"
#include "js/LocaleSensitive.h"
#include "js/MemoryMetrics.h"
#include "MessageEventRunnable.h"
#include "mozilla/ScopeExit.h"

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

@ -11,6 +11,7 @@
#include "mozilla/dom/ContentChild.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/ContentPrincipal.h"
#include "mozilla/Pair.h"
#include "mozilla/Services.h"
#include "mozilla/SystemGroup.h"
#include "mozilla/Unused.h"
@ -2105,7 +2106,7 @@ template<class T>
nsresult
nsPermissionManager::RemovePermissionEntries(T aCondition)
{
nsCOMArray<nsIPermission> array;
AutoTArray<Pair<nsCOMPtr<nsIPrincipal>, nsCString>, 10> array;
for (auto iter = mPermissionTable.Iter(); !iter.Done(); iter.Next()) {
PermissionHashKey* entry = iter.Get();
for (const auto& permEntry : entry->GetPermissions()) {
@ -2120,39 +2121,16 @@ nsPermissionManager::RemovePermissionEntries(T aCondition)
continue;
}
nsCOMPtr<nsIPermission> permission =
nsPermission::Create(principal,
mTypeArray.ElementAt(permEntry.mType),
permEntry.mPermission,
permEntry.mExpireType,
permEntry.mExpireTime);
if (NS_WARN_IF(!permission)) {
continue;
}
array.AppendObject(permission);
array.AppendElement(MakePair(principal,
mTypeArray.ElementAt(permEntry.mType)));
}
}
for (int32_t i = 0; i<array.Count(); ++i) {
nsCOMPtr<nsIPrincipal> principal;
nsAutoCString type;
nsresult rv = array[i]->GetPrincipal(getter_AddRefs(principal));
if (NS_FAILED(rv)) {
NS_ERROR("GetPrincipal() failed!");
continue;
}
rv = array[i]->GetType(type);
if (NS_FAILED(rv)) {
NS_ERROR("GetType() failed!");
continue;
}
for (size_t i = 0; i < array.Length(); ++i) {
// AddInternal handles removal, so let it do the work...
AddInternal(
principal,
type,
array[i].first(),
array[i].second(),
nsIPermissionManager::UNKNOWN_ACTION,
0,
nsIPermissionManager::EXPIRE_NEVER, 0, 0,
@ -2728,7 +2706,7 @@ nsPermissionManager::RemovePermissionsWithAttributes(const nsAString& aPattern)
nsresult
nsPermissionManager::RemovePermissionsWithAttributes(mozilla::OriginAttributesPattern& aPattern)
{
nsCOMArray<nsIPermission> permissions;
AutoTArray<Pair<nsCOMPtr<nsIPrincipal>, nsCString>, 10> permissions;
for (auto iter = mPermissionTable.Iter(); !iter.Done(); iter.Next()) {
PermissionHashKey* entry = iter.Get();
@ -2744,28 +2722,14 @@ nsPermissionManager::RemovePermissionsWithAttributes(mozilla::OriginAttributesPa
}
for (const auto& permEntry : entry->GetPermissions()) {
nsCOMPtr<nsIPermission> permission =
nsPermission::Create(principal,
mTypeArray.ElementAt(permEntry.mType),
permEntry.mPermission,
permEntry.mExpireType,
permEntry.mExpireTime);
if (NS_WARN_IF(!permission)) {
continue;
}
permissions.AppendObject(permission);
permissions.AppendElement(MakePair(principal,
mTypeArray.ElementAt(permEntry.mType)));
}
}
for (int32_t i = 0; i < permissions.Count(); ++i) {
nsCOMPtr<nsIPrincipal> principal;
nsAutoCString type;
permissions[i]->GetPrincipal(getter_AddRefs(principal));
permissions[i]->GetType(type);
AddInternal(principal,
type,
for (size_t i = 0; i < permissions.Length(); ++i) {
AddInternal(permissions[i].first(),
permissions[i].second(),
nsIPermissionManager::UNKNOWN_ACTION,
0,
nsIPermissionManager::EXPIRE_NEVER,

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

@ -237,12 +237,14 @@ ContentClient::BeginPaint(PaintedLayer* aLayer,
<< dest.mBufferRect.Width() << ", "
<< dest.mBufferRect.Height();
}
result.mAsyncTask = nullptr;
Clear();
return result;
}
if (!newBuffer->Lock(writeMode)) {
gfxCriticalNote << "Failed to lock new back buffer.";
result.mAsyncTask = nullptr;
Clear();
return result;
}
@ -295,7 +297,7 @@ ContentClient::BeginPaint(PaintedLayer* aLayer,
void
ContentClient::EndPaint(PaintState& aPaintState, nsTArray<ReadbackProcessor::Update>* aReadbackUpdates)
{
if (aPaintState.mAsyncTask && mBuffer) {
if (aPaintState.mAsyncTask) {
aPaintState.mAsyncTask->mCapture = mBuffer->EndCapture();
}
}

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

@ -92,6 +92,7 @@ CompositorBridgeChild::CompositorBridgeChild(CompositorManagerChild *aManager)
, mProcessToken(0)
, mSectionAllocator(nullptr)
, mPaintLock("CompositorBridgeChild.mPaintLock")
, mTotalAsyncPaints(0)
, mOutstandingAsyncPaints(0)
, mOutstandingAsyncEndTransaction(false)
, mIsDelayingForAsyncPaints(false)
@ -1190,6 +1191,11 @@ CompositorBridgeChild::NotifyBeginAsyncPaint(PaintTask* aTask)
MonitorAutoLock lock(mPaintLock);
if (mTotalAsyncPaints == 0) {
mAsyncTransactionBegin = TimeStamp::Now();
}
mTotalAsyncPaints += 1;
// We must not be waiting for paints or buffer copying to complete yet. This
// would imply we started a new paint without waiting for a previous one, which
// could lead to incorrect rendering or IPDL deadlocks.
@ -1249,6 +1255,13 @@ CompositorBridgeChild::NotifyFinishedAsyncEndLayerTransaction()
MonitorAutoLock lock(mPaintLock);
if (mTotalAsyncPaints > 0) {
float tenthMs = (TimeStamp::Now() - mAsyncTransactionBegin).ToMilliseconds() * 10;
Telemetry::Accumulate(Telemetry::GFX_OMTP_PAINT_TASK_COUNT, int32_t(mTotalAsyncPaints));
Telemetry::Accumulate(Telemetry::GFX_OMTP_PAINT_TIME, int32_t(tenthMs));
mTotalAsyncPaints = 0;
}
// Since this should happen after ALL paints are done and
// at the end of a transaction, this should always be true.
MOZ_RELEASE_ASSERT(mOutstandingAsyncPaints == 0);

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

@ -372,6 +372,12 @@ private:
// state below.
Monitor mPaintLock;
// Contains the number of asynchronous paints that were queued since the
// beginning of the last async transaction, and the time stamp of when
// that was
size_t mTotalAsyncPaints;
TimeStamp mAsyncTransactionBegin;
// Contains the number of outstanding asynchronous paints tied to a
// PLayerTransaction on this bridge. This is R/W on both the main and paint
// threads, and must be accessed within the paint lock.

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

@ -686,6 +686,7 @@ IToplevelProtocol::IToplevelProtocol(const char* aName,
IToplevelProtocol::~IToplevelProtocol()
{
mState = nullptr;
if (mTrans) {
RefPtr<DeleteTask<Transport>> task = new DeleteTask<Transport>(mTrans.release());
XRE_GetIOMessageLoop()->PostTask(task.forget());

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

@ -0,0 +1,99 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* Functions and structures related to locale-sensitive behavior, including
* exposure of the default locale (used by operations like toLocaleString).
*/
#ifndef js_LocaleSensitive_h
#define js_LocaleSensitive_h
#include "jstypes.h" // JS_PUBLIC_API
#include "js/RootingAPI.h" // JS::Handle, JS::MutableHandle
#include "js/Utility.h" // JS::UniqueChars
struct JSContext;
struct JSRuntime;
class JSString;
namespace JS { union Value; }
/**
* Set the default locale for the ECMAScript Internationalization API
* (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat, and others that will
* arise as time passes). (Note that the Internationalization API encourages
* clients to specify their own locales; this default locale is only used when
* no locale is specified, e.g. calling a toLocaleString function without
* passing a locale argument to it.)
*
* The locale string remains owned by the caller.
*/
extern JS_PUBLIC_API(bool)
JS_SetDefaultLocale(JSRuntime* rt, const char* locale);
/**
* Return a copy of the default locale for the ECMAScript Internationalization
* API (and for various ECMAScript functions that will invoke it). The locale
* is retrieved from the |JSRuntime| that corresponds to |cx|.
*
* XXX Bug 1483961 means it's difficult to interpret the meaning of a null
* return value for the time being, and we should fix this!
*/
extern JS_PUBLIC_API(JS::UniqueChars)
JS_GetDefaultLocale(JSContext* cx);
/** Reset the default locale to OS defaults. */
extern JS_PUBLIC_API(void)
JS_ResetDefaultLocale(JSRuntime* rt);
using JSLocaleToUpperCase =
bool (*)(JSContext* cx, JS::Handle<JSString*> src, JS::MutableHandle<JS::Value> rval);
using JSLocaleToLowerCase =
bool (*)(JSContext* cx, JS::Handle<JSString*> src, JS::MutableHandle<JS::Value> rval);
using JSLocaleCompare =
bool (*)(JSContext* cx, JS::Handle<JSString*> src1, JS::Handle<JSString*> src2,
JS::MutableHandle<JS::Value> rval);
using JSLocaleToUnicode =
bool (*)(JSContext* cx, const char* src, JS::MutableHandle<JS::Value> rval);
/**
* A suite of locale-specific string conversion and error message callbacks
* used to implement locale-sensitive behaviors (such as those performed by
* the various toLocaleString and toLocale{Date,Time}String functions).
*
* If SpiderMonkey is compiled --with-intl-api, then #if EXPOSE_INTL_API. In
* this case, SpiderMonkey itself will implement ECMA-402-compliant behavior by
* calling on ICU, and none of the fields in this struct will ever be used.
* (You'll still be able to call the get/set-callbacks functions; they just
* won't affect JavaScript semantics.)
*/
struct JSLocaleCallbacks
{
JSLocaleToUpperCase localeToUpperCase;
JSLocaleToLowerCase localeToLowerCase;
JSLocaleCompare localeCompare;
JSLocaleToUnicode localeToUnicode;
};
/**
* Set locale callbacks to be used in builds not compiled --with-intl-api.
* |callbacks| must persist as long as the |JSRuntime|. Pass |nullptr| to
* restore default behavior.
*/
extern JS_PUBLIC_API(void)
JS_SetLocaleCallbacks(JSRuntime* rt, const JSLocaleCallbacks* callbacks);
/**
* Return the current locale callbacks, which may be nullptr.
*/
extern JS_PUBLIC_API(const JSLocaleCallbacks*)
JS_GetLocaleCallbacks(JSRuntime* rt);
#endif /* js_LocaleSensitive_h */

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

@ -31,6 +31,9 @@
#include "builtin/RegExp.h"
#include "jit/InlinableNatives.h"
#include "js/Conversions.h"
#if !EXPOSE_INTL_API
#include "js/LocaleSensitive.h"
#endif
#include "js/StableStringChars.h"
#include "js/UniquePtr.h"
#if ENABLE_INTL_API

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

@ -44,6 +44,7 @@
#include "js/AutoByteString.h"
#include "js/Debug.h"
#include "js/HashTable.h"
#include "js/LocaleSensitive.h"
#include "js/StableStringChars.h"
#include "js/StructuredClone.h"
#include "js/UbiNode.h"

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

@ -68,6 +68,11 @@ static const JSFunctionSpec relativeTimeFormat_methods[] = {
JS_FS_END
};
static const JSPropertySpec relativeTimeFormat_properties[] = {
JS_STRING_SYM_PS(toStringTag, "Intl.RelativeTimeFormat", JSPROP_READONLY),
JS_PS_END
};
/**
* RelativeTimeFormat constructor.
* Spec: ECMAScript 402 API, RelativeTimeFormat, 1.1
@ -148,6 +153,9 @@ js::CreateRelativeTimeFormatPrototype(JSContext* cx, HandleObject Intl,
if (!JS_DefineFunctions(cx, proto, relativeTimeFormat_methods))
return nullptr;
if (!JS_DefineProperties(cx, proto, relativeTimeFormat_properties))
return nullptr;
RootedValue ctorValue(cx, ObjectValue(*ctor));
if (!DefineDataProperty(cx, Intl, cx->names().RelativeTimeFormat, ctorValue, 0))
return nullptr;

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

@ -63,15 +63,3 @@ non262/extensions/regress-477187.js
non262/regress/regress-452498-052-a.js
non262/extensions/clone-complex-object.js
non262/extensions/clone-object-deep.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js

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

@ -5,6 +5,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/. */
#include "js/LocaleSensitive.h"
#include "jsapi-tests/tests.h"
BEGIN_TEST(testDateToLocaleString)

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

@ -5,6 +5,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/. */
#include "js/LocaleSensitive.h"
#include "jsapi-tests/tests.h"
BEGIN_TEST(testIntlAvailableLocales)

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

@ -61,6 +61,7 @@
#include "js/Date.h"
#include "js/Initialization.h"
#include "js/JSON.h"
#include "js/LocaleSensitive.h"
#include "js/Proxy.h"
#include "js/SliceBudget.h"
#include "js/StableStringChars.h"

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

@ -223,19 +223,6 @@ typedef void
JS::PromiseRejectionHandlingState state,
void* data);
typedef bool
(* JSLocaleToUpperCase)(JSContext* cx, JS::HandleString src, JS::MutableHandleValue rval);
typedef bool
(* JSLocaleToLowerCase)(JSContext* cx, JS::HandleString src, JS::MutableHandleValue rval);
typedef bool
(* JSLocaleCompare)(JSContext* cx, JS::HandleString src1, JS::HandleString src2,
JS::MutableHandleValue rval);
typedef bool
(* JSLocaleToUnicode)(JSContext* cx, const char* src, JS::MutableHandleValue rval);
/**
* Callback used to ask the embedding for the cross compartment wrapper handler
* that implements the desired prolicy for this kind of object in the
@ -4725,55 +4712,6 @@ PropertySpecNameToPermanentId(JSContext* cx, const char* name, jsid* idp);
/************************************************************************/
/**
* The default locale for the ECMAScript Internationalization API
* (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).
* Note that the Internationalization API encourages clients to
* specify their own locales.
* The locale string remains owned by the caller.
*/
extern JS_PUBLIC_API(bool)
JS_SetDefaultLocale(JSRuntime* rt, const char* locale);
/**
* Look up the default locale for the ECMAScript Internationalization API.
* NB: The locale information is retrieved from cx's runtime.
*/
extern JS_PUBLIC_API(JS::UniqueChars)
JS_GetDefaultLocale(JSContext* cx);
/**
* Reset the default locale to OS defaults.
*/
extern JS_PUBLIC_API(void)
JS_ResetDefaultLocale(JSRuntime* rt);
/**
* Locale specific string conversion and error message callbacks.
*/
struct JSLocaleCallbacks {
JSLocaleToUpperCase localeToUpperCase; // not used #if EXPOSE_INTL_API
JSLocaleToLowerCase localeToLowerCase; // not used #if EXPOSE_INTL_API
JSLocaleCompare localeCompare; // not used #if EXPOSE_INTL_API
JSLocaleToUnicode localeToUnicode;
};
/**
* Establish locale callbacks. The pointer must persist as long as the
* JSContext. Passing nullptr restores the default behaviour.
*/
extern JS_PUBLIC_API(void)
JS_SetLocaleCallbacks(JSRuntime* rt, const JSLocaleCallbacks* callbacks);
/**
* Return the address of the current locale callbacks struct, which may
* be nullptr.
*/
extern JS_PUBLIC_API(const JSLocaleCallbacks*)
JS_GetLocaleCallbacks(JSRuntime* rt);
/************************************************************************/
/*
* Error reporting.
*

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

@ -28,6 +28,9 @@
#include "builtin/String.h"
#include "double-conversion/double-conversion.h"
#include "js/Conversions.h"
#if !EXPOSE_INTL_API
#include "js/LocaleSensitive.h"
#endif
#include "util/DoubleToString.h"
#include "util/StringBuffer.h"
#ifdef ENABLE_BIGINT

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

@ -68,7 +68,6 @@ struct JSClass;
class JSErrorReport;
struct JSExceptionState;
struct JSFunctionSpec;
struct JSLocaleCallbacks;
struct JSPrincipals;
struct JSPropertySpec;
struct JSSecurityCallbacks;

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

@ -144,6 +144,7 @@ EXPORTS.js += [
'../public/Id.h',
'../public/Initialization.h',
'../public/JSON.h',
'../public/LocaleSensitive.h',
'../public/MemoryFunctions.h',
'../public/MemoryMetrics.h',
'../public/Principals.h',

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

@ -804,15 +804,14 @@ case "$target" in
CFLAGS="$CFLAGS -we4553"
CXXFLAGS="$CXXFLAGS -we4553"
LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
MOZ_DEBUG_LDFLAGS='-DEBUG'
WARNINGS_AS_ERRORS='-WX'
MOZ_OPTIMIZE_FLAGS="-O2"
MOZ_FIX_LINK_PATHS=
LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
if test -z "$DEVELOPER_OPTIONS"; then
LDFLAGS="$LDFLAGS -RELEASE"
fi
LDFLAGS="$LDFLAGS -DYNAMICBASE"
RCFLAGS="-nologo"
fi
AC_DEFINE(HAVE__MSIZE)

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

@ -9,18 +9,6 @@ skip script non262/String/normalize-generateddata-input.js # input data for othe
# Timeouts on arm and cgc builds.
slow script test262/built-ins/decodeURI/S15.1.3.1_A2.5_T1.js
slow script test262/built-ins/decodeURIComponent/S15.1.3.2_A2.5_T1.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js
slow script test262/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js
#################################################################
@ -463,10 +451,6 @@ skip script test262/built-ins/Reflect/ownKeys/return-on-corresponding-order-larg
skip script test262/intl402/ListFormat/prototype/toStringTag/toString.js
skip script test262/intl402/ListFormat/prototype/toStringTag/toStringTag.js
# https://bugzilla.mozilla.org/show_bug.cgi?id=1473228
skip script test262/intl402/RelativeTimeFormat/prototype/toStringTag/toString.js
skip script test262/intl402/RelativeTimeFormat/prototype/toStringTag/toStringTag.js
# https://bugzilla.mozilla.org/show_bug.cgi?id=1473228
skip script test262/intl402/Segmenter/prototype/toStringTag/toString.js
skip script test262/intl402/Segmenter/prototype/toStringTag/toStringTag.js

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

@ -1,5 +1,7 @@
commit 60b9467630a7b4899058e3ad74eb88c3ecb08a40
Author: Kevin Gibbons <bakkot@gmail.com>
Date: Fri Aug 10 23:16:46 2018 -0700
commit ab436c465106be86719c4849c9cedecd7b570ff9
Author: Leo Balter <leonardo.balter@gmail.com>
Date: Fri Aug 17 18:06:19 2018 -0400
Two more simple tests
Merge pull request #1677 from tc39/ofe-use-verifyproperty
Object.fromEntries: use verifyProperty; add specification details

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

@ -57,6 +57,6 @@ assert.sameValue(
'timed-out',
'$262.agent.getReport() returns "timed-out"'
);
assert.sameValue(Atomics.nofity(i32a, 0), 0, 'Atomics.nofity(i32a, 0) returns 0');
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
reportCompare(0, 0);

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

@ -2,8 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: When given an empty list, makes an empty object.
esid: sec-object.fromentries
description: When given an empty list, makes an empty object.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
features: [Object.fromEntries]
---*/

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

@ -2,8 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Evaluation order is iterator.next(), get '0', get '1', toPropertyKey, repeat.
esid: sec-object.fromentries
description: Evaluation order is iterator.next(), get '0', get '1', toPropertyKey, repeat.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
includes: [compareArray.js]
features: [Symbol.iterator, Object.fromEntries]
---*/

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

@ -2,8 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Closes iterators when they return entries which are null.
esid: sec-object.fromentries
description: Closes iterators when they return entries which are null.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
AddEntriesFromIterable ( target, iterable, adder )
...
4. Repeat,
...
d. If Type(nextItem) is not Object, then
i. Let error be ThrowCompletion(a newly created TypeError object).
ii. Return ? IteratorClose(iteratorRecord, error).
features: [Symbol.iterator, Object.fromEntries]
---*/
@ -19,7 +36,7 @@ var iterable = {
advanced = true;
return {
done: false,
value: 'null',
value: null,
};
},
return: function() {

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

@ -2,8 +2,25 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Closes iterators when they return entries which are strings.
esid: sec-object.fromentries
description: Closes iterators when they return entries which are strings.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
AddEntriesFromIterable ( target, iterable, adder )
...
4. Repeat,
...
d. If Type(nextItem) is not Object, then
i. Let error be ThrowCompletion(a newly created TypeError object).
ii. Return ? IteratorClose(iteratorRecord, error).
features: [Symbol.iterator, Object.fromEntries]
---*/

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

@ -2,8 +2,24 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Closes iterators when accessing an entry's properties throws.
esid: sec-object.fromentries
description: Closes iterators when accessing an entry's key throws.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
AddEntriesFromIterable ( target, iterable, adder )
...
4. Repeat,
...
e. Let k be Get(nextItem, "0").
f. If k is an abrupt completion, return ? IteratorClose(iteratorRecord, k).
features: [Symbol.iterator, Object.fromEntries]
---*/

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

@ -2,8 +2,24 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Closes iterators when toString on a key throws.
esid: sec-object.fromentries
description: Closes iterators when toString on a key throws.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
AddEntriesFromIterable ( target, iterable, adder )
...
4. Repeat,
...
e. Let k be Get(nextItem, "0").
f. If k is an abrupt completion, return ? IteratorClose(iteratorRecord, k).
features: [Symbol.iterator, Object.fromEntries]
---*/

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

@ -0,0 +1,66 @@
// Copyright (C) 2018 Kevin Gibbons. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-object.fromentries
description: Closes iterators when accessing an entry's value throws.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
AddEntriesFromIterable ( target, iterable, adder )
...
4. Repeat,
...
g. Let v be Get(nextItem, "1").
h. If v is an abrupt completion, return ? IteratorClose(iteratorRecord, v).
features: [Symbol.iterator, Object.fromEntries]
---*/
function DummyError() {}
var returned = false;
var iterable = {
[Symbol.iterator]: function() {
var advanced = false;
return {
next: function() {
if (advanced) {
throw new Test262Error('should only advance once');
}
advanced = true;
return {
done: false,
value: {
get '0'() {
return 'key';
},
get '1'() {
throw new DummyError();
},
},
};
},
return: function() {
if (returned) {
throw new Test262Error('should only return once');
}
returned = true;
},
};
},
};
assert.throws(DummyError, function() {
Object.fromEntries(iterable);
});
assert(returned, 'iterator should be closed when entry value property access throws');
reportCompare(0, 0);

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

@ -2,8 +2,33 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Does not close iterators with a `next` method which returns a non-object.
esid: sec-object.fromentries
description: Does not close iterators with a `next` method which returns a non-object.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
AddEntriesFromIterable ( target, iterable, adder )
...
4. Repeat,
a. Let next be ? IteratorStep(iteratorRecord).
IteratorStep ( iteratorRecord )
1. Let result be ? IteratorNext(iteratorRecord).
IteratorNext ( iteratorRecord [ , value ] )
...
3. If Type(result) is not Object, throw a TypeError exception.
features: [Symbol.iterator, Object.fromEntries]
---*/

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

@ -2,8 +2,33 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Does not close iterators with a `done` accessor which throws.
esid: sec-object.fromentries
description: Does not close iterators with a `done` accessor which throws.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
AddEntriesFromIterable ( target, iterable, adder )
...
4. Repeat,
a. Let next be ? IteratorStep(iteratorRecord).
IteratorStep ( iteratorRecord )
1. Let result be ? IteratorNext(iteratorRecord).
IteratorNext ( iteratorRecord [ , value ] )
...
3. If Type(result) is not Object, throw a TypeError exception.
features: [Symbol.iterator, Object.fromEntries]
---*/

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

@ -2,8 +2,33 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Does not close iterators with a `next` method which throws.
esid: sec-object.fromentries
description: Does not close iterators with a `next` method which throws.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
AddEntriesFromIterable ( target, iterable, adder )
...
4. Repeat,
a. Let next be ? IteratorStep(iteratorRecord).
IteratorStep ( iteratorRecord )
1. Let result be ? IteratorNext(iteratorRecord).
IteratorNext ( iteratorRecord [ , value ] )
...
3. If Type(result) is not Object, throw a TypeError exception.
features: [Symbol.iterator, Object.fromEntries]
---*/

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

@ -2,8 +2,26 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Does not close iterators with an uncallable `next` property.
esid: sec-object.fromentries
description: Does not close iterators with an uncallable `next` property.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
AddEntriesFromIterable ( target, iterable, adder )
...
4. Repeat,
a. Let next be ? IteratorStep(iteratorRecord).
IteratorStep ( iteratorRecord )
1. Let result be ? IteratorNext(iteratorRecord).
features: [Symbol.iterator, Object.fromEntries]
---*/

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

@ -8,10 +8,11 @@ includes: [propertyHelper.js]
features: [Object.fromEntries]
---*/
assert.sameValue(Object.fromEntries.length, 1);
verifyNotEnumerable(Object.fromEntries, "length");
verifyNotWritable(Object.fromEntries, "length");
verifyConfigurable(Object.fromEntries, "length");
verifyProperty(Object.fromEntries, "length", {
value: 1,
enumerable: false,
writable: false,
configurable: true
});
reportCompare(0, 0);

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

@ -8,10 +8,11 @@ includes: [propertyHelper.js]
features: [Object.fromEntries]
---*/
assert.sameValue(Object.fromEntries.name, "fromEntries");
verifyNotEnumerable(Object.fromEntries, "name");
verifyNotWritable(Object.fromEntries, "name");
verifyConfigurable(Object.fromEntries, "name");
verifyProperty(Object.fromEntries, "name", {
value: "fromEntries",
enumerable: false,
writable: false,
configurable: true
});
reportCompare(0, 0);

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

@ -2,8 +2,15 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Throws when called without an argument.
esid: sec-object.fromentries
description: Throws when called without an argument.
info: |
Object.fromEntries ( iterable )
1. Perform ? RequireObjectCoercible(iterable).
...
features: [Object.fromEntries]
---*/

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

@ -9,8 +9,10 @@ features: [Object.fromEntries]
---*/
var result = Object.fromEntries([['key', 'value']]);
verifyEnumerable(result, 'key');
verifyWritable(result, 'key');
verifyConfigurable(result, 'key');
verifyProperty(result, "key", {
enumerable: true,
writable: true,
configurable: true,
});
reportCompare(0, 0);

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

@ -0,0 +1,13 @@
// Copyright (C) 2018 Kevin Gibbons. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Succeeds when an entry object is a boxed string.
esid: sec-object.fromentries
features: [Object.fromEntries]
---*/
var result = Object.fromEntries([new String('ab')]);
assert.sameValue(result['a'], 'b');
reportCompare(0, 0);

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\d/ug;
const matchingRange = /[0-9]/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\d+/ug;
const matchingRange = /[0-9]+/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\d+/g;
const matchingRange = /[0-9]+/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\d/g;
const matchingRange = /[0-9]/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\D/ug;
const matchingRange = /[\0-\/:-\u{10FFFF}]/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\D+/ug;
const matchingRange = /[\0-\/:-\u{10FFFF}]+/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\D+/g;
const matchingRange = /[\0-\/:-\uFFFF]+/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\D/g;
const matchingRange = /[\0-\/:-\uFFFF]/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\S/ug;
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\u{10FFFF}]/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\S+/ug;
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\u{10FFFF}]+/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\S+/g;
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\uFFFF]+/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\S/g;
const matchingRange = /[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\uFFFF]/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\W/ug;
const matchingRange = /[\0-\/:-@\[-\^`\{-\u{10FFFF}]/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\W+/ug;
const matchingRange = /[\0-\/:-@\[-\^`\{-\u{10FFFF}]+/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\W+/g;
const matchingRange = /[\0-\/:-@\[-\^`\{-\uFFFF]+/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\W/g;
const matchingRange = /[\0-\/:-@\[-\^`\{-\uFFFF]/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\s/ug;
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\s+/ug;
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\s+/g;
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\s/g;
const matchingRange = /[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\w/ug;
const matchingRange = /[0-9A-Z_a-z]/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0x10ffff / 0x10000);
for (let codePoint = 0; codePoint < 0x10FFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0x10FFFF]]});
const re = /\w+/ug;
const matchingRange = /[0-9A-Z_a-z]+/ug;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\w+/g;
const matchingRange = /[0-9A-Z_a-z]+/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -33,15 +33,10 @@ info: |
The production CharacterClassEscape :: W evaluates as follows:
Return the set of all characters not included in the set returned by CharacterClassEscape :: w.
features: [String.fromCodePoint]
includes: [regExpUtils.js]
---*/
const chunks = [];
const totalChunks = Math.ceil(0xffff / 0x10000);
for (let codePoint = 0; codePoint < 0xFFFF; codePoint++) {
// split strings to avoid a super long one;
chunks[codePoint % totalChunks] += String.fromCodePoint(codePoint);
}
const str = buildString({loneCodePoints: [], ranges: [[0, 0xFFFF]]});
const re = /\w/g;
const matchingRange = /[0-9A-Z_a-z]/g;
@ -52,16 +47,14 @@ function matching(str) {
return str.replace(re, '') === str.replace(matchingRange, '');
}
for (const str of chunks) {
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
if (!matching(str)) {
// Error, let's find out where
for (const char of str) {
if (!matching(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
};
}
assert.sameValue(
errors.length,

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

@ -0,0 +1,58 @@
// file: regExpUtils.js
// Copyright (C) 2017 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: |
Collection of functions used to assert the correctness of RegExp objects.
---*/
function buildString({ loneCodePoints, ranges }) {
const CHUNK_SIZE = 10000;
let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
for (let i = 0; i < ranges.length; i++) {
const range = ranges[i];
const start = range[0];
const end = range[1];
const codePoints = [];
for (let length = 0, codePoint = start; codePoint <= end; codePoint++) {
codePoints[length++] = codePoint;
if (length === CHUNK_SIZE) {
result += Reflect.apply(String.fromCodePoint, null, codePoints);
codePoints.length = length = 0;
}
}
result += Reflect.apply(String.fromCodePoint, null, codePoints);
}
return result;
}
function testPropertyEscapes(regex, string, expression) {
if (!regex.test(string)) {
for (const symbol of string) {
const hex = symbol
.codePointAt(0)
.toString(16)
.toUpperCase()
.padStart(6, "0");
assert(
regex.test(symbol),
`\`${ expression }\` should match U+${ hex } (\`${ symbol }\`)`
);
}
}
}
// Returns a function that will validate RegExp match result
//
// Example:
//
// var validate = matchValidator(['b'], 1, 'abc');
// validate(/b/.exec('abc'));
//
function matchValidator(expectedEntries, expectedIndex, expectedInput) {
return function(match) {
assert.compareArray(match, expectedEntries, 'Match entries');
assert.sameValue(match.index, expectedIndex, 'Match index');
assert.sameValue(match.input, expectedInput, 'Match input');
}
}

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

@ -8,17 +8,20 @@ description: |
function buildString({ loneCodePoints, ranges }) {
const CHUNK_SIZE = 10000;
let result = String.fromCodePoint(...loneCodePoints);
for (const [start, end] of ranges) {
let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
for (let i = 0; i < ranges.length; i++) {
const range = ranges[i];
const start = range[0];
const end = range[1];
const codePoints = [];
for (let length = 0, codePoint = start; codePoint <= end; codePoint++) {
codePoints[length++] = codePoint;
if (length === CHUNK_SIZE) {
result += String.fromCodePoint(...codePoints);
result += Reflect.apply(String.fromCodePoint, null, codePoints);
codePoints.length = length = 0;
}
}
result += String.fromCodePoint(...codePoints);
result += Reflect.apply(String.fromCodePoint, null, codePoints);
}
return result;
}

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

@ -44,17 +44,20 @@ description: |
function buildString({ loneCodePoints, ranges }) {
const CHUNK_SIZE = 10000;
let result = String.fromCodePoint(...loneCodePoints);
for (const [start, end] of ranges) {
let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
for (let i = 0; i < ranges.length; i++) {
const range = ranges[i];
const start = range[0];
const end = range[1];
const codePoints = [];
for (let length = 0, codePoint = start; codePoint <= end; codePoint++) {
codePoints[length++] = codePoint;
if (length === CHUNK_SIZE) {
result += String.fromCodePoint(...codePoints);
result += Reflect.apply(String.fromCodePoint, null, codePoints);
codePoints.length = length = 0;
}
}
result += String.fromCodePoint(...codePoints);
result += Reflect.apply(String.fromCodePoint, null, codePoints);
}
return result;
}

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

@ -44,17 +44,20 @@ description: |
function buildString({ loneCodePoints, ranges }) {
const CHUNK_SIZE = 10000;
let result = String.fromCodePoint(...loneCodePoints);
for (const [start, end] of ranges) {
let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
for (let i = 0; i < ranges.length; i++) {
const range = ranges[i];
const start = range[0];
const end = range[1];
const codePoints = [];
for (let length = 0, codePoint = start; codePoint <= end; codePoint++) {
codePoints[length++] = codePoint;
if (length === CHUNK_SIZE) {
result += String.fromCodePoint(...codePoints);
result += Reflect.apply(String.fromCodePoint, null, codePoints);
codePoints.length = length = 0;
}
}
result += String.fromCodePoint(...codePoints);
result += Reflect.apply(String.fromCodePoint, null, codePoints);
}
return result;
}

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

@ -44,17 +44,20 @@ description: |
function buildString({ loneCodePoints, ranges }) {
const CHUNK_SIZE = 10000;
let result = String.fromCodePoint(...loneCodePoints);
for (const [start, end] of ranges) {
let result = Reflect.apply(String.fromCodePoint, null, loneCodePoints);
for (let i = 0; i < ranges.length; i++) {
const range = ranges[i];
const start = range[0];
const end = range[1];
const codePoints = [];
for (let length = 0, codePoint = start; codePoint <= end; codePoint++) {
codePoints[length++] = codePoint;
if (length === CHUNK_SIZE) {
result += String.fromCodePoint(...codePoints);
result += Reflect.apply(String.fromCodePoint, null, codePoints);
codePoints.length = length = 0;
}
}
result += String.fromCodePoint(...codePoints);
result += Reflect.apply(String.fromCodePoint, null, codePoints);
}
return result;
}

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

@ -0,0 +1,37 @@
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.RelativeTimeFormat
description: Checks handling of non-object option arguments to the RelativeTimeFormat constructor.
info: |
InitializeRelativeTimeFormat (relativeTimeFormat, locales, options)
features: [Intl.RelativeTimeFormat]
---*/
Object.defineProperties(Object.prototype, {
"style": {
value: "short",
},
"numeric": {
value: "auto",
},
})
const optionsArguments = [
true,
"test",
7,
Symbol(),
];
for (const options of optionsArguments) {
const rtf = new Intl.RelativeTimeFormat([], options);
const resolvedOptions = rtf.resolvedOptions();
assert.sameValue(resolvedOptions.style, "short",
`options argument ${String(options)} should yield the correct value for "style"`);
assert.sameValue(resolvedOptions.numeric, "auto",
`options argument ${String(options)} should yield the correct value for "numeric"`);
}
reportCompare(0, 0);

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

@ -0,0 +1,28 @@
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.RelativeTimeFormat
description: Checks handling of non-object option arguments to the RelativeTimeFormat constructor.
info: |
InitializeRelativeTimeFormat (relativeTimeFormat, locales, options)
features: [Intl.RelativeTimeFormat]
---*/
const optionsArguments = [
true,
"test",
7,
Symbol(),
];
for (const options of optionsArguments) {
const rtf = new Intl.RelativeTimeFormat([], options);
const resolvedOptions = rtf.resolvedOptions();
assert.sameValue(resolvedOptions.style, "long",
`options argument ${String(options)} should yield the correct value for "style"`);
assert.sameValue(resolvedOptions.numeric, "always",
`options argument ${String(options)} should yield the correct value for "numeric"`);
}
reportCompare(0, 0);

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

@ -0,0 +1,40 @@
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.RelativeTimeFormat
description: Checks handling of non-object option arguments to the RelativeTimeFormat constructor.
info: |
InitializeRelativeTimeFormat (relativeTimeFormat, locales, options)
features: [Intl.RelativeTimeFormat]
---*/
Object.defineProperties(Object.prototype, {
"style": {
get() {
throw new Error("Should not call style getter");
}
},
"numeric": {
get() {
throw new Error("Should not call numeric getter");
}
},
})
const optionsArguments = [
[],
[[]],
[[], undefined],
];
for (const args of optionsArguments) {
const rtf = new Intl.RelativeTimeFormat(...args);
const resolvedOptions = rtf.resolvedOptions();
assert.sameValue(resolvedOptions.style, "long",
`Calling with ${args.length} empty arguments should yield the correct value for "style"`);
assert.sameValue(resolvedOptions.numeric, "always",
`Calling with ${args.length} empty arguments should yield the correct value for "numeric"`);
}
reportCompare(0, 0);

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

@ -0,0 +1,22 @@
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.RelativeTimeFormat.supportedLocalesOf
description: Checks error cases for the locales argument to the supportedLocalesOf function.
info: |
Intl.RelativeTimeFormat.supportedLocalesOf ( locales [, options ])
2. Let requestedLocales be CanonicalizeLocaleList(locales).
includes: [testIntl.js]
features: [Intl.RelativeTimeFormat]
---*/
assert.sameValue(typeof Intl.RelativeTimeFormat.supportedLocalesOf, "function",
"Should support Intl.RelativeTimeFormat.supportedLocalesOf.");
for (const [locales, expectedError] of getInvalidLocaleArguments()) {
assert.throws(expectedError, () => Intl.RelativeTimeFormat.supportedLocalesOf(locales));
}
reportCompare(0, 0);

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

@ -0,0 +1,36 @@
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.RelativeTimeFormat.supportedLocalesOf
description: Checks handling of invalid values for the localeMatcher option to the supportedLocalesOf function.
info: |
SupportedLocales ( availableLocales, requestedLocales, options )
1. If options is not undefined, then
b. Let matcher be ? GetOption(options, "localeMatcher", "string", «"lookup", "best fit"», "best fit").
features: [Intl.RelativeTimeFormat]
---*/
assert.sameValue(typeof Intl.RelativeTimeFormat.supportedLocalesOf, "function",
"Should support Intl.RelativeTimeFormat.supportedLocalesOf.");
const invalidOptions = [
null,
1,
"",
"Lookup",
"LOOKUP",
"lookup\0",
"Best fit",
"BEST FIT",
"best\u00a0fit",
];
for (const invalidOption of invalidOptions) {
assert.throws(RangeError, function() {
Intl.RelativeTimeFormat.supportedLocalesOf([], {"localeMatcher": invalidOption});
}, `${invalidOption} is an invalid localeMatcher option value`);
}
reportCompare(0, 0);

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

@ -0,0 +1,22 @@
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.RelativeTimeFormat.supportedLocalesOf
description: Checks handling of a null options argument to the supportedLocalesOf function.
info: |
SupportedLocales ( availableLocales, requestedLocales, options )
1. If options is not undefined, then
a. Let options be ? ToObject(options).
features: [Intl.RelativeTimeFormat]
---*/
assert.sameValue(typeof Intl.RelativeTimeFormat.supportedLocalesOf, "function",
"Should support Intl.RelativeTimeFormat.supportedLocalesOf.");
assert.throws(TypeError, function() {
Intl.RelativeTimeFormat.supportedLocalesOf([], null);
}, "Should throw when passing null as the options argument");
reportCompare(0, 0);

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

@ -0,0 +1,43 @@
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.RelativeTimeFormat.supportedLocalesOf
description: Checks handling of non-object options arguments to the supportedLocalesOf function.
info: |
SupportedLocales ( availableLocales, requestedLocales, options )
1. If options is not undefined, then
a. Let options be ? ToObject(options).
features: [Intl.RelativeTimeFormat]
---*/
assert.sameValue(typeof Intl.RelativeTimeFormat.supportedLocalesOf, "function",
"Should support Intl.RelativeTimeFormat.supportedLocalesOf.");
let called;
Object.defineProperties(Object.prototype, {
"localeMatcher": {
get() {
++called;
return "best fit";
}
}
});
const optionsArguments = [
true,
"test",
7,
Symbol(),
];
for (const options of optionsArguments) {
called = 0;
const result = Intl.RelativeTimeFormat.supportedLocalesOf([], options);
assert.sameValue(Array.isArray(result), true, `Expected array from ${String(options)}`);
assert.sameValue(called, 1, `Expected one call from ${String(options)}`);
}
reportCompare(0, 0);

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

@ -0,0 +1,28 @@
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.RelativeTimeFormat.supportedLocalesOf
description: Checks handling of an undefined options argument to the supportedLocalesOf function.
info: |
SupportedLocales ( availableLocales, requestedLocales, options )
1. If options is not undefined, then
b. Let matcher be ? GetOption(options, "localeMatcher", "string", «"lookup", "best fit"», "best fit").
features: [Intl.RelativeTimeFormat]
---*/
assert.sameValue(typeof Intl.RelativeTimeFormat.supportedLocalesOf, "function",
"Should support Intl.RelativeTimeFormat.supportedLocalesOf.");
Object.defineProperties(Object.prototype, {
"localeMatcher": {
get() { throw new Error("Should not call localeMatcher getter"); }
}
});
assert.sameValue(Array.isArray(Intl.RelativeTimeFormat.supportedLocalesOf()), true, "No arguments");
assert.sameValue(Array.isArray(Intl.RelativeTimeFormat.supportedLocalesOf([])), true, "One argument");
assert.sameValue(Array.isArray(Intl.RelativeTimeFormat.supportedLocalesOf([], undefined)), true, "Two arguments");
reportCompare(0, 0);

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

@ -30,6 +30,11 @@ const exceptions = {
"0": "this year",
"1": "next year",
},
"quarter": {
"-1": "last quarter",
"0": "this quarter",
"1": "next quarter",
},
"month": {
"-1": "last month",
"0": "this month",

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

@ -9,14 +9,14 @@ locale: [en-US]
---*/
const units = {
"second": "sec.",
"minute": "min.",
"hour": "hr.",
"day": undefined,
"week": "wk.",
"month": "mo.",
"quarter": "qtr.",
"year": "yr.",
"second": ["sec."],
"minute": ["min."],
"hour": ["hr."],
"day": ["day", "days"],
"week": ["wk."],
"month": ["mo."],
"quarter": ["qtr.", "qtrs."],
"year": ["yr."],
};
const rtf = new Intl.RelativeTimeFormat("en-US", {
@ -25,9 +25,8 @@ const rtf = new Intl.RelativeTimeFormat("en-US", {
assert.sameValue(typeof rtf.format, "function", "format should be supported");
for (const [unitArgument, unitString] of Object.entries(units)) {
const singular = unitString || `${unitArgument}`;
const plural = unitString || `${unitArgument}s`;
for (const [unitArgument, unitStrings] of Object.entries(units)) {
const [singular, plural = singular] = unitStrings;
assert.sameValue(rtf.format(1000, unitArgument), `in 1,000 ${plural}`);
assert.sameValue(rtf.format(10, unitArgument), `in 10 ${plural}`);
assert.sameValue(rtf.format(2, unitArgument), `in 2 ${plural}`);

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

@ -18,9 +18,9 @@ function always(s) {
// https://www.unicode.org/cldr/charts/33/summary/pl.html#1419
const units = {
"second": always("s"),
"second": always("sek."),
"minute": always("min"),
"hour": always("g."),
"hour": always("godz."),
"day": {
"many": "dni",
"few": "dni",

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

@ -26,6 +26,11 @@ function expected(key, unit, default_) {
"0": "this year",
"1": "next year",
},
"quarter": {
"-1": "last quarter",
"0": "this quarter",
"1": "next quarter",
},
"month": {
"-1": "last month",
"0": "this month",

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

@ -19,14 +19,14 @@ function verifyFormatParts(actual, expected, message) {
}
const units = {
"second": "sec.",
"minute": "min.",
"hour": "hr.",
"day": undefined,
"week": "wk.",
"month": "mo.",
"quarter": "qtr.",
"year": "yr.",
"second": ["sec."],
"minute": ["min."],
"hour": ["hr."],
"day": ["day", "days"],
"week": ["wk."],
"month": ["mo."],
"quarter": ["qtr.", "qtrs."],
"year": ["yr."],
};
const rtf = new Intl.RelativeTimeFormat("en-US", {
@ -35,9 +35,8 @@ const rtf = new Intl.RelativeTimeFormat("en-US", {
assert.sameValue(typeof rtf.formatToParts, "function", "formatToParts should be supported");
for (const [unitArgument, unitString] of Object.entries(units)) {
const singular = unitString || `${unitArgument}`;
const plural = unitString || `${unitArgument}s`;
for (const [unitArgument, unitStrings] of Object.entries(units)) {
const [singular, plural = singular] = unitStrings;
verifyFormatParts(rtf.formatToParts(1000, unitArgument), [
{ "type": "literal", "value": "in " },

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

@ -28,9 +28,9 @@ function always(s) {
// https://www.unicode.org/cldr/charts/33/summary/pl.html#1419
const units = {
"second": always("sek."),
"second": always("s"),
"minute": always("min"),
"hour": always("godz."),
"hour": always("g."),
"day": {
"many": "dni",
"few": "dni",
@ -51,7 +51,7 @@ const units = {
};
const rtf = new Intl.RelativeTimeFormat("pl-PL", {
"style": "short",
"style": "narrow",
});
assert.sameValue(typeof rtf.formatToParts, "function", "formatToParts should be supported");

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

@ -69,6 +69,7 @@ class AutoHeapSession;
} // namespace js
struct DtoaState;
struct JSLocaleCallbacks;
#ifdef JS_SIMULATOR_ARM64
namespace vixl {

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

@ -6,9 +6,8 @@
#include "mozilla/Assertions.h"
#include "jsapi.h"
#include "js/LocaleSensitive.h"
#include "nsJSUtils.h"
#include "nsIObserver.h"
#include "nsComponentManagerUtils.h"
#include "nsServiceManagerUtils.h"
@ -18,7 +17,6 @@
#include "xpcpublic.h"
using namespace JS;
using namespace mozilla;
using mozilla::intl::LocaleService;

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

@ -1016,7 +1016,7 @@ case "$target" in
# Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib"
MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
MOZ_DEBUG_LDFLAGS='-DEBUG'
WARNINGS_AS_ERRORS='-WX'
# Use a higher optimization level for clang-cl, so we can come closer
# to MSVC's performance numbers (see bug 1443590).
@ -1026,11 +1026,10 @@ case "$target" in
MOZ_OPTIMIZE_FLAGS='-O1 -Oi'
fi
MOZ_FIX_LINK_PATHS=
LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
if test -z "$DEVELOPER_OPTIONS"; then
LDFLAGS="$LDFLAGS -RELEASE"
fi
LDFLAGS="$LDFLAGS -DYNAMICBASE"
RCFLAGS="-nologo"
dnl Minimum reqiurement of Gecko is VS2015 or later which supports
dnl both SSSE3 and SSE4.1.

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

@ -1 +1 @@
6349fa699c3b
d3f512d4f76e

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

@ -3799,7 +3799,7 @@ SECU_ParseSSLVersionRangeString(const char *input,
return SECSuccess;
}
SSLNamedGroup
static SSLNamedGroup
groupNameToNamedGroup(char *name)
{
if (PL_strlen(name) == 4) {
@ -3837,6 +3837,23 @@ groupNameToNamedGroup(char *name)
return ssl_grp_none;
}
static SECStatus
countItems(const char *arg, unsigned int *numItems)
{
char *str = PORT_Strdup(arg);
if (!str) {
return SECFailure;
}
char *p = strtok(str, ",");
while (p) {
++(*numItems);
p = strtok(NULL, ",");
}
PORT_Free(str);
str = NULL;
return SECSuccess;
}
SECStatus
parseGroupList(const char *arg, SSLNamedGroup **enabledGroups,
unsigned int *enabledGroupsCount)
@ -3847,21 +3864,12 @@ parseGroupList(const char *arg, SSLNamedGroup **enabledGroups,
unsigned int numValues = 0;
unsigned int count = 0;
/* Count the number of groups. */
str = PORT_Strdup(arg);
if (!str) {
if (countItems(arg, &numValues) != SECSuccess) {
return SECFailure;
}
p = strtok(str, ",");
while (p) {
++numValues;
p = strtok(NULL, ",");
}
PORT_Free(str);
str = NULL;
groups = PORT_ZNewArray(SSLNamedGroup, numValues);
if (!groups) {
goto done;
return SECFailure;
}
/* Get group names. */
@ -3881,9 +3889,7 @@ parseGroupList(const char *arg, SSLNamedGroup **enabledGroups,
}
done:
if (str) {
PORT_Free(str);
}
PORT_Free(str);
if (!count) {
PORT_Free(groups);
return SECFailure;
@ -3893,3 +3899,83 @@ done:
*enabledGroups = groups;
return SECSuccess;
}
SSLSignatureScheme
schemeNameToScheme(const char *name)
{
#define compareScheme(x) \
do { \
if (!PORT_Strncmp(name, #x, PORT_Strlen(#x))) { \
return ssl_sig_##x; \
} \
} while (0)
compareScheme(rsa_pkcs1_sha1);
compareScheme(rsa_pkcs1_sha256);
compareScheme(rsa_pkcs1_sha384);
compareScheme(rsa_pkcs1_sha512);
compareScheme(ecdsa_sha1);
compareScheme(ecdsa_secp256r1_sha256);
compareScheme(ecdsa_secp384r1_sha384);
compareScheme(ecdsa_secp521r1_sha512);
compareScheme(rsa_pss_rsae_sha256);
compareScheme(rsa_pss_rsae_sha384);
compareScheme(rsa_pss_rsae_sha512);
compareScheme(ed25519);
compareScheme(ed448);
compareScheme(rsa_pss_pss_sha256);
compareScheme(rsa_pss_pss_sha384);
compareScheme(rsa_pss_pss_sha512);
compareScheme(dsa_sha1);
compareScheme(dsa_sha256);
compareScheme(dsa_sha384);
compareScheme(dsa_sha512);
#undef compareScheme
return ssl_sig_none;
}
SECStatus
parseSigSchemeList(const char *arg, const SSLSignatureScheme **enabledSigSchemes,
unsigned int *enabledSigSchemeCount)
{
SSLSignatureScheme *schemes;
unsigned int numValues = 0;
unsigned int count = 0;
if (countItems(arg, &numValues) != SECSuccess) {
return SECFailure;
}
schemes = PORT_ZNewArray(SSLSignatureScheme, numValues);
if (!schemes) {
return SECFailure;
}
/* Get group names. */
char *str = PORT_Strdup(arg);
if (!str) {
goto done;
}
char *p = strtok(str, ",");
while (p) {
SSLSignatureScheme scheme = schemeNameToScheme(p);
if (scheme == ssl_sig_none) {
count = 0;
goto done;
}
schemes[count++] = scheme;
p = strtok(NULL, ",");
}
done:
PORT_Free(str);
if (!count) {
PORT_Free(schemes);
return SECFailure;
}
*enabledSigSchemeCount = count;
*enabledSigSchemes = schemes;
return SECSuccess;
}

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

@ -406,7 +406,9 @@ SECU_ParseSSLVersionRangeString(const char *input,
SECStatus parseGroupList(const char *arg, SSLNamedGroup **enabledGroups,
unsigned int *enabledGroupsCount);
SSLNamedGroup groupNameToNamedGroup(char *name);
SECStatus parseSigSchemeList(const char *arg,
const SSLSignatureScheme **enabledSigSchemes,
unsigned int *enabledSigSchemeCount);
/*
*

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

@ -165,9 +165,8 @@ PrintUsageHeader(const char *progName)
" [-f password_file] [-L [seconds]] [-M maxProcs] [-P dbprefix]\n"
" [-V [min-version]:[max-version]] [-a sni_name]\n"
" [ T <good|revoked|unknown|badsig|corrupted|none|ocsp>] [-A ca]\n"
" [-C SSLCacheEntries] [-S dsa_nickname] -Q [-I groups]"
" [-e ec_nickname]"
"\n"
" [-C SSLCacheEntries] [-S dsa_nickname] [-Q]\n"
" [-I groups] [-J signatureschemes] [-e ec_nickname]\n"
" -U [0|1] -H [0|1|2] -W [0|1]\n"
"\n",
progName);
@ -195,7 +194,6 @@ PrintParameterUsage()
"-s means disable SSL socket locking for performance\n"
"-u means enable Session Ticket extension for TLS.\n"
"-v means verbose output\n"
"-z means enable compression.\n"
"-L seconds means log statistics every 'seconds' seconds (default=30).\n"
"-M maxProcs tells how many processes to run in a multi-process server\n"
"-N means do NOT use the server session cache. Incompatible with -M.\n"
@ -228,6 +226,13 @@ PrintParameterUsage()
"-I comma separated list of enabled groups for TLS key exchange.\n"
" The following values are valid:\n"
" P256, P384, P521, x25519, FF2048, FF3072, FF4096, FF6144, FF8192\n"
"-J comma separated list of enabled signature schemes in preference order.\n"
" The following values are valid:\n"
" rsa_pkcs1_sha1, rsa_pkcs1_sha256, rsa_pkcs1_sha384, rsa_pkcs1_sha512,\n"
" ecdsa_sha1, ecdsa_secp256r1_sha256, ecdsa_secp384r1_sha384,\n"
" ecdsa_secp521r1_sha512,\n"
" rsa_pss_rsae_sha256, rsa_pss_rsae_sha384, rsa_pss_rsae_sha512,\n"
" rsa_pss_pss_sha256, rsa_pss_pss_sha384, rsa_pss_pss_sha512,\n"
"-Z enable 0-RTT (for TLS 1.3; also use -u)\n",
stderr);
}
@ -795,13 +800,14 @@ PRBool NoReuse = PR_FALSE;
PRBool hasSidCache = PR_FALSE;
PRBool disableLocking = PR_FALSE;
PRBool enableSessionTickets = PR_FALSE;
PRBool enableCompression = PR_FALSE;
PRBool failedToNegotiateName = PR_FALSE;
PRBool enableExtendedMasterSecret = PR_FALSE;
PRBool zeroRTT = PR_FALSE;
PRBool enableALPN = PR_FALSE;
SSLNamedGroup *enabledGroups = NULL;
unsigned int enabledGroupsCount = 0;
const SSLSignatureScheme *enabledSigSchemes = NULL;
unsigned int enabledSigSchemeCount = 0;
static char *virtServerNameArray[MAX_VIRT_SERVER_NAME_ARRAY_INDEX];
static int virtServerNameIndex = 1;
@ -1857,13 +1863,6 @@ server_main(
}
}
if (enableCompression) {
rv = SSL_OptionSet(model_sock, SSL_ENABLE_DEFLATE, PR_TRUE);
if (rv != SECSuccess) {
errExit("error enabling compression ");
}
}
if (virtServerNameIndex > 1) {
rv = SSL_SNISocketConfigHook(model_sock, mySSLSNISocketConfig,
(void *)&virtServerNameArray);
@ -1970,6 +1969,13 @@ server_main(
}
}
if (enabledSigSchemes) {
rv = SSL_SignatureSchemePrefSet(model_sock, enabledSigSchemes, enabledSigSchemeCount);
if (rv < 0) {
errExit("SSL_SignatureSchemePrefSet failed");
}
}
/* This cipher is not on by default. The Acceptance test
* would like it to be. Turn this cipher on.
*/
@ -2214,9 +2220,10 @@ main(int argc, char **argv)
/* please keep this list of options in ASCII collating sequence.
** numbers, then capital letters, then lower case, alphabetical.
** XXX: 'B', 'E', 'q', and 'x' were used in the past but removed
** in 3.28, please leave some time before resuing those. */
** in 3.28, please leave some time before resuing those.
** 'z' was removed in 3.39. */
optstate = PL_CreateOptState(argc, argv,
"2:A:C:DGH:I:L:M:NP:QRS:T:U:V:W:YZa:bc:d:e:f:g:hi:jk:lmn:op:rst:uvw:yz");
"2:A:C:DGH:I:J:L:M:NP:QRS:T:U:V:W:YZa:bc:d:e:f:g:hi:jk:lmn:op:rst:uvw:y");
while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
++optionsFound;
switch (optstate->option) {
@ -2429,10 +2436,6 @@ main(int argc, char **argv)
debugCache = PR_TRUE;
break;
case 'z':
enableCompression = PR_TRUE;
break;
case 'Z':
zeroRTT = PR_TRUE;
break;
@ -2451,6 +2454,16 @@ main(int argc, char **argv)
}
break;
case 'J':
rv = parseSigSchemeList(optstate->value, &enabledSigSchemes, &enabledSigSchemeCount);
if (rv != SECSuccess) {
PL_DestroyOptState(optstate);
fprintf(stderr, "Bad signature scheme specified.\n");
fprintf(stderr, "Run '%s -h' for usage information.\n", progName);
exit(5);
}
break;
default:
case '?':
fprintf(stderr, "Unrecognized or bad option specified.\n");

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

@ -106,6 +106,45 @@ secuPWData pwdata = { PW_NONE, 0 };
SSLNamedGroup *enabledGroups = NULL;
unsigned int enabledGroupsCount = 0;
const SSLSignatureScheme *enabledSigSchemes = NULL;
unsigned int enabledSigSchemeCount = 0;
const char *
signatureSchemeName(SSLSignatureScheme scheme)
{
switch (scheme) {
#define strcase(x) \
case ssl_sig_##x: \
return #x
strcase(none);
strcase(rsa_pkcs1_sha1);
strcase(rsa_pkcs1_sha256);
strcase(rsa_pkcs1_sha384);
strcase(rsa_pkcs1_sha512);
strcase(ecdsa_sha1);
strcase(ecdsa_secp256r1_sha256);
strcase(ecdsa_secp384r1_sha384);
strcase(ecdsa_secp521r1_sha512);
strcase(rsa_pss_rsae_sha256);
strcase(rsa_pss_rsae_sha384);
strcase(rsa_pss_rsae_sha512);
strcase(ed25519);
strcase(ed448);
strcase(rsa_pss_pss_sha256);
strcase(rsa_pss_pss_sha384);
strcase(rsa_pss_pss_sha512);
strcase(dsa_sha1);
strcase(dsa_sha256);
strcase(dsa_sha384);
strcase(dsa_sha512);
#undef strcase
case ssl_sig_rsa_pkcs1_sha1md5:
return "RSA PKCS#1 SHA1+MD5";
default:
break;
}
return "Unknown Scheme";
}
void
printSecurityInfo(PRFileDesc *fd)
@ -132,11 +171,13 @@ printSecurityInfo(PRFileDesc *fd)
suite.macBits, suite.macAlgorithmName);
FPRINTF(stderr,
"tstclnt: Server Auth: %d-bit %s, Key Exchange: %d-bit %s\n"
" Compression: %s, Extended Master Secret: %s\n",
" Compression: %s, Extended Master Secret: %s\n"
" Signature Scheme: %s\n",
channel.authKeyBits, suite.authAlgorithmName,
channel.keaKeyBits, suite.keaTypeName,
channel.compressionMethodName,
channel.extendedMasterSecretUsed ? "Yes" : "No");
channel.extendedMasterSecretUsed ? "Yes" : "No",
signatureSchemeName(channel.signatureScheme));
}
}
cert = SSL_RevealCert(fd);
@ -178,11 +219,12 @@ PrintUsageHeader()
{
fprintf(stderr,
"Usage: %s -h host [-a 1st_hs_name ] [-a 2nd_hs_name ] [-p port]\n"
"[-D | -d certdir] [-C] [-b | -R root-module] \n"
"[-n nickname] [-Bafosvx] [-c ciphers] [-Y] [-Z]\n"
"[-V [min-version]:[max-version]] [-K] [-T] [-U]\n"
"[-r N] [-w passwd] [-W pwfile] [-q [-t seconds]] [-I groups]\n"
"[-A requestfile] [-L totalconnections] [-P {client,server}] [-Q]\n"
" [-D | -d certdir] [-C] [-b | -R root-module] \n"
" [-n nickname] [-Bafosvx] [-c ciphers] [-Y] [-Z]\n"
" [-V [min-version]:[max-version]] [-K] [-T] [-U]\n"
" [-r N] [-w passwd] [-W pwfile] [-q [-t seconds]]\n"
" [-I groups] [-J signatureschemes]\n"
" [-A requestfile] [-L totalconnections] [-P {client,server}] [-Q]\n"
"\n",
progName);
}
@ -225,7 +267,6 @@ PrintParameterUsage()
fprintf(stderr, "%-20s Timeout for server ping (default: no timeout).\n", "-t seconds");
fprintf(stderr, "%-20s Renegotiate N times (resuming session if N>1).\n", "-r N");
fprintf(stderr, "%-20s Enable the session ticket extension.\n", "-u");
fprintf(stderr, "%-20s Enable compression.\n", "-z");
fprintf(stderr, "%-20s Enable false start.\n", "-g");
fprintf(stderr, "%-20s Enable the cert_status extension (OCSP stapling).\n", "-T");
fprintf(stderr, "%-20s Enable the signed_certificate_timestamp extension.\n", "-U");
@ -255,6 +296,15 @@ PrintParameterUsage()
"%-20s The following values are valid:\n"
"%-20s P256, P384, P521, x25519, FF2048, FF3072, FF4096, FF6144, FF8192\n",
"-I", "", "");
fprintf(stderr, "%-20s Comma separated list of signature schemes in preference order.\n"
"%-20s The following values are valid:\n"
"%-20s rsa_pkcs1_sha1, rsa_pkcs1_sha256, rsa_pkcs1_sha384, rsa_pkcs1_sha512,\n"
"%-20s ecdsa_sha1, ecdsa_secp256r1_sha256, ecdsa_secp384r1_sha384,\n"
"%-20s ecdsa_secp521r1_sha512,\n"
"%-20s rsa_pss_rsae_sha256, rsa_pss_rsae_sha384, rsa_pss_rsae_sha512,\n"
"%-20s rsa_pss_pss_sha256, rsa_pss_pss_sha384, rsa_pss_pss_sha512,\n"
"%-20s dsa_sha1, dsa_sha256, dsa_sha384, dsa_sha512\n",
"-J", "", "", "", "", "", "", "");
fprintf(stderr, "%-20s Enable alternative TLS 1.3 handshake\n", "-X alt-server-hello");
fprintf(stderr, "%-20s Use DTLS\n", "-P {client, server}");
fprintf(stderr, "%-20s Exit after handshake\n", "-Q");
@ -906,7 +956,6 @@ int multiplier = 0;
SSLVersionRange enabledVersions;
int disableLocking = 0;
int enableSessionTickets = 0;
int enableCompression = 0;
int enableFalseStart = 0;
int enableCertStatus = 0;
int enableSignedCertTimestamps = 0;
@ -1283,14 +1332,6 @@ run()
goto done;
}
/* enable compression. */
rv = SSL_OptionSet(s, SSL_ENABLE_DEFLATE, enableCompression);
if (rv != SECSuccess) {
SECU_PrintError(progName, "error enabling compression");
error = 1;
goto done;
}
/* enable false start. */
rv = SSL_OptionSet(s, SSL_ENABLE_FALSE_START, enableFalseStart);
if (rv != SECSuccess) {
@ -1374,6 +1415,15 @@ run()
}
}
if (enabledSigSchemes) {
rv = SSL_SignatureSchemePrefSet(s, enabledSigSchemes, enabledSigSchemeCount);
if (rv < 0) {
SECU_PrintError(progName, "SSL_SignatureSchemePrefSet failed");
error = 1;
goto done;
}
}
serverCertAuth.dbHandle = CERT_GetDefaultCertDB();
SSL_AuthCertificateHook(s, ownAuthCertificate, &serverCertAuth);
@ -1628,10 +1678,12 @@ main(int argc, char **argv)
}
}
/* XXX: 'B' was used in the past but removed in 3.28,
* please leave some time before resuing it. */
/* Note: 'B' was used in the past but removed in 3.28
* 'z' was removed in 3.39
* Please leave some time before reusing these.
*/
optstate = PL_CreateOptState(argc, argv,
"46A:CDFGHI:KL:M:OP:QR:STUV:W:X:YZa:bc:d:fgh:m:n:op:qr:st:uvw:z");
"46A:CDFGHI:J:KL:M:OP:QR:STUV:W:X:YZa:bc:d:fgh:m:n:op:qr:st:uvw:");
while ((optstatus = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
switch (optstate->option) {
case '?':
@ -1850,10 +1902,6 @@ main(int argc, char **argv)
pwdata.data = PORT_Strdup(optstate->value);
break;
case 'z':
enableCompression = 1;
break;
case 'I':
rv = parseGroupList(optstate->value, &enabledGroups, &enabledGroupsCount);
if (rv != SECSuccess) {
@ -1862,6 +1910,15 @@ main(int argc, char **argv)
Usage();
}
break;
case 'J':
rv = parseSigSchemeList(optstate->value, &enabledSigSchemes, &enabledSigSchemeCount);
if (rv != SECSuccess) {
PL_DestroyOptState(optstate);
fprintf(stderr, "Bad signature scheme specified.\n");
Usage();
}
break;
}
}
PL_DestroyOptState(optstate);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше