소스 검색

Fixed String.fromCharCode()

Dmitry Panov 7 년 전
부모
커밋
4b0a4dce67
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      builtin_string.go
  2. 1 1
      builtin_string_test.go

+ 1 - 1
builtin_string.go

@@ -94,7 +94,7 @@ func (r *Runtime) string_fromcharcode(call FunctionCall) Value {
 		chr := toUInt16(arg)
 		chr := toUInt16(arg)
 		if chr >= utf8.RuneSelf {
 		if chr >= utf8.RuneSelf {
 			bb := make([]uint16, len(call.Arguments))
 			bb := make([]uint16, len(call.Arguments))
-			for j := 0; i < i; j++ {
+			for j := 0; j < i; j++ {
 				bb[j] = uint16(b[j])
 				bb[j] = uint16(b[j])
 			}
 			}
 			bb[i] = chr
 			bb[i] = chr

+ 1 - 1
builtin_string_test.go

@@ -82,7 +82,7 @@ assert.sameValue(
   'abc'.substr(3, undefined), '', 'start: 3, length: undefined'
   'abc'.substr(3, undefined), '', 'start: 3, length: undefined'
 );
 );
 
 
-
+assert.sameValue('A—', String.fromCharCode(65, 0x2014));
 
 
 	`
 	`