v8/test/mjsunit/es6/regexp-tolength.js
littledan 5d44bf0263 Ship Harmony ToLength
This patch moves ES2015 ToLength semantics on array operations, etc
to from staging to shipping.

R=adamk
BUG=v8:3087
LOG=Y

Review URL: https://codereview.chromium.org/1433473003

Cr-Commit-Position: refs/heads/master@{#31810}
2015-11-05 00:45:05 +00:00

20 lines
426 B
JavaScript

// Copyright 2015 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-tolength
'use strict';
let regexp = /x/g;
regexp.lastIndex = -1;
assertTrue(regexp.test("axb"));
assertEquals(2, regexp.lastIndex);
regexp.lastIndex = -1;
assertEquals("x", regexp.exec("axb")[0]);
assertEquals(2, regexp.lastIndex);