Groups
Sign in
Groups
IronJS
Conversations
About
Send feedback
Help
Expanding prototype within the script
8 views
Skip to first unread message
Manfred Lutterbach
unread,
May 10, 2012, 5:00:58 AM
5/10/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to IronJS
Hallo,
first at all: IronJS is a great work!
But now I have a little problem. On github I read a thread about
expanding prototypes. There is a sample like this:
String.prototype.substr = String.prototype.substring;
It works fine but what I'm looking for is something like this:
String.prototype.startsWith = function(str) {
return this.indexOf(str) == 0;
}
But I always get a TargetInvocationException with the inner exception
IronJS.UserError {"TypeError: "}.
Where is my mistake? Or is a prototype extension with the function
keyword not supported?
Manfred
PS: Enjoy your baby
Reply all
Reply to author
Forward
0 new messages