File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 3
3
"scripts" : {
4
4
"clean" : " rimraf output && rimraf .pulp-cache" ,
5
5
"build" : " eslint src && pulp build -- --censor-lib --strict" ,
6
- "test" : " pulp test" ,
6
+ "test" : " pulp test && npm run test:run:without_codePointAt" ,
7
+ "test:run:without_codePointAt" : " node -e \" delete String.prototype.codePointAt; require('./output/Test.Main/index.js').main();\" " ,
7
8
"bench:build" : " purs compile 'bench/**/*.purs' 'src/**/*.purs' 'bower_components/*/src/**/*.purs'" ,
8
9
"bench:run" : " node --expose-gc -e 'require(\" ./output/Bench.Main/index.js\" ).main()'" ,
9
10
"bench" : " npm run bench:build && npm run bench:run"
Original file line number Diff line number Diff line change @@ -415,8 +415,10 @@ unsafeCodePointAt0Fallback :: String -> CodePoint
415
415
unsafeCodePointAt0Fallback s =
416
416
let
417
417
cu0 = fromEnum (Unsafe .charAt 0 s)
418
- cu1 = fromEnum (Unsafe .charAt 1 s)
419
418
in
420
- if isLead cu0 && isTrail cu1
421
- then unsurrogate cu0 cu1
422
- else CodePoint cu0
419
+ if isLead cu0 && CU .length s > 1
420
+ then
421
+ let cu1 = fromEnum (Unsafe .charAt 1 s) in
422
+ if isTrail cu1 then unsurrogate cu0 cu1 else CodePoint cu0
423
+ else
424
+ CodePoint cu0
You can’t perform that action at this time.
0 commit comments