• Daniel Clark's avatar
    Sort import assertions by code point order of the keys · 73f8a710
    Daniel Clark authored
    Per https://tc39.es/proposal-import-assertions/#sec-assert-clause-to-assertions,
    import assertions should be sorted by the import assertion [[Key]]s,
    in order to prevent hosts from relying on a changing order of the
    assertions to determine behavior.
    
    Prior to this change, the assertions were being sorted by pointer. With
    this CL, the keys are sorted using a code point ordering so that the
    order of the assertions received by the host will be stable and
    non-surprising.
    
    This CL also switches the SourceTextModuleDescriptor's ModuleRequestMap,
    RegularExportMap, and RegularImportMap to use the code point order
    comparison rather than their former shortlex sort.  This change will not
    be externally visible, but it seems best to make these consistent.
    
    In order to avoid #including the fairly large ast-value-factory.h
    into ast/modules.h, I changed ImportAssertions into a separate class
    definition rather than keeping it as a typedef.  The alternative would
    be to define a common AstRawStringComparer in ast-value-factory.h and
    then #include ast-value-factory.h in both ast/modules.h and
    parsing/parser.h so that the ImportAssertions typedef would have a
    full, shared definition of the AstRawStringComparer type.
    
    Bug: v8:10958
    Change-Id: I29c9544aa0a4340c56e1ee631be6cabb2a2eb921
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2533038
    Commit-Queue: Dan Clark <daniec@microsoft.com>
    Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#71165}
    73f8a710
Name
Last commit
Last update
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.flake8 Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
ENG_REVIEW_OWNERS Loading commit data...
INFRA_OWNERS Loading commit data...
INTL_OWNERS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
MIPS_OWNERS Loading commit data...
OWNERS Loading commit data...
PPC_OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...