add JSAdapter example with fallthrough

XMLWordPrintable

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

        Scenario: provide some extensions to a Java object with a JSAdapter, but have all (other) method calls fall through to the original object to provide transparent adaption.

        The following implementation of __call__ facilitates this. Add an example that illustrates it. Verify it works for multiple arguments.

        __call__: function() {
            var args = [x].concat(Array.prototype.slice.call(arguments, 1))
            return Function.call.apply(x[arguments[0]], args)
        }

              Assignee:
              Michael Haupt
              Reporter:
              Michael Haupt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: