I'm investigating some code outside my scope that's written in a style I've never seen before. I'm trying to understand the inner workings of the following property bag:
Setter:
props.Property(name) = val;
Getter:
val = props.Property(name);
What would you need to instantiate for the setter to function as above?
EDIT: Less simplification, this code IS successfully running on a BrowserWindow within a frame (similar to a phone environment).
var UI =
{
ready: function(oProps)
{
try
{
if (oProps)
{
window.external.Property(UI.FrameWidth) = '1000';
window.external.Property(UI.FrameHeight) = '900';
}
window.external.Ready();
}
catch (e) { }
}
};
Thanks in advance,
I think it might be just some weird old JScript syntax. Steering away from the "internal function returns a reference" idea from the comments, I found a question about differences between JavaScript and JScript and the only syntax difference listed is this one:
The idiom f(x) = y, which is roughly equivalent to f[x] = y.
There isn't much too find about this idiom though. However, this book about Jscript.Net briefly mentions that
you can access any expando properties using square brackets or parenthesis.
"expando" seems to be a modifier for classes which allows you to add dynamic properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With