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
1
vote
3 answers

In JavaScript, will any standalone inner function treat "this" as the object on which the original method was invoked on?

In the book JavaScript Enlightenment (the link is to a pre-published version (page 85), but I have the published version (Chapter 6.3) and it says the same thing), it says that any inner function will treat this as the global object (window) in…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
1
vote
1 answer

Can new keywords be added to Javascript?

From what I understand, the answer is "yes." But assuming that's true, how is it possible? Wouldn't it violate the WHATWG's design principle #2.1? I mean, let's assume that the keyword foo was added as a keyword in ECMA-262. wouldn't code that was…
wwaawaw
  • 6,867
  • 9
  • 32
  • 42
1
vote
3 answers

Writing ECMAScript5 compliant code (Part 2)

I am currently learning advanced JavaScript, with an aim to build a standards compliant (HTML5, CSS3, ESv5) library. Along my way I have already asked a couple of related questions to try and figure out where to start, what to do, what not to do,…
Matthew Layton
  • 39,871
  • 52
  • 185
  • 313
0
votes
1 answer

Emulating ActionScript 3.0 / JavaScript DateTime in Java

I'm looking to port some DateTime functionality from ActionScript 3.0 over to Java/Android. I am currently looking at Joda. Before going with this option I wonder if there are actually any implementations of the DateTime object with ECMA-262 3rd…
Matt Esch
  • 22,661
  • 8
  • 53
  • 51
0
votes
1 answer

Javascript Environment Record, is it an Exotic Object?

Are the environment record and exotic object creation procedures the same? i.e. creation of a basic object with different internal slots and methods, than that of an ordinary object? Are both objects constructed with the same %Object% intrinsic…
Slev7n
  • 343
  • 3
  • 14
0
votes
2 answers

maintain text but eliminate CR LF between tags

Fellow Regexers, I have a flat file full of expressions like: SELECT * FROM CONVENIENT_ONE_LINE_QUERY "SELECT * FROM THIS_QUERY WHERE IS_SPREAD_OVER == 123 ORDER BY MULTIPLE_LINES HAVING AND_IS_BETWEEN_QUOTES" SELECT * FROM…
Lynx Kepler
  • 662
  • 1
  • 9
  • 21
0
votes
2 answers

Can I target multiple objects with a single operation using ECMAScript's `with` statement?

The following doesn't work (although it gives no explicit error), but why not? And... Is there really no way around it, strictly using the with statement? Forget using for / foreach. with (object1, object2) { attribute = value; …
cregox
  • 17,674
  • 15
  • 85
  • 116
0
votes
1 answer

how to get object's [[DefaultValue]]

according to ecma262-3 8.6.2.6 [DefaultValue] http://bclary.com/2004/11/07/#a-8.6.2.6 now i want to get the [[DefaultValue]] of [ ] so according to ecma,like this: When the [[DefaultValue]] method of O is called with hint Number, the following…
free
  • 1
  • 2
0
votes
2 answers

What's the principle of Array.apply(null, obj)?

let a = {0: 'a', 1: 'b', length: 2} Array.apply(null, a) // ['a', 'b'] Using the Array constructor is the fastest way to convert an Array-like Object to Array e.g. jsperf I want to figure out how it works but I failed. In ECMAScript-262, I can't…
Eriice
  • 147
  • 1
  • 7
0
votes
1 answer

Regex not capturing repeating optional captures

I'm trying to write a URL rewrite regex for my company's site. The URL will always start with category/.+ After that, there can be up to 5 extra tags added on. With my current regex, it always captures the .+ after category, but then adds everything…
Geoffrey H.
  • 160
  • 2
  • 17
0
votes
2 answers

How can I optimize my implementation of the "toExponential" algorithm to improve precision?

I feel like my implementation is a bit naive. Take notice of the variables min in max which have a rather small precision of +/- 0.0001. If I raise the precision any further the code is just too slow. Algorithm alt text…
ChaosPandion
  • 77,506
  • 18
  • 119
  • 157
0
votes
1 answer

Implementation of setInterval() and setTimeout() under ECMAScript 262

It seems that ECMA Script does not support timed code executions like setInterval().Is there any work around for this? I thought of using a while true loop but it does not have a facility to wait for a set time interval.
RJ Rajan
  • 46
  • 7
0
votes
1 answer

Why is the Alternative symbol of the ECMAScript RegExp grammar left recursive?

I cannot for the life of me figure out why Alternative is left recursive. It really throws a wrench into my parser. Alternative :: [empty] Alternative Term Here is a note in the semantics portion of the spec that is not exactly clear.…
ChaosPandion
  • 77,506
  • 18
  • 119
  • 157
0
votes
1 answer

ActionScript this inside nested function

ActionScript 3 language specification states: In ECMA-262 edition 3, when this appears in a nested function, it is bound to the global object if the function is called lexically, without an explicit receiver object. In ActionScript 3.0, this is…
fishbone
  • 3,140
  • 2
  • 37
  • 50
0
votes
2 answers

translating Ecmascript (Java,javascript,Actionscript) knowledge to Objective C

Newcomer to Objective C and trying to translate concepts and sytax I know from ecmascript based languages to Objective C. Is it proper to think of the .h header file in ObjectiveC as an Interface in Actionscript? Lets take the following code example…
Bachalo
  • 6,965
  • 27
  • 95
  • 189
1 2 3
9
10