Last Comment Bug 647119 - eval('(this)') == true, while (this) without eval function is an object.
: eval('(this)') == true, while (this) without eval function is an object.
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- minor (vote)
: ---
Assigned To: general
:
Mentors:
data:text/html,<!DOCTYPE html><script...
Depends on: 589664
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-31 22:05 PDT by windspirit
Modified: 2011-05-27 22:53 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description windspirit 2011-03-31 22:05:30 PDT
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20110322 Firefox/4.0
Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20110322 Firefox/4.0

it is pretty clear.
alert((this));
alert(eval('(this)'));
should give same result.
but second one will say "true". 

 

Reproducible: Always

Steps to Reproduce:
1. alert(eval('(this)'));
Comment 1 Masatoshi Kimura [:emk] 2011-03-31 23:41:42 PDT
Confirming on Windows XP. Other browsers (at least IE8 and Chrome) works as expected.
Not limited to Developer Tools, x86_64, and Linux.
Comment 2 Alice0775 White 2011-04-01 04:32:10 PDT
Regression window(TM nightly)
Works:
http://hg.mozilla.org/tracemonkey/rev/fa851447f195
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b5pre) Gecko/20100824 Minefield/4.0b5pre ID:20100824043743
Fails:
http://hg.mozilla.org/tracemonkey/rev/7680aecfb0c6
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b5pre) Gecko/20100826 Minefield/4.0b5pre ID:20100826044040
Pushlog:
http://hg.mozilla.org/tracemonkey/pushloghtml?fromchange=fa851447f195&tochange=7680aecfb0c6

In local build on ubuntu(tm repository)
build from 5685f8de41fa : fails
build from fa851447f195 : works
Treiggered by:
5685f8de41fa	Nicholas Nethercote — Bug 578216 - Make eval(json-like string) fast. r=sayrer
Comment 3 Jan de Mooij [:jandem] (PTO until July 31) 2011-04-01 04:40:46 PDT
So the underlying problem here is that JSON.parse("this") returns true...
Comment 4 Jeff Walden [:Waldo] (remove +bmo to email) 2011-04-02 00:09:20 PDT
Not surprisingly, the JSON parser rewrite fixes this.
Comment 5 Jeff Walden [:Waldo] (remove +bmo to email) 2011-05-27 22:53:44 PDT
Fixed by the parser rewrite in bug 589664.

Note You need to log in before you can comment on or make changes to this bug.