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

Megemorphic scope access does not throw ReferenceError when property is missing

XMLWordPrintable

    • b83
    • generic
    • generic

        function check() {
            try { foo; return true } catch (e) { return false }
        }

        // This should alternate b/w false and true for all iterations
        // but after 16 iterations, both prints print "true"
        // => ReferenceError is not thrown in "check" method for "foo"
        // access after "foo" access becomes megamorphic
        for (var x = 0; x < 40; x++) {
            delete this.foo;
            print(check());
            foo = 44;
            print(check());
        }

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

                Created:
                Updated:
                Resolved: