[
https://issues.apache.org/jira/browse/CB-6352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13948235#comment-13948235
]
ASF subversion and git services commented on CB-6352:
-----------------------------------------------------
Commit 1eab4dbc648453f6a6ecbaaa0bd705690019e9cd in cordova-plugin-file's branch
refs/heads/dev from [~iclelland]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file.git;h=1eab4db ]
CB-6352: Allow FileSystem objects to be serialized to JSON
> FileSystem objects are not JSON-serializable
> --------------------------------------------
>
> Key: CB-6352
> URL: https://issues.apache.org/jira/browse/CB-6352
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin File
> Reporter: Ian Clelland
> Assignee: Ian Clelland
>
> Attempting to render a FileSystem object (or a FileEntry, or DirectoryEntry,
> or any other object with a FileSystem contained it) results in the error:
> {code}
> TypeError: JSON.stringify cannot serialize cyclic structures.
> {code}
> (This is new behaviour with File 1.0.0)
> This happens because of a cycle in the FileSystem object structure:
> FileSystem contains a 'root' property, which is a DirectoryEntry. The
> DirectoryEntry contains a 'filesystem' property, which is the original
> FileSystem.
> I think that we can solve this with a {{.toJSON()}} method on the FileSystem
> object. This is supported (tested) on iOS and Android, and appears to be
> present in all versions of WebKit back to 2009. I don't believe that the
> presence of this method should have any side effects on webviews (if there
> are any) which do not support it.
--
This message was sent by Atlassian JIRA
(v6.2#6252)