Re: [heycam/webidl] Clarifications to dictionary semantics (#859)

domenic commented on this pull request.



> @@ -4741,9 +4740,15 @@ where [=map/keys=] are strings and [=map/values=] are of a particular type speci
     };
 </pre>
 
-Dictionaries are always passed by value.  In language bindings where a dictionary is represented by an object of some kind, passing a
-dictionary to a [=platform object=] will not result in a reference to the dictionary being kept by that object.
-Similarly, any dictionary returned from a platform object will be a copy and modifications made to it will not be visible to the platform object.
+Dictionaries are always passed by value: the dictionary does not retain a reference to its
+language-specific representation (e.g., the corresponding ECMAScript object). So for example,
+returning a dictionary from an [=operation=] will result in a new ECMAScript object being created

Well, OK, if the inner things are dictionaries, then _their_ copy semantics get applied, so yeah, that particular example is deep. But `x.method{ a: window })` does not copy `window` deeply.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/859#discussion_r396821534

Received on Monday, 23 March 2020 23:34:00 UTC