uneval of sharp variables has issues...

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
12 years ago
8 years ago

People

(Reporter: Biju, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

12 years ago
from Bug 367686 and Bug 367731 

uneval of sharp variables has issues..

few examples...

uneval of

 function(){
   return [#1=(3)]
 }

gives ==>

function () {
    return #1={};
}



uneval of 

function (){
  return [#1=({}), {__proto__: #1#}]
}


gives ==>

function () {
    return #1={, {__proto__:#1#}};
}




uneval of 

function (){
  return [#1=x, {__proto__: #1#}]
}


gives ==>

function () {
    return #1={, {__proto__:#1#}};
}




But following unevals are fine

function (){
  return [1, #1=x, {__proto__: #1#}]
}


and

function(){
   return [1, #1=(3)]
}
(Reporter)

Updated

12 years ago
Blocks: 368267
(Reporter)

Comment 1

12 years ago
also works fine if we substitute actual vars instead of sharp variables;
example... 

function (){
  var y;
  return [y=x, {__proto__: y}]
}


function(){
  var y;
  return [y=x]
}

(Reporter)

Comment 2

8 years ago
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.3a5pre) 
Gecko/20100520 Minefield/3.7a5pre 

Case 1 -------------------------------
f = ( function(){
   return [#1=(3)]
 })

===>
function () {
    return [#1=3];
}

and
f = (function () {
    return [#1=3];
})
==>
 invalid sharp variable definition

Case 2 -------------------------------
f = (function (){
  return [#1=({}), {__proto__: #1#}]
})

===>
function () {
    return [#1={}, {__proto__: #1#}];
}

Case 3 -------------------------------

f = (function (){
  return [#1=x, {__proto__: #1#}]
})

===>

function () {
    return [#1=x, {__proto__: #1#}];
}

Case 4 -------------------------------
f = (function (){
  return [1, #1=x, {__proto__: #1#}]
})

===>
function () {
    return [1, #1=x, {__proto__: #1#}];
}

Case 5 -------------------------------
f = (function(){
   return [1, #1=(3)]
})
===>
function () {
    return [1, #1=3];
}

Case 6 -------------------------------
uneval([(function () {var y;return [y = x, {__proto__: y}];}), 
(function () {var y;return [y = x];})])
==>
[(function () {var y;return [y = x, {__proto__: y}];}), 
(function () {var y;return [y = x];})]
(Reporter)

Comment 3

8 years ago
Case 1 -------------------------------
f = ( function(){
   return [#1=(3)]
 })

===>
invalid sharp variable definition

Case 5 -------------------------------
f = (function(){
   return [1, #1=(3)]
})
===>
 invalid sharp variable definition


Assuming this is PASSED by bug 335051 attachment 444050 [details] [diff] [review]
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.