sax 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/sax.js +13 -8
  2. package/package.json +1 -1
package/lib/sax.js CHANGED
@@ -780,7 +780,7 @@
780
780
  XML_NAMESPACE +
781
781
  '\n' +
782
782
  'Actual: ' +
783
- parser.attribValue,
783
+ parser.attribValue
784
784
  )
785
785
  } else if (
786
786
  local === 'xmlns' &&
@@ -792,7 +792,7 @@
792
792
  XMLNS_NAMESPACE +
793
793
  '\n' +
794
794
  'Actual: ' +
795
- parser.attribValue,
795
+ parser.attribValue
796
796
  )
797
797
  } else {
798
798
  var tag = parser.tag
@@ -834,7 +834,7 @@
834
834
  if (tag.prefix && !tag.uri) {
835
835
  strictFail(
836
836
  parser,
837
- 'Unbound namespace prefix: ' + JSON.stringify(parser.tagName),
837
+ 'Unbound namespace prefix: ' + JSON.stringify(parser.tagName)
838
838
  )
839
839
  tag.uri = qn.prefix
840
840
  }
@@ -873,7 +873,7 @@
873
873
  if (prefix && prefix !== 'xmlns' && !uri) {
874
874
  strictFail(
875
875
  parser,
876
- 'Unbound namespace prefix: ' + JSON.stringify(prefix),
876
+ 'Unbound namespace prefix: ' + JSON.stringify(prefix)
877
877
  )
878
878
  a.uri = prefix
879
879
  }
@@ -999,7 +999,12 @@
999
999
  }
1000
1000
  }
1001
1001
  entity = entity.replace(/^0+/, '')
1002
- if (isNaN(num) || numStr.toLowerCase() !== entity) {
1002
+ if (
1003
+ isNaN(num) ||
1004
+ numStr.toLowerCase() !== entity ||
1005
+ num < 0 ||
1006
+ num > 0x10ffff
1007
+ ) {
1003
1008
  strictFail(parser, 'Invalid character entity')
1004
1009
  return '&' + parser.entity + ';'
1005
1010
  }
@@ -1036,7 +1041,7 @@
1036
1041
  if (parser.closed) {
1037
1042
  return error(
1038
1043
  parser,
1039
- 'Cannot write after close. Assign an onready handler.',
1044
+ 'Cannot write after close. Assign an onready handler.'
1040
1045
  )
1041
1046
  }
1042
1047
  if (chunk === null) {
@@ -1188,7 +1193,7 @@
1188
1193
  if (parser.doctype || parser.sawRoot) {
1189
1194
  strictFail(
1190
1195
  parser,
1191
- 'Inappropriately located doctype declaration',
1196
+ 'Inappropriately located doctype declaration'
1192
1197
  )
1193
1198
  }
1194
1199
  parser.doctype = ''
@@ -1401,7 +1406,7 @@
1401
1406
  } else {
1402
1407
  strictFail(
1403
1408
  parser,
1404
- 'Forward-slash in opening tag not followed by >',
1409
+ 'Forward-slash in opening tag not followed by >'
1405
1410
  )
1406
1411
  parser.state = S.ATTRIB
1407
1412
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "sax",
3
3
  "description": "An evented streaming XML parser in JavaScript",
4
4
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
5
- "version": "1.4.2",
5
+ "version": "1.4.3",
6
6
  "main": "lib/sax.js",
7
7
  "license": "BlueOak-1.0.0",
8
8
  "scripts": {