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
6
votes
3 answers

Differences between regular expressions in Java and ECMA-262 (AS, JS)

I need to convert Java regular expressions into Actionscript regular expressions. There apparently aren't any premade converters, so I'm trying to write one myself. Is there any resource that'd list all the differences? I'm aware of…
tsiki
  • 1,638
  • 21
  • 34
6
votes
2 answers

How to make sure ES3 programs will run in an ES5 engine?

So ECMAScript 5 introduces some incompatibilities with ECMAScript 3. Example: Many articles have been written stating that this === null || this === undefined is possible in ES5 strict mode: "use strict"; (function () { alert(this); //…
user123444555621
  • 148,182
  • 27
  • 114
  • 126
6
votes
2 answers

Clarity on the difference between "LexicalEnvironment" and "VariableEnvironment" in ECMAScript/JavaScript

Could someone clarify what the difference is between these two, as they exist in the Execution context? It's hard for me to read the ECMA 262 v 5 specification and clearly see the difference. Thank You,
contactmatt
  • 18,116
  • 40
  • 128
  • 186
6
votes
9 answers

How can I rewrite the ErrorMessage for a CustomValidator control on the client?

I have a CustomValidator that is validating a telephone number for several different telephone numbering schemes. The client-side javascript looks like this: validatePhoneNumber(sender, args) { cleanNumber = args.Value.replace(/\D/, ""); …
Dustman
  • 5,035
  • 10
  • 32
  • 40
5
votes
2 answers

What is the purpose of classScope in the EcmaScript specification?

I was reading the steps in the specification (12th edition) that occur when a class declaration or expression is used, and saw that it starts off by creating a class scope at section 15.7.7 Runtime Semantics: ClassDefinitionEvaluation: 1. Let env be…
Shnick
  • 1,199
  • 1
  • 13
  • 32
5
votes
3 answers

DontDelete property of javascript objects

According to EcmaScript specification some objects properties cannot be deleted due to the DontDelete internal parameter. For example : var y = 5 should not be deletable. But from what I was able to check - it is. Here's a link at Mozilla Developer…
elreyano
  • 95
  • 3
5
votes
1 answer

Why is ECMAScript still not a recommendation of W3C?

In theory browsers could support several programming languages for client-side scripting of web pages. In practice, ECMAScript is the only one widely implemented and used in all browsers. So for most people, it is an integral part of the…
Gabriel Cuvillier
  • 3,617
  • 1
  • 28
  • 35
5
votes
1 answer

How can I improve the recursion capabilities of my ECMAScript implementation?

After some resent tests I have found my implementation cannot handle very much recursion. Although after I ran a few tests in Firefox I found that this may be more common than I originally thought. I believe the basic problem is that my…
ChaosPandion
  • 77,506
  • 18
  • 119
  • 157
5
votes
1 answer

What is a "calling context?"

ECMA-262 5.1 subsections 10.4.2 and 10.4.2.1 refer to a "calling context." This doesn't appear to be described anywhere else in the document. Quoting the spec, emphasis mine: 10.4.2 Entering Eval Code The following steps are performed when control…
Dagg Nabbit
  • 75,346
  • 19
  • 113
  • 141
5
votes
2 answers

ECMA-262 ReturnIfAbrupt

Recently, I read the ECMAScript Language Specification. I didn't plan to read the whole specification, I just picked up some parts. I came cross many questions, one of them is like this: ToLength 1.Let len be…
Joyce Lee
  • 309
  • 2
  • 10
5
votes
2 answers

Why are anonymous function expressions and named function expressions initialized so differently?

I'm looking at section 13 or the ECMAScript specification (v. 5). An anonymous function expression is initialized as follows: Return the result of creating a new Function object as specified in 13.2 with parameters specified by…
contactmatt
  • 18,116
  • 40
  • 128
  • 186
5
votes
3 answers

Does a function expression have its own scope/lexical environment

I'm reading the Execution Context / Lexical Environment section of the ECMA 262 5 specification. It states the following: (emphasis added) A Lexical Environment is a specification type used to define the association of Identifiers to specific…
contactmatt
  • 18,116
  • 40
  • 128
  • 186
4
votes
1 answer

Are there any syntactic differences between ECMA-262 and ECMA-357?

I'm writing a JavaScript parser based on ECMA-262. I'd be interested to know how much I'd need to change to make it ECMA-357 compatible. Are there any syntactic differences?
Nick Brunt
  • 9,533
  • 10
  • 54
  • 83
4
votes
2 answers

BigInt and Number coercion by numeric comparison operators

Will numeric comparison, between a BigInt and a Number, coerce one argument to BigInt, or coerce one argument to Number? For example, in the following, is 3n coerced to 3, or is 1 coerced to 1n? console.log(3n > 1) // true Both operands appear…
Ben Aston
  • 53,718
  • 65
  • 205
  • 331
4
votes
2 answers

ECMAScript Associative Array via Object w/ prototype null?

I see a lot of people doing this Object.prototype.foo = 'HALLO'; var hash = {baz: 'quuz'}; for ( var v in hash ) { // Do not print property `foo` if ( hash.hasOwnProperty(v) ) { console.log( v + " is a hash property" ); } } My question…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468