• vogelheim's avatar
    Fix NativesCollection<.>::GetScriptName in natives-external.cc · 881a921b
    vogelheim authored
    As there's no associated bug, here's the issue:
    - Some ES6 functionality in Chrome is presently broken; this fixes it.
    - The natives (built-in libraries) can be accessed by their 'name'.
      This is used to active ES6 flags.
    - Strangely enough, there's an id and a name, where the name is derived
      from the id as "native %s.js", with %s for the id.
    - NativesCollection<.>::GetScriptName uses the name.
    - NativesCollection<.>::GetIndex uses the id.
    - Example:
      NativesCollection<EXPERIMENTAL>::GetIndex("harmony-string") -> 3
      NativesCollection<EXPERIMENTAL>::GetScriptName(3) -> "native harmony-string.js"
    - Nobody knows why; it's quite mysterious.
    - When introducing the "external startup data", I didn't fully understand this
      and used the id in both places.
    - When the "external startup data" was turned on in Chrome, ES6 features broke
      in Chrome since the libraries could no longer be found.
    - This CL fixes this and makes the external startup data behave just like the
      built-in version.
    
    R=dslomov
    BUG=
    
    Review URL: https://codereview.chromium.org/774613003
    
    Cr-Commit-Position: refs/heads/master@{#25624}
    881a921b
bootstrapper.cc 113 KB