Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

eval correction (segmentation fault)

  • Loading branch information...
commit 760397ee0d69a9a6cf159abbb53c4b7389f1e9e9 1 parent 1a9c310
Aymeric Vitte authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/browser/index.js
12 lib/browser/index.js
View
@@ -85,7 +85,6 @@ var canon=function(attr){ //border-color --> borderColor
var __cc=function(node,regexp) {
var str = node.__data.toString().replace(/^\s+/g,'').replace(/\s+$/g,'') ;
if (regexp.test(str)){
- console.log(str);
return true;
};
return false;
@@ -394,7 +393,7 @@ core.resourceLoader = {
//onload can be queued before readyState complete while element is not queued yet
//do not fire onload if resources not executed
if (onload[i].element.___data!='nothing') {
- onload[i].fn();//if resource loaded fire onload
+ try {onload[i].fn();} catch(ee) {console.log('onload error');};//if resource loaded fire onload
} else {
onload[i].element.__onload=onload[i].fn;//if not wait for resource loaded
}
@@ -463,7 +462,7 @@ core.resourceLoader = {
};
if ((elem._document.readyState=='complete')&&(elem.__onload)) {
- elem.__onload();
+ try {elem.__onload()} catch(ee) {console.log('onload error')};
};
queue.shift();
@@ -1224,7 +1223,6 @@ core.Document.prototype = {
//createEntityNode : function() {this.createComment();}, //fake
//createNotationNode : function() {this.createComment();}, //fake
getElementsByTagName : function(Name) {
- //console.log('NodeList '+Name);
var name=Name.toLowerCase();
if ('_'+name in this._Tnodelists) {
return this._Tnodelists['_'+name];
@@ -1816,7 +1814,11 @@ var DOMWindow=function(document) {
};
this.eval=function(str) { //Make sure eval does execute in window context (xhr result for example)
- return core.languageProcessors['javascript'](self,str,'');
+ if (typeof(str)!='string') {
+ return str;
+ } else {
+ return core.languageProcessors['javascript'](self,str,'');
+ }
};
this.parentNode=this;
this.document=this._document;
Please sign in to comment.
Something went wrong with that request. Please try again.