"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/json-parse-helpfulerror/index.js" (8 Mar 2017, 497 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 'use strict';
    2 
    3 var jju = require('jju');
    4 
    5 function parse(text, reviver) {
    6     try {
    7         return JSON.parse(text, reviver);
    8     } catch (err) {
    9         // we expect this to throw with a more informative message
   10         jju.parse(text, {
   11             mode: 'json',
   12             reviver: reviver
   13         });
   14 
   15         // backup if jju is not as strict as JSON.parse; re-throw error
   16         // data-dependent code path, I do not know how to cover it
   17         throw err;
   18     }
   19 }
   20 
   21 exports.parse = parse;