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

Re: [caplet] ADsafe

Expand Messages
  • Tyler Close
    What s the recommended idiom for iterating over the elements of an array? I had been using: for (var i = 0; i !== v.length; i += 1) { var element = v[+i]; ...
    Message 1 of 36 , Aug 16 11:51 AM
    • 0 Attachment
      What's the recommended idiom for iterating over the elements of an
      array? I had been using:

      for (var i = 0; i !== v.length; i += 1) {
      var element = v[+i];
      ...
      }

      Are you expecting array iteration to be done as:

      for (var i = 0; i !== v.length; i += 1) {
      var element = ADSAFE.get(v, i);
      ...
      }

      This is a little cumbersome.

      I'm looking for something that will work reliably across browsers,
      including IE6.

      Could JSLint be made smart enough to realize that the variable "i" in
      the above loop is always a positive number?

      --Tyler

      On Fri, Jul 31, 2009 at 9:20 AM, Douglas Crockford<douglas@...> wrote:
      > The ADsafe verifier now rejects programs that use the arguments pseudo array.
      >
      > The ADsafe verifier now rejects programs that use expressions with the subscript operator, even when the + prefix is used. The ADSAFE.get and ADSAFE.set methods must be used instead. The subscript operator may be used with positive number literals and string literals that do not begin with - or _.
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >



      --
      "Waterken News: Capability security on the Web"
      http://waterken.sourceforge.net/recent.html
    • Douglas Crockford
      I updated the ADsafe DOM interface. Previously, a method like .getValue() could return undefined a single value an array of values depending on the number of
      Message 36 of 36 , Nov 11, 2010
      • 0 Attachment
        I updated the ADsafe DOM interface. Previously, a method like .getValue() could return

        undefined
        a single value
        an array of values

        depending on the number of results. Now, a method like .getValue() will return the first value that is available, or undefined if there are none. A new method, .getValues() will always return an array, possibly an empty array.
      Your message has been successfully submitted and would be delivered to recipients shortly.