jindw / xmldom

A PURE JS W3C Standard based(XML DOM Level2 CORE) DOMParser and XMLSerializer.
Other
819 stars 265 forks source link

Fix strict mode syntax error #194

Open partap opened 7 years ago

partap commented 7 years ago

I ran across this error from an embedded STB version of Opera when including this library in a rollup bundle:

"Uncaught SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function."

It was preventing the entire bundle from being loaded... these changes satisfy the parser.

awerlang commented 7 years ago

How can we get this merged in? It is failing on iOS (Safari / Chrome).

awerlang commented 7 years ago

Thinking about that, the tooling (rollup) shouldn't be adding a "use strict" on top of this module, because it isn't intended to be run on a strict environment. It should add only for your own ES6 modules.