Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 413 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function names with property lookups in JScript 5.8 / WSH

#1
I was looking at Windows Script Host code that runs in JScript 5.8 and I noticed this construct:

function String.prototype.foo() { ... }

I can't find any documentation about it! I'm fairly sure this is not legal in EcmaScript, so it has to be a Microsoft-only extension. Does anyone have any links explaining its design and semantics?
Reply

#2
The JScript team released a draft of a document [on their blog][1] called "JScript Deviations from ES3" that describes this syntax among others.

From section 4.4:

> JScript permits function names to be qualified. This allows for `function foo.prototype()` to be syntactic sugar for `foo.prototype = function (){}` Note that the object on LHS of the '.' must already be defined.


On [this post from IEBlog][2] about IE9 and ECMAScript 5 compatibility, they mention that this syntax is not supported by IE9 standards mode. I would imagine the same holds true for later versions of IE as well.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through