Commit 78c053a5 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

[Intl] Hide Intl["SegmentIterator"]

Fix the code incorrctly exposed Intl["SegmentIterator"] that caused
Unreachable code in builtins-internal.cc

Bug: chromium:900013
Change-Id: I50d457a9f065d597b3bbb77a7a45011335c959da
Reviewed-on: https://chromium-review.googlesource.com/c/1306906Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57140}
parent f72c118d
...@@ -4846,8 +4846,13 @@ void Genesis::InitializeGlobal_harmony_intl_segmenter() { ...@@ -4846,8 +4846,13 @@ void Genesis::InitializeGlobal_harmony_intl_segmenter() {
Builtins::kSegmentIteratorPrototypeBreakType, false); Builtins::kSegmentIteratorPrototypeBreakType, false);
// Setup SegmentIterator constructor. // Setup SegmentIterator constructor.
Handle<JSFunction> segment_iterator_fun = InstallFunction( Handle<String> name_string =
isolate(), intl, "SegmentIterator", JS_INTL_SEGMENT_ITERATOR_TYPE, Name::ToFunctionName(
isolate(),
isolate()->factory()->InternalizeUtf8String("SegmentIterator"))
.ToHandleChecked();
Handle<JSFunction> segment_iterator_fun = CreateFunction(
isolate(), name_string, JS_INTL_SEGMENT_ITERATOR_TYPE,
JSSegmentIterator::kSize, 0, prototype, Builtins::kIllegal); JSSegmentIterator::kSize, 0, prototype, Builtins::kIllegal);
segment_iterator_fun->shared()->set_native(false); segment_iterator_fun->shared()->set_native(false);
......
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-intl-segmenter
// Regression test to ensure no Intl["SegmentIterator"]
assertThrows(() => new Intl["SegmentIterator"](), TypeError);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment