Intl.Segmenter iterator result should have isWordLike only if type is "word" (#2717)

Update according to https://github.com/tc39/proposal-intl-segmenter/pull/128.
This commit is contained in:
Yusuke Suzuki 2020-07-28 10:53:16 -07:00 committed by GitHub
parent c619375b46
commit 80b54781b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -1,4 +1,5 @@
// Copyright 2018 the V8 project authors. All rights reserved.
// Copyright 2020 Apple Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
@ -31,6 +32,7 @@ for (const text of [
let segments = [];
for (const v of seg.segment(text)) {
assert.sameValue(undefined, v.isWordLike);
assert.sameValue(false, v.hasOwnProperty("isWordLike"));
assert.sameValue("string", typeof v.segment);
assert(v.segment.length > 0);
segments.push(v.segment);

View File

@ -1,4 +1,5 @@
// Copyright 2018 the V8 project authors. All rights reserved.
// Copyright 2020 Apple Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
@ -31,6 +32,7 @@ for (const text of [
let segments = [];
for (const v of seg.segment(text)) {
assert.sameValue(undefined, v.isWordLike);
assert.sameValue(false, v.hasOwnProperty("isWordLike"));
assert.sameValue("string", typeof v.segment);
assert(v.segment.length > 0);
segments.push(v.segment);

View File

@ -1,4 +1,5 @@
// Copyright 2018 the V8 project authors. All rights reserved.
// Copyright 2020 Apple Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
@ -31,6 +32,7 @@ for (const text of [
let segments = [];
for (const v of seg.segment(text)) {
assert.sameValue("boolean", typeof v.isWordLike);
assert.sameValue(true, v.hasOwnProperty("isWordLike"));
assert.sameValue("string", typeof v.segment);
assert(v.segment.length > 0);
segments.push(v.segment);