File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -96,14 +96,14 @@ const generateHandler = (options: Options): Handler => {
9696
9797 const handlerPunctuationUnified = ( token : MutableToken ) => {
9898 if ( token . type === GroupTokenType . GROUP ) {
99- if ( charMap [ token . modifiedStartValue ] ) {
99+ if ( Object . prototype . hasOwnProperty . call ( charMap , token . modifiedStartValue ) ) {
100100 checkStartValue (
101101 token ,
102102 charMap [ token . modifiedStartValue ] ,
103103 PUNCTUATION_UNIFICATION
104104 )
105105 }
106- if ( charMap [ token . modifiedEndValue ] ) {
106+ if ( Object . prototype . hasOwnProperty . call ( charMap , token . modifiedEndValue ) ) {
107107 checkEndValue (
108108 token ,
109109 charMap [ token . modifiedEndValue ] ,
@@ -112,7 +112,7 @@ const generateHandler = (options: Options): Handler => {
112112 }
113113 return
114114 } else {
115- if ( charMap [ token . modifiedValue ] ) {
115+ if ( Object . prototype . hasOwnProperty . call ( charMap , token . modifiedValue ) ) {
116116 checkValue (
117117 token ,
118118 charMap [ token . modifiedValue ] ,
Original file line number Diff line number Diff line change @@ -182,4 +182,9 @@ import ApiIndex from './ApiIndex.vue'
182182`
183183 expect ( getOutput ( text , options ) ) . toBe ( text )
184184 } )
185+ // https://github.com/zhlint-project/zhlint/issues/159
186+ test ( '#159 unexpected function () { [native code] }' , ( ) => {
187+ const text = `p.toString() 中文`
188+ expect ( getOutput ( text , options ) ) . toBe ( text )
189+ } )
185190} )
You can’t perform that action at this time.
0 commit comments