diff --git a/typo3/js/extjs/components/pagetree/javascript/contextmenu.js b/typo3/js/extjs/components/pagetree/javascript/contextmenu.js
index ee57739848446c81c43f894f616f6585580018ab..44eea13667cc7302c6d0e2623319da06c726c740 100644
--- a/typo3/js/extjs/components/pagetree/javascript/contextmenu.js
+++ b/typo3/js/extjs/components/pagetree/javascript/contextmenu.js
@@ -172,7 +172,7 @@ TYPO3.Components.PageTree.ContextMenu = Ext.extend(Ext.menu.Menu, {
 		}
 
 			// remove divider if it's the last item of the context menu
-		if (components.last() === '-') {
+		if (components[components.length - 1] === '-') {
 			components[components.length - 1] = '';
 		}