[ 
https://issues.apache.org/jira/browse/WOOKIE-151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971597#action_12971597
 ] 

Raido Kuli edited comment on WOOKIE-151 at 12/15/10 4:52 AM:
-------------------------------------------------------------

I've looked into this and found the line in wookie-wrapper which causes Syntax: 
parse error message.

64: eval("Widget.preferences.prefs."+key+"=pref");

It seems Safari can't handle evaluating for example 
"Widget.preferences.prefs.1245=somevalue".

Edit:

It's not actually Safari's problem, we should not allow passing numeric value 
for key or let it be widget developer's problem, because JavaScript actually 
doesn't allow numeric variables.

Quote from W3C page:

"Variable names must begin with a letter or the underscore character"

      was (Author: raido357):
    I've looked into this and found the line in wookie-wrapper which causes 
Syntax: parse error message.

64: eval("Widget.preferences.prefs."+key+"=pref");

It seems Safari can't handle evaluating for example 
"Widget.preferences.prefs.1245=somevalue".
  
> Numeric keys for preferences result in Parse Error in Safari
> ------------------------------------------------------------
>
>                 Key: WOOKIE-151
>                 URL: https://issues.apache.org/jira/browse/WOOKIE-151
>             Project: Wookie
>          Issue Type: Bug
>         Environment: Safari 5 Mac OS X
>            Reporter: Scott Wilson
>
> If you create a widget that uses numeric keys for preference values, this can 
> cause a Parse Error deeper in Wookie (most likely, in DWR) even if the values 
> are cast to a String.
> To replicate, add this line to any widget:
> widget.preferences.setItem("12345","67890");
> Also:
> widget.preferences.setItem("12345a","67890");
> ...will fail, but not:
> widget.preferences.setItem("a12345","67890");
> I suspect this is something either in the wrapper.js or DWR engine.js. 
> Unfortunately the debug tools in Safari aren't sufficient to trace it 
> properly.
> As a workaround - just don't use numbers for preference keys!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to