archives

« Bugzilla Issues Index

#4062 — 6.2.4.5, 8.1.1.2.1, 21.1.2.4, 21.2.5.6, 22.2.3.22.1: Merge Get + ToXXX calls


Get() immediately followed by ToXXX where ToXXX is one of the type conversion operations can be merged into a single line.


6.2.4.5 ToPropertyDescriptor ( Obj )

Steps 3.a-c
> Let enum be ToBoolean(Get(Obj, "enumerable")).
> ReturnIfAbrupt(enum).
> Set the [[Enumerable]] field of desc to enum.

Similar changes are possible for steps 5.a-c, and 7.a-c.


8.1.1.2.1 HasBinding(N)

Steps 9.a-c
> Let blocked be ToBoolean(Get(unscopables, N)).
> ReturnIfAbrupt(blocked).
> If blocked is true, return false.


21.1.2.4 String.raw ( template , ...substitutions )

Steps 5-7:
> Let raw be ToObject(Get(cooked, "raw")).
> ReturnIfAbrupt(raw).

Steps 13.b-d
> Let nextSeg be ToString(Get(raw, nextKey)).
> ReturnIfAbrupt(nextSeg).


21.2.5.6 RegExp.prototype [ @@match ] ( string )

Steps 8.e.iv.1-4
> Let matchStr be ToString(Get(result, "0")).
> ReturnIfAbrupt(matchStr).


22.2.3.22.1 %TypedArray%.prototype.set (array [ , offset ] )

Steps 18-20
> Let srcLength be ToLength(Get(src, "length" )).
> ReturnIfAbrupt(srcLength).

Steps 25.b-d
> Let kNumber be ToNumber(Get(src, Pk)).
> ReturnIfAbrupt(kNumber).


fixed in rev35 editor's draft


fixed in rev35