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

Symbol.__proto__ results in error with format string placeholder

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b25
    • CPU:
      generic
    • OS:
      generic

      Description

      FULL PRODUCT VERSION :
      java version "9"
      Java(TM) SE Runtime Environment (build 9+181)
      Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 10.0.15063]

      A DESCRIPTION OF THE PROBLEM :
      When the __proto__ property is accessed for a symbol, the message of the thrown TypeError is a format string with a {0} placeholder.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run: jjs --language=es6

      jjs> var sym = Symbol('foo');
      jjs> sym.__proto__
      ECMAScript Exception: TypeError: {0} is not a symbol.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Unsure, but not a raw format string.

      Node doesn't throw an error:

      > var s = Symbol('foo')
      undefined
      > s.__proto__
      Symbol {}
      ACTUAL -
      ECMAScript Exception: TypeError: {0} is not a symbol.

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Activity

            People

            Assignee:
            pmuthuswamy Priya Lakshmi Muthuswamy (Inactive)
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: