Given something like this:
is there any way for the Something class to know it's being put into "foo" (as a String)?
The only thing I can come up with so far is blatantly feeding it:
Which my client, of course, doesn't like doing... they need it as idiot-proof as possible.
Background:
At some point in the code, Something Class's references to "this" need to be converted to a string, exported to a plugin, and sent back to JavaScript... by which time, of course, "this" is no longer valid. To maintain state across this "must be a string" bridge, I'd like to know the name of the variable Something is first assigned to ( with the understanding that once instantiated it can be cross-assigned to other vars).
Yeah, it's a weird request!
Code:
var foo = new Something()
The only thing I can come up with so far is blatantly feeding it:
Code:
var foo = new Something("foo")
Background:
At some point in the code, Something Class's references to "this" need to be converted to a string, exported to a plugin, and sent back to JavaScript... by which time, of course, "this" is no longer valid. To maintain state across this "must be a string" bridge, I'd like to know the name of the variable Something is first assigned to ( with the understanding that once instantiated it can be cross-assigned to other vars).
Yeah, it's a weird request!
Comment