New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 643506 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

propertyIsEnumerable behaves as if always in strict mode

Reported by adriant...@gmail.com, Sep 2 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2810.2 Safari/537.36

Steps to reproduce the problem:
1. Run this code in the dev console

a = {}
pie = a.propertyIsEnumerable
pie('asd')

What is the expected behavior?
The code runs fine; the call to pie returns false (unless there is an 'asd' declared on window)

What went wrong?
The call to pie throws a "Uncaught TypeError: Cannot convert undefined or null to object" as if it's called under strict mode

Did this work before? N/A 

Chrome version: 54.0.2810.2  Channel: n/a
OS Version: 
Flash Version: Shockwave Flash 22.0 r0
 

Comment 1 by tkent@chromium.org, Sep 4 2016

Components: -Blink Blink>JavaScript
Cc: littledan@chromium.org adamk@chromium.org
Components: -Blink>JavaScript Blink>JavaScript>Language
Status: Available (was: Unconfirmed)
Not sure what you mean. You can find the spec here: https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable . The `this` value should be undefined in that case, which would throw the TypeError that we throw. Strict mode with respect to receivers of methods is a property of the callee, not the caller; everything defined in the ECMAScript standard has strict-mode-style semantics.
I assumed `this` would be window as I didn't know that "everything defined in the ECMAScript standard has strict-mode-style semantics."

The snippet also happens to work in Firefox (48) in the dev console and that strengthened my assumption.

Thank you!


Sounds like Firefox has a bug!

Comment 6 by bzbar...@mit.edu, Sep 8 2016

There is in fact a Firefox bug here, which in particular is affecting evaluation in the Firefox console.  See https://bugzilla.mozilla.org/show_bug.cgi?id=1301491

Comment 7 by adamk@chromium.org, Aug 8 2017

Owner: adamk@chromium.org
Status: WontFix (was: Available)
This is correct behavior, per #3.

Sign in to add a comment