syntaxError.js 795 B

123456789101112
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. try { JSON.parse(''); } catch(e) { WScript.Echo(e); }
  6. try { JSON.parse('--'); } catch(e) { WScript.Echo(e); }
  7. try { JSON.parse('{"asdf }'); } catch(e) { WScript.Echo(e); }
  8. try { JSON.parse('{"asdf" }'); } catch(e) { WScript.Echo(e); }
  9. try { JSON.parse('{"asdf":1'); } catch(e) { WScript.Echo(e); }
  10. try { JSON.parse("[23"); } catch(e) { WScript.Echo(e); }
  11. try { JSON.parse("[23,]"); } catch(e) { WScript.Echo(e); }