CSS vs. Javascript

Brendan Eich brendan at mozilla.org
Fri Jan 5 14:54:06 PST 2007


On Jan 5, 2007, at 1:06 PM, P T Withington wrote:

> Was any thought given to permitting:
>
>   #F00D1E
>
> notation for hex literals in Javascript?  I get a lot of grief  
> because you can use that notation in CSS but not in Javascript.

Interesting; I've never heard such complaints.  Perhaps not enough  
use-cases in the browser for hex-numbered CSS colors?

Minor conflict with SpiderMonkey's CL-inspired sharp variables:

var cyclic = #1={kid: {parent: #1#};

Possibly other implementations use # in extensions?  It's in demand,  
at least on the first line and followed by !, as a comment-to-end-of- 
line delimiter.

> Taking a bigger leap:  what about dimensioned values in  
> Javascript?  Too far out?

See http://www.mozilla.org/js/language/js20/rationale/units.html -- I  
used to encourage Waldemar to fit this into his JS2 spec, and it  
still seems like it would be appreciated in browser-like embeddings  
(more useful than # for hex :-P).  We left it out of ES4 as part of a  
triage, to fit ES4 work into a schedule that converges in the first  
half of this year.  I could see implementations experimenting with it  
and a follow-on spec emerging.

Anyone think it's really important to do in ES4?

/be




More information about the Es4-discuss mailing list