File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 33 "scripts" : {
44 "clean" : " rimraf output && rimraf .pulp-cache" ,
55 "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();\" " ,
78 "bench:build" : " purs compile 'bench/**/*.purs' 'src/**/*.purs' 'bower_components/*/src/**/*.purs'" ,
89 "bench:run" : " node --expose-gc -e 'require(\" ./output/Bench.Main/index.js\" ).main()'" ,
910 "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
415415unsafeCodePointAt0Fallback s =
416416 let
417417 cu0 = fromEnum (Unsafe .charAt 0 s)
418- cu1 = fromEnum (Unsafe .charAt 1 s)
419418 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