xjsfl Utils class
  • HughCHughC April 2012

    xjsfl.utils appears to have been refactored at some point, and not all functions moved over?

    The core/utils.jsfl implementation has some string functions that the one in libraries/utils.Utils.jsfl does not.

    This breaks snippets like 'Propogate element names across frames" as they are looking for these functions in the latter implementation of the class. ( toCamelCase() and toUndederscore() ). Copy / pasting the relevant functions over  gets the snippet working again, but you'd be a better judge of what exactly is going on here (and what else might need to be refactored?).

    cheers,

    Hugh

  • DaveDave April 2012

    Yup, there's been lots of refactoring here.

    xjsfl.utils hasn't existed for a while. There were so many utility methods being added that it was making the xjsfl class needlessly heavy, so they were refactored to the dedicated static lib Utils.

    Then, I realised that actually, it would be cool to extend some native classes, as long as Array and Object weren't touched (as it would break for..in loops) so the majority of the string functions are now found directly on the String class itself, meaning you can do things like this:

    var str = ' hello there '.trim().toCamelCase();

    Much nicer than the static Utils alternative I think you'll agree:

    var str = Utils.camelCase(Utils.trim(' hello there '));

    I'll have a look through the snippets and will push later today.

    Thanks for raising this.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with OpenID Sign In with Google Sign In with Twitter

Sign In Apply for Membership

Tagged