File tree 2 files changed +8
-3
lines changed
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 => {
96
96
97
97
const handlerPunctuationUnified = ( token : MutableToken ) => {
98
98
if ( token . type === GroupTokenType . GROUP ) {
99
- if ( charMap [ token . modifiedStartValue ] ) {
99
+ if ( Object . prototype . hasOwnProperty . call ( charMap , token . modifiedStartValue ) ) {
100
100
checkStartValue (
101
101
token ,
102
102
charMap [ token . modifiedStartValue ] ,
103
103
PUNCTUATION_UNIFICATION
104
104
)
105
105
}
106
- if ( charMap [ token . modifiedEndValue ] ) {
106
+ if ( Object . prototype . hasOwnProperty . call ( charMap , token . modifiedEndValue ) ) {
107
107
checkEndValue (
108
108
token ,
109
109
charMap [ token . modifiedEndValue ] ,
@@ -112,7 +112,7 @@ const generateHandler = (options: Options): Handler => {
112
112
}
113
113
return
114
114
} else {
115
- if ( charMap [ token . modifiedValue ] ) {
115
+ if ( Object . prototype . hasOwnProperty . call ( charMap , token . modifiedValue ) ) {
116
116
checkValue (
117
117
token ,
118
118
charMap [ token . modifiedValue ] ,
Original file line number Diff line number Diff line change @@ -182,4 +182,9 @@ import ApiIndex from './ApiIndex.vue'
182
182
`
183
183
expect ( getOutput ( text , options ) ) . toBe ( text )
184
184
} )
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
+ } )
185
190
} )
You can’t perform that action at this time.
0 commit comments