Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8036686

Function.prototype.bind doesn't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 8, 8u20
    • core-libs
    • None
    • jdk8, b129

    • 8
    • generic
    • generic

      Run this code :
      var context = {
          b : 42
      }
      function a () {
          print(this.b)
      }
      a()
      var c = a.bind(context)
      c()

      output :
      undefined
      undefined // this is wrong, need "42"

            sundar Sundararajan Athijegannathan
            slugovoy Sergey Lugovoy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: