Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught byte order marker when bundling jsdom #1095

Closed
sterpe opened this issue Jan 26, 2015 · 1 comment
Closed

Uncaught byte order marker when bundling jsdom #1095

sterpe opened this issue Jan 26, 2015 · 1 comment
Labels

Comments

@sterpe
Copy link

sterpe commented Jan 26, 2015

This seems very similar to #313. There are BOM in 2 of jsdom's files, but in particular one is not getting caught -- the bom in jsdom/lib/jsdom/browser/Window.js

Steps to duplicate on OSX 10.9.5

npm install browserify@8.1.1 jsdom@3.0.2
ed index.js
i
var jsdom = require('jsdom').jsdom
.
wq
./node_modules/browserify/bin/cmd.js index.js -o bundle.js

Look at line 7698 in bundle.js with vim

},{"./jsdom/browser/documentfeatures":42,"./jsdom/browser/domtohtml":43,"./jsdom/browser/index":46,"./jsdom/living":65,"./jsdom/utils":71,"./jsdom/virtual-console":72,"_process":18,"fs":2,"path":17,"request":73,"url":36}],40:[function(require,module,exports){
(function (process,global){                                                      
<feff>"use strict";                                                              

var URL = require("url");                                                        
var CSSStyleDeclaration = require("cssstyle").CSSStyleDeclaration;               
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;                   
var dom = require("../level1/core");                                             
var NOT_IMPLEMENTED = require("./utils").NOT_IMPLEMENTED;                        
var createFrom = require("../utils").createFrom;                                 
var History = require("./history");                                              
var VirtualConsole = require("../virtual-console");                              

var cssSelectorSplitRE = /((?:[^,"']|"[^"]*"|'[^']*')+)/;                        

function matchesDontThrow(el, selector) {                                        
  try {                                                                          
    return el.matches(selector);                                                 
  } catch (e) {                                                                  
    return false;                                                                
  }                                                                              
}                                                                                
@goto-bus-stop
Copy link
Member

Fixed here: browserify/insert-module-globals#46

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants