fix script constructor array check

This commit is contained in:
Wei Lu 2014-03-17 16:13:49 +08:00
parent b93a774414
commit 9f2da415ea
2 changed files with 6 additions and 5 deletions

View file

@ -6,7 +6,7 @@ var network = require('./network');
var Script = function(data) {
this.buffer = data || [];
if(!Array.isArray(data)) {
if(!Array.isArray(this.buffer)) {
throw new Error('expect Script to be initialized with Array, but got ' + data)
}
this.parse();