Closed
Bug 407374
Opened 18 years ago
Closed 18 years ago
Destructuring assignment isn't threadsafe
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mozilla.bugs, Unassigned)
Details
Attachments
(1 file)
|
1.11 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Build Identifier: CVS HEAD
I have a function with destructured parameters
(eg function(a, [b]) {...}).
This function is called from several threads and the b (in this example) appears to be shared :-(
If I rewrite my functions without destructured parameters (eg function(a, ab) { const b = ab[0]; ... } it solves the problem.
Compiled & interpreted mode.
Reproducible: Always
Steps to Reproduce:
function f(a, [b]) {
java.lang.Thread.sleep(2000);
print(a + ";" + b);
}
spawn(f, [1, [2]]);
spawn(f, [3, [4]]);
Actual Results:
3;4
1;4
Expected Results:
3;4
1;2
| Reporter | ||
Comment 1•18 years ago
|
||
Additional information: b is set in the top level scope.
| Reporter | ||
Comment 2•18 years ago
|
||
This patche makes the destructuring assignment to set properties in the current scope.
Comment 3•18 years ago
|
||
Thanks for the patch. Committed:
Checking in Parser.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Parser.java,v <-- Parser.java
new revision: 1.123; previous revision: 1.122
done
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•