I'm doing some work with the Parser API in Spidermonkey. The docs show that there's a binary operator ..
. Anybody have any idea what this is/does? I'd love to know. I've never seen it before. If I were forced to guess, I'd have to say it's something with E4X, but that's only because I know nothing about E4X.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
It is an E4X operator.
From https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide:Processing_XML_with_E4X:
Not to be confused with the decimal point and dot:
Something like:
First dot is actually a decimal point, just let JavaScript Compiler know the second dot wants to invoke property or method. And
255.toString(16)
makes JavaScript Compiler confused(identifier starts immediately after decimal numeric literal).It is indeed E4X. It does the same thing as the single dot operator, which selects children, but it selects all descendants. (It's by analogy with XPath's
/
operator selecting children of an element that match the selector and//
selecting all descendants that match the selector.)