Removing Array.prototype.values

# Oliver Hunt (11 years ago)

Alas in addition to assuming that the Arguments object does not have the Array prototype, ExtJS also relies on the Array prototype not containing a property named values.

So, it seems that we’ll need to remove .values from the Array prototype.

# Boris Zbarsky (11 years ago)

Just to check, have you read the existing threads on the topic and on possible proposed solutions? Starting at esdiscuss/2013-June/031390 for example, and I'm pretty sure it's been discussed since as well...

# Rick Waldron (11 years ago)

Right—this is why we have @@unscopeables.

# Oliver Hunt (11 years ago)

Apparently i missed that thread entirely

Something i pondered before just removing .values () (that SM has already done) was essentially adding yet another property mode, essentially “ignore in |with|”. It’s technically fairly heavyweight, but it would resolve the general problem of libraries using with(), despite the years of being told not to.

# Oliver Hunt (11 years ago)

I thought @@unscopeables were (essentially) Symbols, have i been confused? Are we overloading @@ to mean different things?

# Allen Wirfs-Brock (11 years ago)

Right, but the revised spec. for @@unscopables isn't in the Rev21 draft.

See ecmascript#1908 for the changes that will be in Rev22.

# Allen Wirfs-Brock (11 years ago)

@@unscopable is the Symbol that is the property key that is used access the set of with-adverse properties for an object.

# Rick Waldron (11 years ago)

On Mon, Nov 11, 2013 at 3:06 PM, Oliver Hunt <oliver at apple.com> wrote:

Apparently i missed that thread entirely

Something i pondered before just removing .values () (that SM has already done) was essentially adding yet another property mode, essentially “ignore in |with|”.

That's essentially @@unscopables (apologies for previously misspelling)

# Rick Waldron (11 years ago)

On Mon, Nov 11, 2013 at 3:13 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>wrote:

Right, but the revised spec. for @@unscopables isn't in the Rev21 draft.

I'm looking at rev21, dated Nov 8.

# Rick Waldron (11 years ago)

On Mon, Nov 11, 2013 at 3:13 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>wrote:

Right, but the revised spec. for @@unscopables isn't in the Rev21 draft.

See ecmascript#1908 for the changes that will be in Rev22.

Sorry, I misread this, please ignore my previous response.

# Oliver Hunt (11 years ago)

For reference, i’ve just removed the API from JSC. Default iterator still does the right thing.