Skip to content

Commit

Permalink
fix to work on Haxe 3.2.0 stable
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel59 committed Jun 21, 2015
1 parent ed7340f commit 9591e91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions unifill/Utf16.hx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ abstract Utf16 (StringU16) {
`this`.
**/
public function codePointAt(index : Int) : Int {
return Utf16Impl.decode_code_point(length, codeUnitAt, index);
return Utf16Impl.decode_code_point(length, function(i) return codeUnitAt(i), index);
}

/**
Expand Down Expand Up @@ -87,7 +87,7 @@ abstract Utf16 (StringU16) {
position `index` of `this`.
**/
public inline function codePointWidthBefore(index : Int) : Int {
return Utf16Impl.find_prev_code_point(codeUnitAt, index);
return Utf16Impl.find_prev_code_point(function(i) return codeUnitAt(i), index);
}

/**
Expand Down Expand Up @@ -117,7 +117,7 @@ abstract Utf16 (StringU16) {
**/
public function validate() : Void {
var len = this.length;
var accessor = codeUnitAt;
var accessor = function(i) return codeUnitAt(i);
var i = 0;
while (i < len) {
Utf16Impl.decode_code_point(len, accessor, i);
Expand Down
6 changes: 3 additions & 3 deletions unifill/Utf8.hx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ abstract Utf8(StringU8) {
`this`.
**/
public function codePointAt(index : Int) : Int {
return Utf8Impl.decode_code_point(length, codeUnitAt, index);
return Utf8Impl.decode_code_point(length, function(i) return codeUnitAt(i), index);
}

/**
Expand Down Expand Up @@ -86,7 +86,7 @@ abstract Utf8(StringU8) {
position `index` of `this`.
**/
public inline function codePointWidthBefore(index : Int) : Int {
return Utf8Impl.find_prev_code_point(codeUnitAt, index);
return Utf8Impl.find_prev_code_point(function(i) return codeUnitAt(i), index);
}

/**
Expand Down Expand Up @@ -116,7 +116,7 @@ abstract Utf8(StringU8) {
**/
public function validate() : Void {
var len = this.length;
var accessor = codeUnitAt;
var accessor = function(i) return codeUnitAt(i);
var i = 0;
while (i < len) {
Utf8Impl.decode_code_point(len, accessor, i);
Expand Down

0 comments on commit 9591e91

Please sign in to comment.