Changeset 1293


Ignore:
Timestamp:
11/22/10 19:01:04 (8 years ago)
Author:
ejucovy
Message:

use var foo = function() instead of function foo() when defining functions inside other functions, to prevent firebug 'cannot access optimized closure' error-masking (cf http://stackoverflow.com/questions/1154315/javascript-firebug-cannot-access-optimized-closure-what-does-it-mean)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Ticket1226/paraHandlerBest.js

    r1292 r1293  
    860860EnterParagraphs.RunTests = function(xinha, debug) 
    861861{ 
    862   function test(message, before, cursorBefore, after, cursorAfter, cursorAfter2) { 
     862  var test = function(message, before, cursorBefore, after, cursorAfter, cursorAfter2) { 
    863863    console.group('Test: ', message); 
    864864    if (before !== null) { 
     
    11341134  // Helper function that copies a DOM element and its attributes (except the 
    11351135  // id) without any of the contents. 
    1136   function safeShallowCopy(node, doc) 
     1136  var safeShallowCopy = function(node, doc) 
    11371137  { 
    11381138    var copy = doc.createElement(node.nodeName); 
     
    11531153  // node in the text is at a lower depth in the DOM tree, than we will return 
    11541154  // it's first parent that is at our depth our higher in the tree. 
    1155   function nextRootNode(node) 
     1155  var nextRootNode = function(node) 
    11561156  { 
    11571157    if (node.nextSibling) 
     
    11721172  // splitOffset is an offset into the text contents.  If not, it is an index 
    11731173  // into the childNodes array. 
    1174   function splitTree(root, splitNode, splitOffset, doc) 
     1174  var splitTree = function(root, splitNode, splitOffset, doc) 
    11751175  { 
    11761176    // Split root into two. 
     
    12431243    // An empty node is an text node of zero length or an element node with no 
    12441244    // children, or whose only children are zero-length text nodes. 
    1245     function emptyNode(node) 
     1245    var emptyNode = function(node) 
    12461246    { 
    12471247      if ((TEXT_NODE == node.nodeType) && (0 == node.nodeValue.length)) 
     
    12711271    } 
    12721272 
    1273     function stuffEmptyNode(node, doc) 
     1273    var stuffEmptyNode = function(node, doc) 
    12741274    { 
    12751275      if (!emptyNode(node)) 
     
    13131313    return newCursorNode; 
    13141314  } 
    1315   function insertLineBreak(cursorParent, cursorOffset, useNewline, doc) 
     1315  var insertLineBreak = function(cursorParent, cursorOffset, useNewline, doc) 
    13161316  { 
    13171317    if (TEXT_NODE == cursorParent.nodeType) 
Note: See TracChangeset for help on using the changeset viewer.