assigning to global toString variable affects Object.prototype.toString

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8
    • Component/s: core-libs
    • None
    • b82
    • generic
    • generic
    • Verified

      {code}
      toString = function() {
        print("global's toString called!!");
      }

      var obj = {};
      var str = obj.toString();
      if (str != "[object Object]") {
          print("FAILED: toString does not return expected value");
      }
      {code}

      prints

      global's toString called!!
      FAILED: toString does not return expected value

            Assignee:
            Sundararajan Athijegannathan
            Reporter:
            Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: