1

There is some JavaScript I want to debug (e.g. make something which was written for Ext JS 4 work with Ext JS 3). And there is function define, which is absent in version 3. I wanted just paste it's code, but don't know where it lies. I printed it:

>>> Ext.define.toString()
"function (i, j, h) { if (j.override) { return a.createOverride.apply(a, arguments); } return a.create.apply(a, arguments); }"

But still, I don't know what is a. How could I, having function object get the source for context of that object?

2
  • It's JavaScript: you can just read the source code, can't you? Commented Jan 3, 2014 at 12:06
  • 1
    You could also try to use Ext.define and then step into it using debugger. Commented Jan 3, 2014 at 12:10

2 Answers 2

1

You may update your ExtJS 3 to latest version. In ExtJS 3.4.1.1, which is the latest version of ExtJS you can download from Sencha website here.

As it was introduced in ExtJS 3.4.0 (once ExtJS 4 was out), the behaviour must be near the same, so maybe you will require less changes in the code to make it work with ExtJS 3

Sign up to request clarification or add additional context in comments.

Comments

1

Extracted from: https://extjs-public.googlecode.com/svn/extjs-4.x/include/ext-dev.js

define: function (className, data, createdFn) {
        Ext.classSystemMonitor && Ext.classSystemMonitor(className, 'ClassManager#define', arguments);

        if (data.override) {
            return Manager.createOverride.apply(Manager, arguments);
        }

        return Manager.create.apply(Manager, arguments);
    },

Apparently, your a is Manager. I doubt if this helps to move define to Ext 3 but here you go :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.