Wrong 'this' bound to eval call within a function when caller's 'this' is a Java object

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: None
    • Component/s: core-libs
    • None

        function func(arg) {
          (function() { print(eval('this')); }).call(arg);
        }

        func(this);
        func({});
        func({ toString: function() "foo" });
        func(new java.lang.Vector());

        Expected:

        [object global]
        [object Object]
        foo
        []

        Last one is toString value on empty Vector instance


        Actual output:

        [object global]
        [object Object]
        foo
        [object global]

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

                Created:
                Updated:
                Resolved: