Loading ...
Sorry, an error occurred while loading the content.

Cannot validate ADSafe code

Expand Messages
  • rolfnjorjensen_tradeshift
    We have been using an older version of JSLint ( 2010-12-14 ) to validate code like the below. This has been going well, but when trying to upgrade to newest
    Message 1 of 2 , Apr 8, 2011
    • 0 Attachment
      We have been using an older version of JSLint ('2010-12-14') to validate code like the below. This has been going well, but when trying to upgrade to newest version ('2011-04-04'), the validation goes not so well.

      We have tried it out on the online edition, and get the same mysterious error.

      Can anybody help us out?

      Thanks,
      Rolf Njor Jensen

      The options for JSLint:
      /*jslint adsafe: true, safe: true, fragment: true, undef: true, regexp: true, strict: true, maxerr: 50, indent: 4 */

      The input:
      <div id="APP_">
      <script>"use strict";ADSAFE.id("APP_");</script>
      <script>ADSAFE.go(
      "APP_",
      function(){
      /**
      * The lib object is configured with properties and
      * methods according to the components "capabilities".
      * @param {object} lib
      */
      function Component ( lib ) {

      return {

      /**
      * Invoked when elem ent is first introduced (on page load or by AJAX update)
      * @param {object} dom The ADsafe dom wrapper
      */
      onload : function ( dom ) {},

      /**
      * Invoked whenever new data is found in the public RDF datasource.
      * @param {boolean} isIndexed True when data was indexed by RDFa in the page DOM.
      */
      ondata : function ( isIndexed ) {},

      /**
      * Invoked before element is updated (AJAX update)
      */
      onbeforeupdate : function () {},

      /**
      * Invoked after element is updated (AJAX update)
      * @param {object} dom The ADsafe dom wrapper.
      */
      onafterupdate : function ( dom ) {},

      /**
      * Invoked on window.unload
      */
      onunload : function () {}
      };
      }
      var foo = new Component();
      foo.doStuff();
      });
      </script></div>
    • Douglas Crockford
      ... JSLint now inspects the signatures of the functions passed to .id and .go. So ADSAFE.go( APP_ , function () { should have been ADSAFE.go( APP_ , function
      Message 2 of 2 , Apr 8, 2011
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "rolfnjorjensen_tradeshift" <rnj@...> wrote:
        >
        > We have been using an older version of JSLint ('2010-12-14') to validate code like the below. This has been going well, but when trying to upgrade to newest version ('2011-04-04'), the validation goes not so well.
        >
        > We have tried it out on the online edition, and get the same mysterious error.

        JSLint now inspects the signatures of the functions passed to .id and .go.

        So

        ADSAFE.go("APP_", function () {

        should have been

        ADSAFE.go("APP_", function (dom, lib) {

        The messaging was not very helpful and has been improved.

        I recommend always using the latest version. Sometimes researchers provide suggestions which are constantly strengthening the system.
      Your message has been successfully submitted and would be delivered to recipients shortly.