Skip to content

The length property of an array is enumerable #971

Closed

Description

@tofpie

Describe the bug
The length property of an array is enumerable, but it should not.

To Reproduce
This JavaScript code reproduces the issue:

>> [].propertyIsEnumerable("length")
true

Expected behavior
[].propertyIsEnumerable("length") should be false.

Build environment

  • OS: Windows 10
  • Version: 0.10
  • Target triple: x86_64-pc-windows-msvc
  • Rustc version: rustc 1.48.0 (7eac88abb 2020-11-16)

Additional context
None

Activity

  1. added
    A-Bug
    on Dec 16, 2020
  2. tofpie commented on Dec 16, 2020

    @tofpie
    ContributorAuthor

    I have taken a look, but I have not found anything obvious. I would be happy to fix it, but I do not know the code so well and I would need some guidance.

  3. added
    C-Builtins
    on Dec 16, 2020
  4. added this to the v0.11.0 milestone on Dec 16, 2020
  5. Razican commented on Dec 16, 2020

    @Razican
    Member

    Actually, not, since it should be writable as per this, so we should probably select the right attribute.

    The spec: https://tc39.es/ecma262/#sec-properties-of-array-instances-length

  6. tofpie commented on Dec 16, 2020

    @tofpie
    ContributorAuthor

    It seems this is another bug. This causes:

    >> Array.prototype.propertyIsEnumerable("length")
    true

    This should be false. Maybe I can add the fix in the same PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-BugC-Builtins

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions