File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -217,5 +217,7 @@ function parsePlistXML (node) {
217217
218218 } else if ( node . nodeName === 'false' ) {
219219 return false ;
220+ } else {
221+ throw new Error ( 'Invalid PLIST tag ' + node . nodeName ) ;
220222 }
221223}
Original file line number Diff line number Diff line change @@ -437,6 +437,26 @@ int main(int argc, char *argv[])
437437 } ) ;
438438 } ) ;
439439
440+ it ( 'should fail parsing invalid xml plist' , function ( ) {
441+ var xml = multiline ( function ( ) {
442+ /*
443+ <?xml version="1.0" encoding="UTF-8"?>
444+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
445+ <plist version="1.0">
446+ <dict>
447+ <key>test</key>
448+ <strong>Testing</strong>
449+ <key>bar</key>
450+ <string></string>
451+ </dict>
452+ </plist>
453+ */
454+ } ) ;
455+ assert . throws ( function ( ) {
456+ var parsed = parse ( xml ) ;
457+ } ) ;
458+ } ) ;
459+
440460 it ( 'should parse an example "Xcode-Info.plist" file' , function ( ) {
441461 var xml = multiline ( function ( ) {
442462/*
You can’t perform that action at this time.
0 commit comments