mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-28 17:13:45 +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 */'
|
||||
].map(Buffer)
|
||||
]
|
||||
|
||||
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.closeSync(file)
|
||||
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