You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mircea Toma (Created) (JIRA)" <de...@myfaces.apache.org> on 2012/03/20 22:07:38 UTC

[jira] [Created] (MYFACES-3509) Array.prototype.forEach used in browsers that do not natively support this function

Array.prototype.forEach used in browsers that do not natively support this function
-----------------------------------------------------------------------------------

                 Key: MYFACES-3509
                 URL: https://issues.apache.org/jira/browse/MYFACES-3509
             Project: MyFaces Core
          Issue Type: Bug
          Components: General
         Environment: IE8
            Reporter: Mircea Toma


While running one of our test applications in IE8 we got this "Object doesn't support this property or method" error occurring.
After debugging the code the problem was located in api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js code. It seems that 'arrForEach' is trying to use the browser native 'forEach' function but it fails since IE8 (or IE7) does not implement it.

Here is a constructed call stack that shows when and where the error occurs:

(startPos) ? arr.slice(startPos).forEach(func, thisObj) : arr.forEach(func, thisObj); (file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js, line: 346)
this._Lang.arrForEach(this._q, closure, this._space); (file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Queue.js, line: 155)
this.each(broadCastFunc); (file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ListenerQueue.js, line: 80)
this._evtListeners.broadcastEvent(eventData); (file: api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js, line: 564)
....

I noticed that in api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_LangQuirks.js there's a version of 'arrForEach' function that iterates over elements using a plain 'for' loop. Unfortunately this version of the method is not loaded because of the condition at the top of the file is not fulfilled. I attached a patch that we used to get things going. Of course you might have a better solution to this issue.

Here's also the original JIRA case: http://jira.icesoft.org/browse/ICE-7899 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MYFACES-3509) Array.prototype.forEach used in browsers that do not natively support this function

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Werner Punz updated MYFACES-3509:
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.8-SNAPSHOT
                   2.0.14-SNAPSHOT
           Status: Resolved  (was: Patch Available)

Thanks for the patch, the fix now is applied

                
> Array.prototype.forEach used in browsers that do not natively support this function
> -----------------------------------------------------------------------------------
>
>                 Key: MYFACES-3509
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3509
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>         Environment: IE8
>            Reporter: Mircea Toma
>             Fix For: 2.0.14-SNAPSHOT, 2.1.8-SNAPSHOT
>
>         Attachments: MYFACES-3509-1.patch
>
>
> While running one of our test applications in IE8 we got this "Object doesn't support this property or method" error occurring.
> After debugging the code the problem was located in api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js code. It seems that 'arrForEach' is trying to use the browser native 'forEach' function but it fails since IE8 (or IE7) does not implement it.
> Here is a constructed call stack that shows when and where the error occurs:
> (startPos) ? arr.slice(startPos).forEach(func, thisObj) : arr.forEach(func, thisObj); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js, line: 346
> this._Lang.arrForEach(this._q, closure, this._space);  -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Queue.js, line: 155
> this.each(broadCastFunc); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ListenerQueue.js, line: 80
> this._evtListeners.broadcastEvent(eventData); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js, line: 564
> ....
> I noticed that in api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_LangQuirks.js there's a version of 'arrForEach' function that iterates over elements using a plain 'for' loop. Unfortunately this version of the method is not loaded because of the condition at the top of the file is not fulfilled. I attached a patch that we used to get things going. Of course you might have a better solution to this issue.
> Here's also the original JIRA case: http://jira.icesoft.org/browse/ICE-7899 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3509) Array.prototype.forEach used in browsers that do not natively support this function

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262912#comment-13262912 ] 

Leonardo Uribe commented on MYFACES-3509:
-----------------------------------------

Checking this issue I notice the patch was not provided in our jira, but is in ICE-7899. I took the idea and rebuilt the patch against latest code. 
                
> Array.prototype.forEach used in browsers that do not natively support this function
> -----------------------------------------------------------------------------------
>
>                 Key: MYFACES-3509
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3509
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>         Environment: IE8
>            Reporter: Mircea Toma
>         Attachments: MYFACES-3509-1.patch
>
>
> While running one of our test applications in IE8 we got this "Object doesn't support this property or method" error occurring.
> After debugging the code the problem was located in api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js code. It seems that 'arrForEach' is trying to use the browser native 'forEach' function but it fails since IE8 (or IE7) does not implement it.
> Here is a constructed call stack that shows when and where the error occurs:
> (startPos) ? arr.slice(startPos).forEach(func, thisObj) : arr.forEach(func, thisObj); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js, line: 346
> this._Lang.arrForEach(this._q, closure, this._space);  -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Queue.js, line: 155
> this.each(broadCastFunc); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ListenerQueue.js, line: 80
> this._evtListeners.broadcastEvent(eventData); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js, line: 564
> ....
> I noticed that in api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_LangQuirks.js there's a version of 'arrForEach' function that iterates over elements using a plain 'for' loop. Unfortunately this version of the method is not loaded because of the condition at the top of the file is not fulfilled. I attached a patch that we used to get things going. Of course you might have a better solution to this issue.
> Here's also the original JIRA case: http://jira.icesoft.org/browse/ICE-7899 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3509) Array.prototype.forEach used in browsers that do not natively support this function

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263711#comment-13263711 ] 

Werner Punz commented on MYFACES-3509:
--------------------------------------

I will check and apply the patch on monday.
                
> Array.prototype.forEach used in browsers that do not natively support this function
> -----------------------------------------------------------------------------------
>
>                 Key: MYFACES-3509
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3509
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>         Environment: IE8
>            Reporter: Mircea Toma
>         Attachments: MYFACES-3509-1.patch
>
>
> While running one of our test applications in IE8 we got this "Object doesn't support this property or method" error occurring.
> After debugging the code the problem was located in api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js code. It seems that 'arrForEach' is trying to use the browser native 'forEach' function but it fails since IE8 (or IE7) does not implement it.
> Here is a constructed call stack that shows when and where the error occurs:
> (startPos) ? arr.slice(startPos).forEach(func, thisObj) : arr.forEach(func, thisObj); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js, line: 346
> this._Lang.arrForEach(this._q, closure, this._space);  -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Queue.js, line: 155
> this.each(broadCastFunc); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ListenerQueue.js, line: 80
> this._evtListeners.broadcastEvent(eventData); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js, line: 564
> ....
> I noticed that in api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_LangQuirks.js there's a version of 'arrForEach' function that iterates over elements using a plain 'for' loop. Unfortunately this version of the method is not loaded because of the condition at the top of the file is not fulfilled. I attached a patch that we used to get things going. Of course you might have a better solution to this issue.
> Here's also the original JIRA case: http://jira.icesoft.org/browse/ICE-7899 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MYFACES-3509) Array.prototype.forEach used in browsers that do not natively support this function

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe updated MYFACES-3509:
------------------------------------

    Status: Patch Available  (was: Open)
    
> Array.prototype.forEach used in browsers that do not natively support this function
> -----------------------------------------------------------------------------------
>
>                 Key: MYFACES-3509
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3509
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>         Environment: IE8
>            Reporter: Mircea Toma
>         Attachments: MYFACES-3509-1.patch
>
>
> While running one of our test applications in IE8 we got this "Object doesn't support this property or method" error occurring.
> After debugging the code the problem was located in api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js code. It seems that 'arrForEach' is trying to use the browser native 'forEach' function but it fails since IE8 (or IE7) does not implement it.
> Here is a constructed call stack that shows when and where the error occurs:
> (startPos) ? arr.slice(startPos).forEach(func, thisObj) : arr.forEach(func, thisObj); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js, line: 346
> this._Lang.arrForEach(this._q, closure, this._space);  -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Queue.js, line: 155
> this.each(broadCastFunc); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ListenerQueue.js, line: 80
> this._evtListeners.broadcastEvent(eventData); -- file: api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js, line: 564
> ....
> I noticed that in api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_LangQuirks.js there's a version of 'arrForEach' function that iterates over elements using a plain 'for' loop. Unfortunately this version of the method is not loaded because of the condition at the top of the file is not fulfilled. I attached a patch that we used to get things going. Of course you might have a better solution to this issue.
> Here's also the original JIRA case: http://jira.icesoft.org/browse/ICE-7899 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira