Can't get non-standard Javascript syntaxes to function
8 views
Skip to first unread message
Ian Beck
unread,
Jul 29, 2010, 3:22:06 PM7/29/10
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
Sign in to 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 JSCocoa
When I include this code on the first line of my Javascript file
(taken from the JSCocoa website):
class NSButton
{
// Swizzle an instance method of an existing class
Swizzle- (void)drawRect:(NSRect)rect
{
// Call original swizzled method, this will call
NSButton's drawRect:
this.Original(arguments)
}
}
JSCocoa spits this out to the Console:
JSException: SyntaxError: Parse error on line 1
Why is this syntax failing? I can't seem to get ANY of the non-
standard syntaxes up and running in my experiments (Objective-J syntax
fails with syntax errors, too). I'm using the latest version of the
JSCocoa.framework and evaluating the Javascript like so:
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to 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 jsc...@googlegroups.com
> JSCocoa spits this out to the Console: > > JSException: SyntaxError: Parse error on line 1 > > Why is this syntax failing? I can't seem to get ANY of the non- > standard syntaxes up and running in my experiments (Objective-J syntax > fails with syntax errors, too). I'm using the latest version of the > JSCocoa.framework and evaluating the Javascript like so:
Have you added class.js, jslint-jscocoa.js into the 'Copy Bundle Resources' of your project ? By default XCode sets them to be compiled.
-Patrick
Ian Beck
unread,
Aug 1, 2010, 4:15:08 PM8/1/10
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
Sign in to 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 JSCocoa
Ah, that's likely the problem. I'll double check and make sure that
they're getting copied rather than compiled. Thanks!