Questions tagged [ecma]

ECMA is a standards organisation

214 questions
7
votes
2 answers

Why is there no ISO or ECMA standardization for C# later than 2.0?

I have started learning C# and was looking for a standard specification, but found that C# versions greater than 2.0 were not standardized by ISO or ECMA (or so I gathered from Wikipedia). Is there any reason for this?
ZoomIn
  • 1,237
  • 1
  • 17
  • 35
6
votes
1 answer

What does "~" (tilde) mean in the import ... from "~/"

I just spotted "~/" in some of js imports import { Foo, Bar, Baz } from "~/types/schema" This is mildly confusing because "~" usually meant the $HOME directory. And for the life of me - I can't google the answer. The only answer I found was this…
Greg
  • 5,862
  • 1
  • 25
  • 52
6
votes
0 answers

When parsing a string in Chrome, why does new Date() treat "YYYY-MM-DD" differently?

I found an interesting quirk in Chrome when parsing strings as dates. These strings parse the same way: new Date("2020 01 01") => Wed Jan 01 2020 00:00:00 GMT-0500 (GMT-05:00) new Date("2020-01 01") => Wed Jan 01 2020 00:00:00 GMT-0500…
Benjamin
  • 1,060
  • 11
  • 16
6
votes
2 answers

What is the reason for making Object.freeze() to fail silently?

Why is that Object.freeze(obj) is made to fail silently when obj is mutated? Wouldn't it be more logical to throw than error when an immutable object is mutated? Then, it would be to the user's discretion if he wants to wrap a try catch around his…
kvn
  • 2,210
  • 5
  • 20
  • 47
6
votes
1 answer

Why did ECMASCRIPT 6 reverse the sides for assignment when destructuring?

Why did ES6 decide that left-side assignment made more sense or was more useful for destructured assignments? Just on first look, it seems to make code more error prone, now that assignment can happen on both sides, depending on situation. let obj…
BrianFreud
  • 7,094
  • 6
  • 33
  • 50
6
votes
2 answers

Browser intl.NumberFormat not displaying currency symbols correctly

I'm attempting to write a currency formatting function using Intl.NumberFormat. It works correctly when I pass it things like USD, or EUR as the currency, but seems to break when I pass it more obscure currency codes like PLN or COL, and instead of…
Gabe O'Leary
  • 2,010
  • 4
  • 24
  • 41
5
votes
1 answer

What are the ISO 2375 and 2735 standards mentioned in the ECMA-119 specification?

Out of ECMA-119 specification: 8.5 Supplementary Volume Descriptor ... 8.5.3 Volume Flags (BP 8): The bits of this field shall be numbered from 0 to 7 starting with the least significant bit. This field shall specify certain characteristics of…
schwer
  • 123
  • 9
5
votes
3 answers

What does mean?

I have a document created by Excel 2007: ... which contains the following color in a font definition in…
Shelest
  • 660
  • 8
  • 19
4
votes
0 answers

Parsing error: ecmaVersion must be a number. Received value of type string instead

I'm getting the error: Parsing error: ecmaVersion must be a number. Received value of type string instead. It causing the first import of all my files to be underlined in red. As far as I know it hasn't affected my code at all, but the error is…
Victor
  • 329
  • 4
  • 17
4
votes
1 answer

Is Intl.NumberFormat formatting correct for Poland?

I have noticed that the formating of several countries (Poland, Russia, France and more) follows a strange behaviour. The format starts to apply on values with more that 4 digits. You can see it in the code below. Unfortunately I haven't found any…
4
votes
1 answer

JS string destructuring: rest parameter returning inconsistent data

Consider the following examples An old project: const [x, ...y] = "text"; console.log(x) // "t" console.log(y) // "ext" A new project based on CRA: const [x, ...y] = "text"; console.log(x) // "t" console.log(y) // ["e", "x", "t"] I'm not sure why…
4
votes
1 answer

Is it secure to store email and password in a component state for handling input values?

I'm building a very big website project in ReactJS which handles money so I'm kinda paranoid when talking security. I have a Login component which has a state composed by "email" and "password". Those values are populated by typing in the…
Oscopoldo
  • 51
  • 4
4
votes
2 answers

What does x => x mean when passed to a function in Javascript?

Say I have code like this: function Foo(func) { var a = new SomeClass(func(5)); } var b = new Foo(x=>x); What does the x => x mean in the parameter? x is not defined anywhere else.
BlueTasted
  • 41
  • 2
4
votes
1 answer

Failing to understand "OR split" in AEM workflow

I have a workflow. In the first step it sets a variable called language. WorkflowData data = workItem.getWorkflow().getWorkflowData(); data.getMetaDataMap().put("language", "English"); workflowSession.updateWorkflowData(workItem.getWorkflow(),…
Dileepa
  • 1,019
  • 1
  • 15
  • 40
4
votes
2 answers

Comprehending regex in C++11

I am trying to learn the regular expressions in C++11. Must be doing something wrong since no brackets or escape sequences seem to work. Here is my code: #include #include #include using namespace std; int main() { …
John
  • 530
  • 5
  • 19
1
2
3
14 15