Results 1 to 10 of 13

Thread: callParent() breaks Firefox when using js strict mode

Hybrid View

Previous Post Previous Post   Next Post Next Post
    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    65
    Vote Rating
    1
      1  

    Default callParent() breaks Firefox when using js strict mode

    Now this is strange: When I use "use strict"; and then define a class with a custom constructor, calling callParent() breaks Firefox (4 at least) with this error:
    Error: access to strict mode caller function is censored
    . It works in Chrome, though...

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Thanks, leaving this code here for when we get to this bug.

    Code:
    Ext.define('Test.Panel', {
        extend : 'Ext.panel.Panel',
    
        initComponent: function() {
            "use strict";
            var me = this;
    
            me.html  = 'Hello';
            me.title = 'Test';
    
            me.callParent(arguments);
        }
    });
    Ext.onReady(function() {
        var panel = Ext.create('Test.Panel', {
            renderTo : Ext.getBody(),
            width    : 400,
            height   : 400
        });
    });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Vote Rating
    18
      0  

    Default

    We don't support JavaScript strict mode via "use strict" (not to be confused with HTML strict mode)
    Sencha Touch Lead Architect

  4. #4
    Ext JS Premium Member kent78's Avatar
    Join Date
    Oct 2010
    Location
    Stockholm, Sweden
    Posts
    19
    Vote Rating
    0
      0  

    Default

    Do you plan to support "use strict"; in future releases of ExtJS or is it impossible to combine this with the Class Hierarchy approach that is used in ExtJS?

  5. #5
    Ext JS Premium Member johnwilander's Avatar
    Join Date
    Mar 2011
    Location
    Stockholm
    Posts
    12
    Vote Rating
    0
      0  

    Default

    Is this a design decision? Have other extension mechanisms not using parent (caller, callee) been considered?

    EcmaScript strict mode is a very good help for avoiding common pitfalls. It's also a security measure in production and using it allows for further optimization in JavaScript engines.

  6. #6
    Sencha User SunboX's Avatar
    Join Date
    Mar 2010
    Posts
    238
    Vote Rating
    28
      1  

    Default

    +1 for "strict mode" compatibility in future Versions (faster execution time).

  7. #7
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    83
    Vote Rating
    5
      1  

    Default

    +1 for "strict mode"

  8. #8
    Ext JS Premium Member
    Join Date
    Sep 2011
    Posts
    5
    Vote Rating
    2
      1  

    Default

    Please add this to the roadmap. +1

  9. #9
    Ext JS Premium Member
    Join Date
    Nov 2007
    Location
    Cologne, Germany
    Posts
    13
    Vote Rating
    7
      1  

    Default

    +1 for strict mode. I hope it was not a design decision to abuse the API and not being able to support strict mode at all.

  10. #10
    Sencha User
    Join Date
    Mar 2010
    Location
    Bay Area
    Posts
    152
    Vote Rating
    1
      0  

    Default

    The Ext JS 4 class system relies on arguments.caller and we don't see any way to support strict while retaining our class coding convention. We don't plan to change the API in any significant breaking way within the 4.x line, so this isn't on deck for happening in that code line. We're taking a fresh look for future major releases, but after the breakage from 3.x to 4.x, we're becoming extremely sensitive about changing large parts of the Ext API surface all at once.

Similar Threads

  1. Replies: 1
    Last Post: 28 Mar 2011, 2:43 PM
  2. Google map in Window, IE7 strict mode
    By dickp in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 26 Oct 2008, 1:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •