2

The specification (https://tc39.es/ecma262/multipage/abstract-operations.html#sec-abstract-operations) states "These operations are not a part of the ECMAScript language; they are defined here solely to aid the specification of the semantics of the ECMAScript language."

What does "solely to aid the specification" mean? If they are not part of the language why can you use them? Does it depend on the engine?

pso
  • 513
  • 1
  • 16
  • Does this help at all? https://stackoverflow.com/questions/47247597/is-there-any-way-of-accessing-internal-abstract-operations-in-es6-javascript not a duplicate, but semi-related. – Matt U Nov 09 '21 at 00:52
  • @MattU I read that before but I'll give it another chance to understand it. Thank you – pso Nov 09 '21 at 00:57
  • "*Why can you use them?*" - well, you can't use them. They're part of the language, but not directly exposed as functions. – Bergi Nov 09 '21 at 01:06
  • @Bergi So is "Symbol.toPrimitive" to be treated seperately from the "ToPrimitive ( input [ , preferredType ] )" in the specification? Confusing. – pso Nov 09 '21 at 01:09
  • See also the related [What is an "internal slot" of an object in JavaScript?](https://stackoverflow.com/q/33075262/1048572), [What Internal Property In ECMAScript is defined for?](https://stackoverflow.com/q/11003021/1048572) and [Are internal slot and internal methods actually implemented by JavaScript engines?](https://stackoverflow.com/q/60119316/1048572) – Bergi Nov 09 '21 at 01:10
  • @pso Yes, they're absolutely separate. (Notice that one uses the other) – Bergi Nov 09 '21 at 01:14

0 Answers0