Awesome - thank you Daniel. 

Does usage of this require one of the particular date formats to be used 
(as per https://developers.google.com/chart/interactive/docs/datesandtimes) 
or am I reading too much into the fixDateStrings_ function?

On Friday, 2 March 2018 21:55:17 UTC, Daniel LaLiberte wrote:
>
> The source for this code is:  
>
> gviz 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=11&ct=xref_jump_to_def&gsn=gviz&rcl=187416831>.json
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=11&ct=xref_jump_to_def&gsn=json&rcl=187416831>.unsafeDeserialize
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=82&gs=kythe%253A%252F%252Fgoogle3%253Flang%253Djavascript%253Fpath%253Djavascript%252Fgviz%252Fdevel%252Fjsapi%252Fcommon%252Fjson.js%2523gviz.json.unsafeDeserialize%25253Aname%25253AOTHER&gsn=unsafeDeserialize&ct=xref_usages>
>  = function(jsonString 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=82&gs=kythe%253A%252F%252Fgoogle3%253Flang%253Djavascript%253Fpath%253Djavascript%252Fgviz%252Fdevel%252Fjsapi%252Fcommon%252Fjson.js%2523gviz.json.unsafeDeserialize%252540jsonString%25253Aname%25253AOTHER&gsn=jsonString&ct=xref_usages>)
>  {  if (gviz 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=11&ct=xref_jump_to_def&gsn=gviz&rcl=187416831>.UNSAFE_EVAL
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=43&ct=xref_jump_to_def&gsn=UNSAFE_EVAL&rcl=187416831>
>  && !gviz 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=11&ct=xref_jump_to_def&gsn=gviz&rcl=187416831>.json
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=11&ct=xref_jump_to_def&gsn=json&rcl=187416831>.cspCompliantMode_
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=83&gs=kythe%253A%252F%252Fgoogle3%253Flang%253Djavascript%253Fpath%253Djavascript%252Fgviz%252Fdevel%252Fjsapi%252Fcommon%252Fjson.js%2523gviz.json.cspCompliantMode_%25253Aname%25253AOTHER&gsn=cspCompliantMode_&ct=xref_usages>)
>  {    // Add parentheses to disambiguate object literal from control 
> structure    jsonString 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=82&ct=xref_jump_to_def&gsn=jsonString&rcl=187416831>
>  = '(' + jsonString 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=82&ct=xref_jump_to_def&gsn=jsonString&rcl=187416831>
>  + ')';    // Not using JSON.parse since it does not support the "new" 
> operator.    var jsonObject 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=87&gs=kythe%253A%252F%252Fgoogle3%253Flang%253Djavascript%253Fpath%253Djavascript%252Fgviz%252Fdevel%252Fjsapi%252Fcommon%252Fjson.js%2523gviz.json.unsafeDeserialize%252526jsonObject%25253Aname%25253AOTHER&gsn=jsonObject&ct=xref_usages>
>  = eval 
> <https://cs.corp.google.com/piper///depot/google3/javascript/externs/es3.js?l=302&ct=xref_jump_to_def&gsn=eval&rcl=187416831>(jsonString
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=82&ct=xref_jump_to_def&gsn=jsonString&rcl=187416831>);
>     return /** @type {!Object 
> <https://cs.corp.google.com/piper///depot/google3/javascript/externs/es3.js?l=313&ct=xref_jump_to_def&gsn=Object&rcl=187416831>}
>  */ (gviz 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=11&ct=xref_jump_to_def&gsn=gviz&rcl=187416831>.json
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=11&ct=xref_jump_to_def&gsn=json&rcl=187416831>.fixDateStrings_
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=180&ct=xref_jump_to_def&gsn=fixDateStrings_&rcl=187416831>(jsonObject
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=87&ct=xref_jump_to_def&gsn=jsonObject&rcl=187416831>));
>   } else {    return /** @type {?Object 
> <https://cs.corp.google.com/piper///depot/google3/javascript/externs/es3.js?l=313&ct=xref_jump_to_def&gsn=Object&rcl=187416831>}
>  */ (JSON 
> <https://cs.corp.google.com/piper///depot/google3/javascript/externs/es5.js?l=269&ct=xref_jump_to_def&gsn=JSON&rcl=187416831>.parse
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/externs/es5.js?l=252&ct=xref_jump_to_def&gsn=parse&rcl=187416831>(jsonString
>  
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=82&ct=xref_jump_to_def&gsn=jsonString&rcl=187416831>));
>   }};
>
>
>
> Note the check for !gviz 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=11&ct=xref_jump_to_def&gsn=gviz&rcl=187416831>
> .json 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=11&ct=xref_jump_to_def&gsn=json&rcl=187416831>
> .cspCompliantMode_ 
> <https://cs.corp.google.com/piper///depot/google3/javascript/gviz/devel/jsapi/common/json.js?l=83&gs=kythe%253A%252F%252Fgoogle3%253Flang%253Djavascript%253Fpath%253Djavascript%252Fgviz%252Fdevel%252Fjsapi%252Fcommon%252Fjson.js%2523gviz.json.cspCompliantMode_%25253Aname%25253AOTHER&gsn=cspCompliantMode_&ct=xref_usages>.
>  
> We have no code that sets it to true now, so I expect I can just force 
> JSON.parse to be used always.  I'll do that now, and it will be part of the 
> v46 release.
>
>
> On Fri, Mar 2, 2018 at 3:50 PM, Edward Hartwell Goose <e...@mention-me.com 
> <javascript:>> wrote:
>
>> We're just evaluating using a CSP and can confirm we see `unsafe-eval`. 
>> It looks like the code is nearly there in the upcoming version - we just 
>> trip up in one place, in gvjs_Jh within the compiled_format module. 
>>
>>
>> <https://lh3.googleusercontent.com/-qTS1riVF8xY/Wpm4fG003_I/AAAAAAAAHzU/n2HBEuOB3PwDaSJZ6nhEkUueGtut7tEMgCLcBGAs/s1600/2_X_IST_-_Mention_Me_Admin.png>
>>
>> Daniel - is there anything we can do to help provide you with test cases 
>> or similar to help you nail this? I'd be glad to help. 
>>
>> On Wednesday, 28 February 2018 17:16:11 UTC, Kirschner wrote:
>>>
>>> I stepped on this problem too, is the upcomming(?) v46 free of evals?
>>>
>>> On Tuesday, September 12, 2017 at 6:37:07 AM UTC+2, Daniel LaLiberte 
>>> wrote:
>>>>
>>>> I will try to remember to post a followup here.  But I usually forget 
>>>> such things.
>>>>
>>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Google Visualization API" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-visualization-api+unsubscr...@googlegroups.com 
>> <javascript:>.
>> To post to this group, send email to google-visua...@googlegroups.com 
>> <javascript:>.
>> Visit this group at 
>> https://groups.google.com/group/google-visualization-api.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-visualization-api/45477d15-c886-4f8f-96cc-2429b4815dc5%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/google-visualization-api/45477d15-c886-4f8f-96cc-2429b4815dc5%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
> dlali...@google.com <javascript:>   5CC, Cambridge MA
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/4f7ac8fa-25fd-4d8d-b813-c91f407f4285%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to