mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Change jsdom -> agent.node detection
This commit is contained in:
parent
f3e4c185fa
commit
4857f1d73a
1 changed files with 3 additions and 4 deletions
|
@ -95,7 +95,9 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
|
||||||
/^(node|trident)$/.test(n) ? rv : v1;
|
/^(node|trident)$/.test(n) ? rv : v1;
|
||||||
agent.version = v;
|
agent.version = v;
|
||||||
agent.versionNumber = parseFloat(v);
|
agent.versionNumber = parseFloat(v);
|
||||||
n = n === 'trident' ? 'msie' : n;
|
n = n === 'trident' ? 'msie'
|
||||||
|
: n === 'jsdom' ? 'node'
|
||||||
|
: n;
|
||||||
agent.name = n;
|
agent.name = n;
|
||||||
agent[n] = true;
|
agent[n] = true;
|
||||||
}
|
}
|
||||||
|
@ -105,9 +107,6 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
|
||||||
delete agent.webkit;
|
delete agent.webkit;
|
||||||
if (agent.atom)
|
if (agent.atom)
|
||||||
delete agent.chrome;
|
delete agent.chrome;
|
||||||
// In Node.js, the user agent set by JSDOM no longer includes `node`
|
|
||||||
// but `jsdom` instead. Preserve `agent.node`:
|
|
||||||
agent.node = agent.jsdom;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue