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

A possible bug about Object.setPrototypeOf().

    XMLWordPrintable

    Details

      Description

      A DESCRIPTION OF THE PROBLEM :
      A DESCRIPTION OF THE PROBLEM :
      #Version: jdk-13.0.1

      #Testcase:
      var foo = function(){
            var a = Object.setPrototypeOf("test", null);
            print(a);
      };
      foo();

      #Command:
      ./nashorn/jdk-13.0.1/bin/jjs --no-syntax-extensions=true --no-deprecation-warning=true --language=es6 testcase.js

      #Output:
      testcase.js:2 TypeError: test is not an Object.

      #Expected output:
      test

      #Description:
      According to ES standard , when running this testcase, the output should be "test", but nashorn threw a TypeError exception:test is not an Object.
      The references are as follows:
      http://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.setprototypeof


        Attachments

          Activity

            People

            Assignee:
            attila Attila Szegedi
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: