• 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
..
api Loading commit data...
asmjs Loading commit data...
ast Loading commit data...
base Loading commit data...
builtins Loading commit data...
codegen Loading commit data...
common Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
d8 Loading commit data...
date Loading commit data...
debug Loading commit data...
deoptimizer Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
extensions Loading commit data...
flags Loading commit data...
handles Loading commit data...
heap Loading commit data...
ic Loading commit data...
init Loading commit data...
inspector Loading commit data...
interpreter Loading commit data...
json Loading commit data...
libplatform Loading commit data...
libsampler Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parsing Loading commit data...
profiler Loading commit data...
protobuf Loading commit data...
regexp Loading commit data...
roots Loading commit data...
runtime Loading commit data...
sanitizer Loading commit data...
snapshot Loading commit data...
strings Loading commit data...
tasks Loading commit data...
third_party Loading commit data...
torque Loading commit data...
tracing Loading commit data...
trap-handler Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
OWNERS Loading commit data...