mirror of https://github.com/tc39/test262.git
Coverage: missing tests for Array.prototype.reverse method. Fixes gh-2902
This commit is contained in:
parent
96aff62fb2
commit
3b425c6da3
|
@ -0,0 +1,23 @@
|
|||
// Copyright (c) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-array.prototype.reverse
|
||||
description: Array.prototype.reverse should not iterate items if there is only one entry
|
||||
info: |
|
||||
Array.prototype.reverse ( )
|
||||
|
||||
Let O be ? ToObject(this value).
|
||||
Let len be ? LengthOfArrayLike(O).
|
||||
Let middle be floor(len / 2).
|
||||
Let lower be 0.
|
||||
Repeat, while lower ≠ middle,
|
||||
...
|
||||
Return O.
|
||||
---*/
|
||||
|
||||
let a = [1];
|
||||
|
||||
Object.freeze(a);
|
||||
|
||||
a.reverse();
|
Loading…
Reference in New Issue