mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-29 09:34:58 +03:00
Don't use Buffer::equals
Node 0.10 doesn't have it
This commit is contained in:
parent
e4b1d512cd
commit
bea45b5921
@ -4,7 +4,7 @@ BABEL_PREFIXES = [
|
|||||||
"'use babel'"
|
"'use babel'"
|
||||||
'"use babel"'
|
'"use babel"'
|
||||||
'/** use babel */'
|
'/** use babel */'
|
||||||
].map(Buffer)
|
]
|
||||||
|
|
||||||
PREFIX_LENGTH = Math.max(BABEL_PREFIXES.map((prefix) -> prefix.length)...)
|
PREFIX_LENGTH = Math.max(BABEL_PREFIXES.map((prefix) -> prefix.length)...)
|
||||||
|
|
||||||
@ -15,4 +15,4 @@ module.exports = (filename) ->
|
|||||||
fs.readSync(file, buffer, 0, PREFIX_LENGTH)
|
fs.readSync(file, buffer, 0, PREFIX_LENGTH)
|
||||||
fs.closeSync(file)
|
fs.closeSync(file)
|
||||||
BABEL_PREFIXES.some (prefix) ->
|
BABEL_PREFIXES.some (prefix) ->
|
||||||
prefix.equals(buffer.slice(0, prefix.length))
|
prefix is buffer.toString('utf8', 0, prefix.length)
|
||||||
|
Loading…
Reference in New Issue
Block a user