Allow overriding bytes.length on CommonJS
This commit is contained in:
@@ -608,7 +608,12 @@ import js.html.compat.DataView;
|
||||
|
||||
class Bytes {
|
||||
|
||||
#if commonjs
|
||||
public var length(get,set) : Int;
|
||||
var l : Int;
|
||||
#else
|
||||
public var length(default,null) : Int;
|
||||
#end
|
||||
var b : js.html.Uint8Array;
|
||||
var data : js.html.DataView;
|
||||
|
||||
@@ -812,6 +817,16 @@ class Bytes {
|
||||
return untyped b.bytes[pos];
|
||||
}
|
||||
|
||||
#if commonjs
|
||||
private function get_length() : Int {
|
||||
return l;
|
||||
}
|
||||
|
||||
private function set_length( v : Int ) : Int {
|
||||
return l = v;
|
||||
}
|
||||
#end
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user