0

%PrivateNameSet%

Spec said,

%PrivateNameSet% is a per-realm built-in function object

what is the per-realm built-in function object ?
It's mean built-in function that this is already bind as global object?
So, O in %PrivateNameSet% is global object?

  • Which of the terms "per-realm", "built-in" and "function object" are you asking about exactly? – Bergi May 22 '18 at 15:01
  • @Bergi *pre-realm*. I can't understand this – ENvironmentSet May 22 '18 at 15:10
  • 1
    Actually that sentence seems to be pretty superfluous. `%PrivateName%.prototype.set` is - like any other method in the spec that isn't explicitly described otherwise - a function object, built-into the implementation, and created per realm. It's very much the default. – Bergi May 22 '18 at 15:10
  • 1
    Have a look at https://stackoverflow.com/q/49832187/1048572 – Bergi May 22 '18 at 15:14
  • @Bergi Oh, So `O` in `%PrivateNameSet%` is global object? – ENvironmentSet May 22 '18 at 15:14
  • @Bergi thank you :) And I also read [this article](http://dmitrysoshnikov.com/ecmascript/javascript-the-core-2nd-edition/#realm) It said > A code realm is an object which encapsulates a separate global environment. Dose it right? – ENvironmentSet May 22 '18 at 15:15
  • No, `O` is the `this` value in the method, the receiver of the call. It would usually be a %PrivateName% instance. – Bergi May 22 '18 at 15:16
  • `%PrivateName% ` instance that created per realm? – ENvironmentSet May 22 '18 at 15:18
  • The prototype object with all its methods is created once per realm – Bergi May 22 '18 at 17:21

0 Answers0