Iterating over string using for..in produces some methods

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.4.6
    • Component/s: JavaScript
    • None
    • Environment:
      Ubuntu 13.04 x86_64
    • Fully Compatible
    • Linux
    • Hide

      > str = "Mongo"
      Mongo
      > for (var c in str)

      { print(c) }

      Expected result:
      0
      1
      2
      3
      4

      Actual result:
      0
      1
      2
      3
      4
      ltrim
      rtrim
      startsWith
      endsWith
      pad


      I also tested it with the native V8 version 3.21.4 or with JavaScript in Chrome. It's working well there.

      Show
      > str = "Mongo" Mongo > for (var c in str) { print(c) } Expected result: 0 1 2 3 4 Actual result: 0 1 2 3 4 ltrim rtrim startsWith endsWith pad — I also tested it with the native V8 version 3.21.4 or with JavaScript in Chrome. It's working well there.
    • Platforms 13 (04/22/16), Platforms 14 (05/13/16)
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

            Assignee:
            Mira Carey
            Reporter:
            Jaromir Obr
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: