archives

« Bugzilla Issues Index

#3516 — 12.7.3 The Addition operator ( + ), step 11: Remove the ad hoc check for Symbol


12.7.3 The Addition operator ( + )
Step 11.a of the algorithm reads:

If Type(lprim) is Symbol or Type(rprim) is Symbol, then throw a TypeError exception.

Special-casing Symbol is not needed, because ToString() applied to it will throw a TypeError. I suggest the following (compare with steps 12-16):

11. If Type(lprim) is String or Type(rprim) is String, then
a. Let lstr be ToString(lprim).
b. ReturnIfAbrupt(lstr).
c. Let rstr be ToString(rprim).
d. ReturnIfAbrupt(rstr).
e. Return the result of concatenating lstr and rstr.


fixed in rev31` editor's draft


In Rev31