functions wrapped with sync() cause StackOverflowError when setting properties

UNCONFIRMED
Unassigned

Status

UNCONFIRMED
8 years ago
8 years ago

People

(Reporter: john.spackman, Unassigned)

Tracking

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16
Build Identifier: Rhino 1.7 release 3 PRERELEASE 2011 03 17 

If you use sync() to wrap a function and then add properties to the returned function object, setting the property causes a StackOverflowError.

Reproducible: Always

Steps to Reproduce:
var f = sync( function() {} );
f.displayName = 'hello';

Actual Results:  
java.lang.StackOverflowError
	at org.mozilla.javascript.ScriptableObject.getSlot(ScriptableObject.java:2577)
	at org.mozilla.javascript.ScriptableObject.putImpl(ScriptableObject.java:2527)
	at org.mozilla.javascript.ScriptableObject.put(ScriptableObject.java:463)
	at org.mozilla.javascript.IdScriptableObject.put(IdScriptableObject.java:424)
	at org.mozilla.javascript.Delegator.put(Delegator.java:149)
	at org.mozilla.javascript.ScriptableObject.put(ScriptableObject.java:467)
	at org.mozilla.javascript.IdScriptableObject.put(IdScriptableObject.java:424)
	at org.mozilla.javascript.Delegator.put(Delegator.java:149)
	at org.mozilla.javascript.ScriptableObject.put(ScriptableObject.java:467)
	at org.mozilla.javascript.IdScriptableObject.put(IdScriptableObject.java:424)
	at org.mozilla.javascript.Delegator.put(Delegator.java:149)
	at org.mozilla.javascript.ScriptableObject.put(ScriptableObject.java:467)
... etc ...

Expected Results:  
no error
You need to log in before you can comment on or make changes to this bug.