Questions tagged [ecma262]

ECMA-262 is a Standard defining the ECMAScript scripting language also known as JavaScript.

ECMA-262 is a Standard defining the ECMAScript scripting language also known as JavaScript. For complete reference read the standard it self at: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

145 questions
26
votes
1 answer

QtScript instanceof with custom class throws prototype-related error

I have a Qt project which uses the QtScript module to make some components of my application scriptable. After several attempts at making the existing classes directly usable in QtScript, I chose to go with wrapper classes which inherit QObject and…
ixM
  • 1,244
  • 14
  • 29
26
votes
3 answers

Indirect function call in JavaScript

There are things like f.call(...) f.apply(...) But then there's this (1, alert)('Zomg what is this????!!!11') "1" does not seem to mean much in this context, the following works just fine: (null, alert)('Zomg what is this????!!!11') (1, null,…
Art
  • 23,747
  • 29
  • 89
  • 101
24
votes
7 answers

JavaScript types

As per http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf, JavaScript has 6 types: undefined, null, boolean, string, number and object. var und; console.log(typeof und); // <-- undefined var n = null; console.log(typeof n);…
Alex Ivasyuv
  • 8,585
  • 17
  • 72
  • 90
22
votes
4 answers

EBNF for ECMAScript?

I'm trying to find a good EBNF description of ECMAScript, but so far I've not found anything complete. Any ideas?
Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
21
votes
4 answers

Getting a reference to the global object in an unknown environment in strict mode

What is the recommended way to get a handle to the global object in ES5 strict mode in an unknown host environment? ECMAScript doesn't provide a built-in way to reference the global object that I'm aware of. If it does, this is the answer I'm…
Dagg Nabbit
  • 75,346
  • 19
  • 113
  • 141
21
votes
5 answers

Why does "dtoa.c" contain so much code?

I'll be the first to admit that my overall knowledge of low level programming is a bit sparse. I understand many of the core concepts but I do not use them on a regular basis. That being said I was absolutely astounded at how much code was needed…
ChaosPandion
  • 77,506
  • 18
  • 119
  • 157
19
votes
3 answers

Relation between [[Prototype]] and prototype in JavaScript

From http://www.jibbering.com/faq/faq_notes/closures.html : Note: ECMAScript defines an internal [[prototype]] property of the internal Object type. This property is not directly accessible with scripts, but it is the chain of objects referred to…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
19
votes
4 answers

Is there an i18n (Intl) shim for JavaScript?

I am looking for a shim for the ECMAScript Internationalization API. Does anyone know of such a project? (Even if it's still currently a work-in-progress.)
17
votes
3 answers

Why JSON allows only string to be a key?

Why does JSON only allow a string to be a key of a pair? Why not other types such as null, number, bool, object, array? Considering JSON is tightly related with JavaScript, could I conclude the reason from JavaScript specification (ECMA-262)? I'm…
pipipi
  • 501
  • 1
  • 3
  • 11
17
votes
2 answers

What's a valid left-hand-side expression in JavaScript grammar?

Okay, we all know what the valid left-hand-side expressions are. Kind of.* But, looking at the definition from the ECMA-Script standard, I'm very confused: LeftHandSideExpression : NewExpression CallExpression Is that just an error in the…
user123444555621
  • 148,182
  • 27
  • 114
  • 126
16
votes
3 answers

IDE for ECMAScript-262 with in IDE execution / debugging for node.js/V8

I currently use Eclipse as my IDE for other languages and I'm rather used to not having to leave the IDE for anything - however I'm really struggling to find the same or a similar setup for pure ECMAScript-262. To clarify, I am not looking for DOM…
nathan
  • 5,402
  • 1
  • 22
  • 18
15
votes
1 answer

When will v8 implement ECMAScript 5?

I noticed that v8 is rather mute on the issue of ECMAScript 5th edition. V8 implements ECMAScript as specified in ECMA-262, 3rd edition, and runs on Windows XP and Vista, Mac OS X 10.5 (Leopard), and Linux systems that use IA-32 or ARM…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
14
votes
4 answers

Javascript maximum size for types?

Looking into javascript types I'm trying to find out what the maximum storage size for some data types are. For instance, I set up a quick recursive algo to increase var size till the browser crashes, which ends up being somewhere close to 128mb (or…
Incognito
  • 20,537
  • 15
  • 80
  • 120
14
votes
5 answers

What is the scope of a function in Javascript/ECMAScript?

Today I had a discussion with a colleague about nested functions in Javascript: function a() { function b() { alert('boo') } var c = 'Bound to local call object.' d = 'Bound to global object.' } In this example, trials point out…
Dong Hoon
  • 879
  • 1
  • 8
  • 13
14
votes
1 answer

When did all browsers start supporting the String.replace(regexp, replacement_function)?

According to the 6th Edition of JavaScript: The Definitive Guide (Flanagan, 2011): ECMAScript v3 specifies that the replacement argument to replace() may be a function instead of a string. I'm looking at some code written in 2005, where a…
guypursey
  • 3,114
  • 3
  • 24
  • 42
1
2
3
9 10