0

My question is simple, How do you define the behavior of assignment operator in v8 / Node.js?

Assume I have a class in C++ domain that have a set method. Normally when I write this JS:

var jsInstance = new CppWrappedClass(params1);
jsInstance = new CppWrappedClass(params2);

The second call to new CppWrappedClass(...) totally replaces the contents of jsInstance with the new one. What I would want to achieve is that when the second call happens, in its C++ backend, my set method gets called. Aka I define the behavior of assignment operator.

Is this even possible?

Sepehr
  • 2,051
  • 19
  • 29
  • no, it's not possible – vkurchatkin Sep 09 '14 at 18:36
  • ECMAscript (http://www.ecma-international.org/ecma-262/5.1/#sec-11.13) says there should be a function called `PutValue` but I am assuming that is not overridable, because I don't see it in Chrome's dev console. – Sepehr Sep 09 '14 at 18:41

0 Answers0