1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/lunarsf-Lunar-Markdown-Editor

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Это зеркальный репозиторий, синхронизируется ежедневно с исходного репозитория.
Клонировать/Скачать
json2.js 160 КБ
Копировать Редактировать Исходные данные Просмотреть построчно История
LunarSF Отправлено 9 лет назад ab5a981
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692
<!DOCTYPE html>
<html lang="en" class="">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#">
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Language" content="en">
<title>JSON-js/json2.js at master · douglascrockford/JSON-js · GitHub</title>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-114.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-144.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144.png">
<meta property="fb:app_id" content="1401488693436528">
<meta content="@github" name="twitter:site" /><meta content="summary" name="twitter:card" /><meta content="douglascrockford/JSON-js" name="twitter:title" /><meta content="JSON-js - JSON in JavaScript" name="twitter:description" /><meta content="https://avatars0.githubusercontent.com/u/262641?v=3&amp;s=400" name="twitter:image:src" />
<meta content="GitHub" property="og:site_name" /><meta content="object" property="og:type" /><meta content="https://avatars0.githubusercontent.com/u/262641?v=3&amp;s=400" property="og:image" /><meta content="douglascrockford/JSON-js" property="og:title" /><meta content="https://github.com/douglascrockford/JSON-js" property="og:url" /><meta content="JSON-js - JSON in JavaScript" property="og:description" />
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<link rel="assets" href="https://assets-cdn.github.com/">
<meta name="pjax-timeout" content="1000">
<meta name="msapplication-TileImage" content="/windows-tile.png">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="selected-link" value="repo_source" data-pjax-transient>
<meta name="google-analytics" content="UA-3769691-2">
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="collector-cdn.github.com" name="octolytics-script-host" /><meta content="github" name="octolytics-app-id" /><meta content="7B48CD6E:5977:404CB9:555C280C" name="octolytics-dimension-request_id" />
<meta content="Rails, view, blob#show" name="analytics-event" />
<meta class="js-ga-set" name="dimension1" content="Logged Out">
<meta class="js-ga-set" name="dimension2" content="Header v3">
<meta name="is-dotcom" content="true">
<meta name="hostname" content="github.com">
<meta name="user-login" content="">
<link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
<meta content="authenticity_token" name="csrf-param" />
<meta content="od8295/ylfwH33m8U07qCXE3wDpvT1/f2rLJQFcdTAghitmBU8hxSBzH76Qm0JxXW7VThPYZWKNmlVhxREX9ag==" name="csrf-token" />
<link href="https://assets-cdn.github.com/assets/github/index-d80e093fe7c48ff920ce83dfd2ad7c02806722220d164b49101ed783098ea618.css" media="all" rel="stylesheet" />
<link href="https://assets-cdn.github.com/assets/github2/index-cc3e6c8c525c5d69e57fa5832f1e8bb0656cb7aa92f265d900e29b187f0ce6e0.css" media="all" rel="stylesheet" />
<meta http-equiv="x-pjax-version" content="cdc3eb5ac26428a86cca8ad6e59d72f5">
<meta name="description" content="JSON-js - JSON in JavaScript">
<meta name="go-import" content="github.com/douglascrockford/JSON-js git https://github.com/douglascrockford/JSON-js.git">
<meta content="262641" name="octolytics-dimension-user_id" /><meta content="douglascrockford" name="octolytics-dimension-user_login" /><meta content="1092277" name="octolytics-dimension-repository_id" /><meta content="douglascrockford/JSON-js" name="octolytics-dimension-repository_nwo" /><meta content="true" name="octolytics-dimension-repository_public" /><meta content="false" name="octolytics-dimension-repository_is_fork" /><meta content="1092277" name="octolytics-dimension-repository_network_root_id" /><meta content="douglascrockford/JSON-js" name="octolytics-dimension-repository_network_root_nwo" />
<link href="https://github.com/douglascrockford/JSON-js/commits/master.atom" rel="alternate" title="Recent Commits to JSON-js:master" type="application/atom+xml">
</head>
<body class="logged_out env-production windows vis-public page-blob">
<a href="#start-of-content" tabindex="1" class="accessibility-aid js-skip-to-content">Skip to content</a>
<div class="wrapper">
<div class="header header-logged-out" role="banner">
<div class="container clearfix">
<a class="header-logo-wordmark" href="https://github.com/" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark">
<span class="mega-octicon octicon-logo-github"></span>
</a>
<div class="header-actions" role="navigation">
<a class="btn btn-primary" href="/join" data-ga-click="(Logged out) Header, clicked Sign up, text:sign-up">Sign up</a>
<a class="btn" href="/login?return_to=%2Fdouglascrockford%2FJSON-js%2Fblob%2Fmaster%2Fjson2.js" data-ga-click="(Logged out) Header, clicked Sign in, text:sign-in">Sign in</a>
</div>
<div class="site-search repo-scope js-site-search" role="search">
<form accept-charset="UTF-8" action="/douglascrockford/JSON-js/search" class="js-site-search-form" data-global-search-url="/search" data-repo-search-url="/douglascrockford/JSON-js/search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
<label class="js-chromeless-input-container form-control">
<div class="scope-badge">This repository</div>
<input type="text"
class="js-site-search-focus js-site-search-field is-clearable chromeless-input"
data-hotkey="s"
name="q"
placeholder="Search"
data-global-scope-placeholder="Search GitHub"
data-repo-scope-placeholder="Search"
tabindex="1"
autocapitalize="off">
</label>
</form>
</div>
<ul class="header-nav left" role="navigation">
<li class="header-nav-item">
<a class="header-nav-link" href="/explore" data-ga-click="(Logged out) Header, go to explore, text:explore">Explore</a>
</li>
<li class="header-nav-item">
<a class="header-nav-link" href="/features" data-ga-click="(Logged out) Header, go to features, text:features">Features</a>
</li>
<li class="header-nav-item">
<a class="header-nav-link" href="https://enterprise.github.com/" data-ga-click="(Logged out) Header, go to enterprise, text:enterprise">Enterprise</a>
</li>
<li class="header-nav-item">
<a class="header-nav-link" href="/blog" data-ga-click="(Logged out) Header, go to blog, text:blog">Blog</a>
</li>
</ul>
</div>
</div>
<div id="start-of-content" class="accessibility-aid"></div>
<div class="site" itemscope itemtype="http://schema.org/WebPage">
<div id="js-flash-container">
</div>
<div class="pagehead repohead instapaper_ignore readability-menu">
<div class="container">
<ul class="pagehead-actions">
<li>
<a href="/login?return_to=%2Fdouglascrockford%2FJSON-js"
class="btn btn-sm btn-with-count tooltipped tooltipped-n"
aria-label="You must be signed in to watch a repository" rel="nofollow">
<span class="octicon octicon-eye"></span>
Watch
</a>
<a class="social-count" href="/douglascrockford/JSON-js/watchers">
432
</a>
</li>
<li>
<a href="/login?return_to=%2Fdouglascrockford%2FJSON-js"
class="btn btn-sm btn-with-count tooltipped tooltipped-n"
aria-label="You must be signed in to star a repository" rel="nofollow">
<span class="octicon octicon-star"></span>
Star
</a>
<a class="social-count js-social-count" href="/douglascrockford/JSON-js/stargazers">
5,162
</a>
</li>
<li>
<a href="/login?return_to=%2Fdouglascrockford%2FJSON-js"
class="btn btn-sm btn-with-count tooltipped tooltipped-n"
aria-label="You must be signed in to fork a repository" rel="nofollow">
<span class="octicon octicon-repo-forked"></span>
Fork
</a>
<a href="/douglascrockford/JSON-js/network" class="social-count">
3,162
</a>
</li>
</ul>
<h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-title public">
<span class="mega-octicon octicon-repo"></span>
<span class="author"><a href="/douglascrockford" class="url fn" itemprop="url" rel="author"><span itemprop="title">douglascrockford</span></a></span><!--
--><span class="path-divider">/</span><!--
--><strong><a href="/douglascrockford/JSON-js" class="js-current-repository" data-pjax="#js-repo-pjax-container">JSON-js</a></strong>
<span class="page-context-loader">
<img alt="" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
</span>
</h1>
</div><!-- /.container -->
</div><!-- /.repohead -->
<div class="container">
<div class="repository-with-sidebar repo-container new-discussion-timeline ">
<div class="repository-sidebar clearfix">
<nav class="sunken-menu repo-nav js-repo-nav js-sidenav-container-pjax js-octicon-loaders"
role="navigation"
data-pjax="#js-repo-pjax-container"
data-issue-count-url="/douglascrockford/JSON-js/issues/counts">
<ul class="sunken-menu-group">
<li class="tooltipped tooltipped-w" aria-label="Code">
<a href="/douglascrockford/JSON-js" aria-label="Code" class="selected js-selected-navigation-item sunken-menu-item" data-hotkey="g c" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches /douglascrockford/JSON-js">
<span class="octicon octicon-code"></span> <span class="full-word">Code</span>
<img alt="" class="mini-loader" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
</a> </li>
<li class="tooltipped tooltipped-w" aria-label="Pull requests">
<a href="/douglascrockford/JSON-js/pulls" aria-label="Pull requests" class="js-selected-navigation-item sunken-menu-item" data-hotkey="g p" data-selected-links="repo_pulls /douglascrockford/JSON-js/pulls">
<span class="octicon octicon-git-pull-request"></span> <span class="full-word">Pull requests</span>
<span class="js-pull-replace-counter"></span>
<img alt="" class="mini-loader" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
</a> </li>
</ul>
<div class="sunken-menu-separator"></div>
<ul class="sunken-menu-group">
<li class="tooltipped tooltipped-w" aria-label="Pulse">
<a href="/douglascrockford/JSON-js/pulse" aria-label="Pulse" class="js-selected-navigation-item sunken-menu-item" data-selected-links="pulse /douglascrockford/JSON-js/pulse">
<span class="octicon octicon-pulse"></span> <span class="full-word">Pulse</span>
<img alt="" class="mini-loader" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
</a> </li>
<li class="tooltipped tooltipped-w" aria-label="Graphs">
<a href="/douglascrockford/JSON-js/graphs" aria-label="Graphs" class="js-selected-navigation-item sunken-menu-item" data-selected-links="repo_graphs repo_contributors /douglascrockford/JSON-js/graphs">
<span class="octicon octicon-graph"></span> <span class="full-word">Graphs</span>
<img alt="" class="mini-loader" height="16" src="https://assets-cdn.github.com/assets/spinners/octocat-spinner-32-e513294efa576953719e4e2de888dd9cf929b7d62ed8d05f25e731d02452ab6c.gif" width="16" />
</a> </li>
</ul>
</nav>
<div class="only-with-full-nav">
<div class="clone-url open"
data-protocol-type="http"
data-url="/users/set_protocol?protocol_selector=http&amp;protocol_type=clone">
<h3><span class="text-emphasized">HTTPS</span> clone URL</h3>
<div class="input-group js-zeroclipboard-container">
<input type="text" class="input-mini input-monospace js-url-field js-zeroclipboard-target"
value="https://github.com/douglascrockford/JSON-js.git" readonly="readonly">
<span class="input-group-button">
<button aria-label="Copy to clipboard" class="js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s" data-copied-hint="Copied!" type="button"><span class="octicon octicon-clippy"></span></button>
</span>
</div>
</div>
<div class="clone-url "
data-protocol-type="subversion"
data-url="/users/set_protocol?protocol_selector=subversion&amp;protocol_type=clone">
<h3><span class="text-emphasized">Subversion</span> checkout URL</h3>
<div class="input-group js-zeroclipboard-container">
<input type="text" class="input-mini input-monospace js-url-field js-zeroclipboard-target"
value="https://github.com/douglascrockford/JSON-js" readonly="readonly">
<span class="input-group-button">
<button aria-label="Copy to clipboard" class="js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s" data-copied-hint="Copied!" type="button"><span class="octicon octicon-clippy"></span></button>
</span>
</div>
</div>
<p class="clone-options">You can clone with
<a href="#" class="js-clone-selector" data-protocol="http">HTTPS</a> or <a href="#" class="js-clone-selector" data-protocol="subversion">Subversion</a>.
<a href="https://help.github.com/articles/which-remote-url-should-i-use" class="help tooltipped tooltipped-n" aria-label="Get help on which URL is right for you.">
<span class="octicon octicon-question"></span>
</a>
</p>
<a href="https://windows.github.com" class="btn btn-sm sidebar-button" title="Save douglascrockford/JSON-js to your computer and use it in GitHub Desktop." aria-label="Save douglascrockford/JSON-js to your computer and use it in GitHub Desktop.">
<span class="octicon octicon-device-desktop"></span>
Clone in Desktop
</a>
<a href="/douglascrockford/JSON-js/archive/master.zip"
class="btn btn-sm sidebar-button"
aria-label="Download the contents of douglascrockford/JSON-js as a zip file"
title="Download the contents of douglascrockford/JSON-js as a zip file"
rel="nofollow">
<span class="octicon octicon-cloud-download"></span>
Download ZIP
</a>
</div>
</div><!-- /.repository-sidebar -->
<div id="js-repo-pjax-container" class="repository-content context-loader-container" data-pjax-container>
<a href="/douglascrockford/JSON-js/blob/c98948ae1944a28e2e8ebc3717894e580aeaaa05/json2.js" class="hidden js-permalink-shortcut" data-hotkey="y">Permalink</a>
<!-- blob contrib key: blob_contributors:v21:c5a2927b27ce37ac9e5507ef954a149b -->
<div class="file-navigation js-zeroclipboard-container">
<div class="select-menu js-menu-container js-select-menu left">
<span class="btn btn-sm select-menu-button js-menu-target css-truncate" data-hotkey="w"
data-master-branch="master"
data-ref="master"
title="master"
role="button" aria-label="Switch branches or tags" tabindex="0" aria-haspopup="true">
<span class="octicon octicon-git-branch"></span>
<i>branch:</i>
<span class="js-select-button css-truncate-target">master</span>
</span>
<div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax aria-hidden="true">
<div class="select-menu-modal">
<div class="select-menu-header">
<span class="select-menu-title">Switch branches/tags</span>
<span class="octicon octicon-x js-menu-close" role="button" aria-label="Close"></span>
</div>
<div class="select-menu-filters">
<div class="select-menu-text-filter">
<input type="text" aria-label="Filter branches/tags" id="context-commitish-filter-field" class="js-filterable-field js-navigation-enable" placeholder="Filter branches/tags">
</div>
<div class="select-menu-tabs">
<ul>
<li class="select-menu-tab">
<a href="#" data-tab-filter="branches" data-filter-placeholder="Filter branches/tags" class="js-select-menu-tab">Branches</a>
</li>
<li class="select-menu-tab">
<a href="#" data-tab-filter="tags" data-filter-placeholder="Find a tag…" class="js-select-menu-tab">Tags</a>
</li>
</ul>
</div>
</div>
<div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches">
<div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
<a class="select-menu-item js-navigation-item js-navigation-open selected"
href="/douglascrockford/JSON-js/blob/master/json2.js"
data-name="master"
data-skip-pjax="true"
rel="nofollow">
<span class="select-menu-item-icon octicon octicon-check"></span>
<span class="select-menu-item-text css-truncate-target" title="master">
master
</span>
</a>
</div>
<div class="select-menu-no-results">Nothing to show</div>
</div>
<div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags">
<div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
</div>
<div class="select-menu-no-results">Nothing to show</div>
</div>
</div>
</div>
</div>
<div class="btn-group right">
<a href="/douglascrockford/JSON-js/find/master"
class="js-show-file-finder btn btn-sm empty-icon tooltipped tooltipped-s"
data-pjax
data-hotkey="t"
aria-label="Quickly jump between files">
<span class="octicon octicon-list-unordered"></span>
</a>
<button aria-label="Copy file path to clipboard" class="js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s" data-copied-hint="Copied!" type="button"><span class="octicon octicon-clippy"></span></button>
</div>
<div class="breadcrumb js-zeroclipboard-target">
<span class='repo-root js-repo-root'><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/douglascrockford/JSON-js" class="" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">JSON-js</span></a></span></span><span class="separator">/</span><strong class="final-path">json2.js</strong>
</div>
</div>
<div class="commit file-history-tease">
<div class="file-history-tease-header">
<img alt="@douglascrockford" class="avatar" data-user="262641" height="24" src="https://avatars2.githubusercontent.com/u/262641?v=3&amp;s=48" width="24" />
<span class="author"><a href="/douglascrockford" rel="author">douglascrockford</a></span>
<time datetime="2015-05-03T13:03:46Z" is="relative-time">May 3, 2015</time>
<div class="commit-title">
<a href="/douglascrockford/JSON-js/commit/04768c45a73fa390d2e856f8958690535ed8588f" class="message" data-pjax="true" title="rx">rx</a>
</div>
</div>
<div class="participation">
<p class="quickstat">
<a href="#blob_contributors_box" rel="facebox">
<strong>1</strong>
contributor
</a>
</p>
</div>
<div id="blob_contributors_box" style="display:none">
<h2 class="facebox-header">Users who have contributed to this file</h2>
<ul class="facebox-user-list">
<li class="facebox-user-list-item">
<img alt="@douglascrockford" data-user="262641" height="24" src="https://avatars2.githubusercontent.com/u/262641?v=3&amp;s=48" width="24" />
<a href="/douglascrockford">douglascrockford</a>
</li>
</ul>
</div>
</div>
<div class="file">
<div class="file-header">
<div class="file-actions">
<div class="btn-group">
<a href="/douglascrockford/JSON-js/raw/master/json2.js" class="btn btn-sm " id="raw-url">Raw</a>
<a href="/douglascrockford/JSON-js/blame/master/json2.js" class="btn btn-sm js-update-url-with-hash">Blame</a>
<a href="/douglascrockford/JSON-js/commits/master/json2.js" class="btn btn-sm " rel="nofollow">History</a>
</div>
<a class="octicon-btn tooltipped tooltipped-nw"
href="https://windows.github.com"
aria-label="Open this file in GitHub for Windows"
data-ga-click="Repository, open with desktop, type:windows">
<span class="octicon octicon-device-desktop"></span>
</a>
<button type="button" class="octicon-btn disabled tooltipped tooltipped-n" aria-label="You must be signed in to make or propose changes">
<span class="octicon octicon-pencil"></span>
</button>
<button type="button" class="octicon-btn octicon-btn-danger disabled tooltipped tooltipped-n" aria-label="You must be signed in to make or propose changes">
<span class="octicon octicon-trashcan"></span>
</button>
</div>
<div class="file-info">
520 lines (400 sloc)
<span class="file-info-divider"></span>
18.423 kb
</div>
</div>
<div class="blob-wrapper data type-javascript">
<table class="highlight tab-size-8 js-file-line-container">
<tr>
<td id="L1" class="blob-num js-line-number" data-line-number="1"></td>
<td id="LC1" class="blob-code blob-code-inner js-file-line"><span class="pl-c">/*</span></td>
</tr>
<tr>
<td id="L2" class="blob-num js-line-number" data-line-number="2"></td>
<td id="LC2" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> json2.js</span></td>
</tr>
<tr>
<td id="L3" class="blob-num js-line-number" data-line-number="3"></td>
<td id="LC3" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> 2015-05-03</span></td>
</tr>
<tr>
<td id="L4" class="blob-num js-line-number" data-line-number="4"></td>
<td id="LC4" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L5" class="blob-num js-line-number" data-line-number="5"></td>
<td id="LC5" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Public Domain.</span></td>
</tr>
<tr>
<td id="L6" class="blob-num js-line-number" data-line-number="6"></td>
<td id="LC6" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L7" class="blob-num js-line-number" data-line-number="7"></td>
<td id="LC7" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.</span></td>
</tr>
<tr>
<td id="L8" class="blob-num js-line-number" data-line-number="8"></td>
<td id="LC8" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L9" class="blob-num js-line-number" data-line-number="9"></td>
<td id="LC9" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> See http://www.JSON.org/js.html</span></td>
</tr>
<tr>
<td id="L10" class="blob-num js-line-number" data-line-number="10"></td>
<td id="LC10" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L11" class="blob-num js-line-number" data-line-number="11"></td>
<td id="LC11" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L12" class="blob-num js-line-number" data-line-number="12"></td>
<td id="LC12" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> This code should be minified before deployment.</span></td>
</tr>
<tr>
<td id="L13" class="blob-num js-line-number" data-line-number="13"></td>
<td id="LC13" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> See http://javascript.crockford.com/jsmin.html</span></td>
</tr>
<tr>
<td id="L14" class="blob-num js-line-number" data-line-number="14"></td>
<td id="LC14" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L15" class="blob-num js-line-number" data-line-number="15"></td>
<td id="LC15" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO</span></td>
</tr>
<tr>
<td id="L16" class="blob-num js-line-number" data-line-number="16"></td>
<td id="LC16" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> NOT CONTROL.</span></td>
</tr>
<tr>
<td id="L17" class="blob-num js-line-number" data-line-number="17"></td>
<td id="LC17" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L18" class="blob-num js-line-number" data-line-number="18"></td>
<td id="LC18" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L19" class="blob-num js-line-number" data-line-number="19"></td>
<td id="LC19" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> This file creates a global JSON object containing two methods: stringify</span></td>
</tr>
<tr>
<td id="L20" class="blob-num js-line-number" data-line-number="20"></td>
<td id="LC20" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> and parse. This file is provides the ES5 JSON capability to ES3 systems.</span></td>
</tr>
<tr>
<td id="L21" class="blob-num js-line-number" data-line-number="21"></td>
<td id="LC21" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> If a project might run on IE8 or earlier, then this file should be included.</span></td>
</tr>
<tr>
<td id="L22" class="blob-num js-line-number" data-line-number="22"></td>
<td id="LC22" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> This file does nothing on ES5 systems.</span></td>
</tr>
<tr>
<td id="L23" class="blob-num js-line-number" data-line-number="23"></td>
<td id="LC23" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L24" class="blob-num js-line-number" data-line-number="24"></td>
<td id="LC24" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> JSON.stringify(value, replacer, space)</span></td>
</tr>
<tr>
<td id="L25" class="blob-num js-line-number" data-line-number="25"></td>
<td id="LC25" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> value any JavaScript value, usually an object or array.</span></td>
</tr>
<tr>
<td id="L26" class="blob-num js-line-number" data-line-number="26"></td>
<td id="LC26" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L27" class="blob-num js-line-number" data-line-number="27"></td>
<td id="LC27" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> replacer an optional parameter that determines how object</span></td>
</tr>
<tr>
<td id="L28" class="blob-num js-line-number" data-line-number="28"></td>
<td id="LC28" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> values are stringified for objects. It can be a</span></td>
</tr>
<tr>
<td id="L29" class="blob-num js-line-number" data-line-number="29"></td>
<td id="LC29" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> function or an array of strings.</span></td>
</tr>
<tr>
<td id="L30" class="blob-num js-line-number" data-line-number="30"></td>
<td id="LC30" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L31" class="blob-num js-line-number" data-line-number="31"></td>
<td id="LC31" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> space an optional parameter that specifies the indentation</span></td>
</tr>
<tr>
<td id="L32" class="blob-num js-line-number" data-line-number="32"></td>
<td id="LC32" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> of nested structures. If it is omitted, the text will</span></td>
</tr>
<tr>
<td id="L33" class="blob-num js-line-number" data-line-number="33"></td>
<td id="LC33" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> be packed without extra whitespace. If it is a number,</span></td>
</tr>
<tr>
<td id="L34" class="blob-num js-line-number" data-line-number="34"></td>
<td id="LC34" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> it will specify the number of spaces to indent at each</span></td>
</tr>
<tr>
<td id="L35" class="blob-num js-line-number" data-line-number="35"></td>
<td id="LC35" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> level. If it is a string (such as &#39;\t&#39; or &#39;&amp;nbsp;&#39;),</span></td>
</tr>
<tr>
<td id="L36" class="blob-num js-line-number" data-line-number="36"></td>
<td id="LC36" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> it contains the characters used to indent at each level.</span></td>
</tr>
<tr>
<td id="L37" class="blob-num js-line-number" data-line-number="37"></td>
<td id="LC37" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L38" class="blob-num js-line-number" data-line-number="38"></td>
<td id="LC38" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> This method produces a JSON text from a JavaScript value.</span></td>
</tr>
<tr>
<td id="L39" class="blob-num js-line-number" data-line-number="39"></td>
<td id="LC39" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L40" class="blob-num js-line-number" data-line-number="40"></td>
<td id="LC40" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> When an object value is found, if the object contains a toJSON</span></td>
</tr>
<tr>
<td id="L41" class="blob-num js-line-number" data-line-number="41"></td>
<td id="LC41" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> method, its toJSON method will be called and the result will be</span></td>
</tr>
<tr>
<td id="L42" class="blob-num js-line-number" data-line-number="42"></td>
<td id="LC42" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> stringified. A toJSON method does not serialize: it returns the</span></td>
</tr>
<tr>
<td id="L43" class="blob-num js-line-number" data-line-number="43"></td>
<td id="LC43" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> value represented by the name/value pair that should be serialized,</span></td>
</tr>
<tr>
<td id="L44" class="blob-num js-line-number" data-line-number="44"></td>
<td id="LC44" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> or undefined if nothing should be serialized. The toJSON method</span></td>
</tr>
<tr>
<td id="L45" class="blob-num js-line-number" data-line-number="45"></td>
<td id="LC45" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> will be passed the key associated with the value, and this will be</span></td>
</tr>
<tr>
<td id="L46" class="blob-num js-line-number" data-line-number="46"></td>
<td id="LC46" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> bound to the value</span></td>
</tr>
<tr>
<td id="L47" class="blob-num js-line-number" data-line-number="47"></td>
<td id="LC47" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L48" class="blob-num js-line-number" data-line-number="48"></td>
<td id="LC48" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> For example, this would serialize Dates as ISO strings.</span></td>
</tr>
<tr>
<td id="L49" class="blob-num js-line-number" data-line-number="49"></td>
<td id="LC49" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L50" class="blob-num js-line-number" data-line-number="50"></td>
<td id="LC50" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Date.prototype.toJSON = function (key) {</span></td>
</tr>
<tr>
<td id="L51" class="blob-num js-line-number" data-line-number="51"></td>
<td id="LC51" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> function f(n) {</span></td>
</tr>
<tr>
<td id="L52" class="blob-num js-line-number" data-line-number="52"></td>
<td id="LC52" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> // Format integers to have at least two digits.</span></td>
</tr>
<tr>
<td id="L53" class="blob-num js-line-number" data-line-number="53"></td>
<td id="LC53" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> return n &lt; 10 </span></td>
</tr>
<tr>
<td id="L54" class="blob-num js-line-number" data-line-number="54"></td>
<td id="LC54" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> ? &#39;0&#39; + n </span></td>
</tr>
<tr>
<td id="L55" class="blob-num js-line-number" data-line-number="55"></td>
<td id="LC55" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> : n;</span></td>
</tr>
<tr>
<td id="L56" class="blob-num js-line-number" data-line-number="56"></td>
<td id="LC56" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> }</span></td>
</tr>
<tr>
<td id="L57" class="blob-num js-line-number" data-line-number="57"></td>
<td id="LC57" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L58" class="blob-num js-line-number" data-line-number="58"></td>
<td id="LC58" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> return this.getUTCFullYear() + &#39;-&#39; +</span></td>
</tr>
<tr>
<td id="L59" class="blob-num js-line-number" data-line-number="59"></td>
<td id="LC59" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> f(this.getUTCMonth() + 1) + &#39;-&#39; +</span></td>
</tr>
<tr>
<td id="L60" class="blob-num js-line-number" data-line-number="60"></td>
<td id="LC60" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> f(this.getUTCDate()) + &#39;T&#39; +</span></td>
</tr>
<tr>
<td id="L61" class="blob-num js-line-number" data-line-number="61"></td>
<td id="LC61" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> f(this.getUTCHours()) + &#39;:&#39; +</span></td>
</tr>
<tr>
<td id="L62" class="blob-num js-line-number" data-line-number="62"></td>
<td id="LC62" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> f(this.getUTCMinutes()) + &#39;:&#39; +</span></td>
</tr>
<tr>
<td id="L63" class="blob-num js-line-number" data-line-number="63"></td>
<td id="LC63" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> f(this.getUTCSeconds()) + &#39;Z&#39;;</span></td>
</tr>
<tr>
<td id="L64" class="blob-num js-line-number" data-line-number="64"></td>
<td id="LC64" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> };</span></td>
</tr>
<tr>
<td id="L65" class="blob-num js-line-number" data-line-number="65"></td>
<td id="LC65" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L66" class="blob-num js-line-number" data-line-number="66"></td>
<td id="LC66" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> You can provide an optional replacer method. It will be passed the</span></td>
</tr>
<tr>
<td id="L67" class="blob-num js-line-number" data-line-number="67"></td>
<td id="LC67" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> key and value of each member, with this bound to the containing</span></td>
</tr>
<tr>
<td id="L68" class="blob-num js-line-number" data-line-number="68"></td>
<td id="LC68" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> object. The value that is returned from your method will be</span></td>
</tr>
<tr>
<td id="L69" class="blob-num js-line-number" data-line-number="69"></td>
<td id="LC69" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> serialized. If your method returns undefined, then the member will</span></td>
</tr>
<tr>
<td id="L70" class="blob-num js-line-number" data-line-number="70"></td>
<td id="LC70" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> be excluded from the serialization.</span></td>
</tr>
<tr>
<td id="L71" class="blob-num js-line-number" data-line-number="71"></td>
<td id="LC71" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L72" class="blob-num js-line-number" data-line-number="72"></td>
<td id="LC72" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> If the replacer parameter is an array of strings, then it will be</span></td>
</tr>
<tr>
<td id="L73" class="blob-num js-line-number" data-line-number="73"></td>
<td id="LC73" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> used to select the members to be serialized. It filters the results</span></td>
</tr>
<tr>
<td id="L74" class="blob-num js-line-number" data-line-number="74"></td>
<td id="LC74" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> such that only members with keys listed in the replacer array are</span></td>
</tr>
<tr>
<td id="L75" class="blob-num js-line-number" data-line-number="75"></td>
<td id="LC75" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> stringified.</span></td>
</tr>
<tr>
<td id="L76" class="blob-num js-line-number" data-line-number="76"></td>
<td id="LC76" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L77" class="blob-num js-line-number" data-line-number="77"></td>
<td id="LC77" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Values that do not have JSON representations, such as undefined or</span></td>
</tr>
<tr>
<td id="L78" class="blob-num js-line-number" data-line-number="78"></td>
<td id="LC78" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> functions, will not be serialized. Such values in objects will be</span></td>
</tr>
<tr>
<td id="L79" class="blob-num js-line-number" data-line-number="79"></td>
<td id="LC79" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> dropped; in arrays they will be replaced with null. You can use</span></td>
</tr>
<tr>
<td id="L80" class="blob-num js-line-number" data-line-number="80"></td>
<td id="LC80" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> a replacer function to replace those with JSON values.</span></td>
</tr>
<tr>
<td id="L81" class="blob-num js-line-number" data-line-number="81"></td>
<td id="LC81" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> JSON.stringify(undefined) returns undefined.</span></td>
</tr>
<tr>
<td id="L82" class="blob-num js-line-number" data-line-number="82"></td>
<td id="LC82" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L83" class="blob-num js-line-number" data-line-number="83"></td>
<td id="LC83" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> The optional space parameter produces a stringification of the</span></td>
</tr>
<tr>
<td id="L84" class="blob-num js-line-number" data-line-number="84"></td>
<td id="LC84" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> value that is filled with line breaks and indentation to make it</span></td>
</tr>
<tr>
<td id="L85" class="blob-num js-line-number" data-line-number="85"></td>
<td id="LC85" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> easier to read.</span></td>
</tr>
<tr>
<td id="L86" class="blob-num js-line-number" data-line-number="86"></td>
<td id="LC86" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L87" class="blob-num js-line-number" data-line-number="87"></td>
<td id="LC87" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> If the space parameter is a non-empty string, then that string will</span></td>
</tr>
<tr>
<td id="L88" class="blob-num js-line-number" data-line-number="88"></td>
<td id="LC88" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> be used for indentation. If the space parameter is a number, then</span></td>
</tr>
<tr>
<td id="L89" class="blob-num js-line-number" data-line-number="89"></td>
<td id="LC89" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> the indentation will be that many spaces.</span></td>
</tr>
<tr>
<td id="L90" class="blob-num js-line-number" data-line-number="90"></td>
<td id="LC90" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L91" class="blob-num js-line-number" data-line-number="91"></td>
<td id="LC91" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Example:</span></td>
</tr>
<tr>
<td id="L92" class="blob-num js-line-number" data-line-number="92"></td>
<td id="LC92" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L93" class="blob-num js-line-number" data-line-number="93"></td>
<td id="LC93" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> text = JSON.stringify([&#39;e&#39;, {pluribus: &#39;unum&#39;}]);</span></td>
</tr>
<tr>
<td id="L94" class="blob-num js-line-number" data-line-number="94"></td>
<td id="LC94" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> // text is &#39;[&quot;e&quot;,{&quot;pluribus&quot;:&quot;unum&quot;}]&#39;</span></td>
</tr>
<tr>
<td id="L95" class="blob-num js-line-number" data-line-number="95"></td>
<td id="LC95" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L96" class="blob-num js-line-number" data-line-number="96"></td>
<td id="LC96" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L97" class="blob-num js-line-number" data-line-number="97"></td>
<td id="LC97" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> text = JSON.stringify([&#39;e&#39;, {pluribus: &#39;unum&#39;}], null, &#39;\t&#39;);</span></td>
</tr>
<tr>
<td id="L98" class="blob-num js-line-number" data-line-number="98"></td>
<td id="LC98" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> // text is &#39;[\n\t&quot;e&quot;,\n\t{\n\t\t&quot;pluribus&quot;: &quot;unum&quot;\n\t}\n]&#39;</span></td>
</tr>
<tr>
<td id="L99" class="blob-num js-line-number" data-line-number="99"></td>
<td id="LC99" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L100" class="blob-num js-line-number" data-line-number="100"></td>
<td id="LC100" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> text = JSON.stringify([new Date()], function (key, value) {</span></td>
</tr>
<tr>
<td id="L101" class="blob-num js-line-number" data-line-number="101"></td>
<td id="LC101" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> return this[key] instanceof Date </span></td>
</tr>
<tr>
<td id="L102" class="blob-num js-line-number" data-line-number="102"></td>
<td id="LC102" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> ? &#39;Date(&#39; + this[key] + &#39;)&#39; </span></td>
</tr>
<tr>
<td id="L103" class="blob-num js-line-number" data-line-number="103"></td>
<td id="LC103" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> : value;</span></td>
</tr>
<tr>
<td id="L104" class="blob-num js-line-number" data-line-number="104"></td>
<td id="LC104" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> });</span></td>
</tr>
<tr>
<td id="L105" class="blob-num js-line-number" data-line-number="105"></td>
<td id="LC105" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> // text is &#39;[&quot;Date(---current time---)&quot;]&#39;</span></td>
</tr>
<tr>
<td id="L106" class="blob-num js-line-number" data-line-number="106"></td>
<td id="LC106" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L107" class="blob-num js-line-number" data-line-number="107"></td>
<td id="LC107" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L108" class="blob-num js-line-number" data-line-number="108"></td>
<td id="LC108" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> JSON.parse(text, reviver)</span></td>
</tr>
<tr>
<td id="L109" class="blob-num js-line-number" data-line-number="109"></td>
<td id="LC109" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> This method parses a JSON text to produce an object or array.</span></td>
</tr>
<tr>
<td id="L110" class="blob-num js-line-number" data-line-number="110"></td>
<td id="LC110" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> It can throw a SyntaxError exception.</span></td>
</tr>
<tr>
<td id="L111" class="blob-num js-line-number" data-line-number="111"></td>
<td id="LC111" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L112" class="blob-num js-line-number" data-line-number="112"></td>
<td id="LC112" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> The optional reviver parameter is a function that can filter and</span></td>
</tr>
<tr>
<td id="L113" class="blob-num js-line-number" data-line-number="113"></td>
<td id="LC113" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> transform the results. It receives each of the keys and values,</span></td>
</tr>
<tr>
<td id="L114" class="blob-num js-line-number" data-line-number="114"></td>
<td id="LC114" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> and its return value is used instead of the original value.</span></td>
</tr>
<tr>
<td id="L115" class="blob-num js-line-number" data-line-number="115"></td>
<td id="LC115" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> If it returns what it received, then the structure is not modified.</span></td>
</tr>
<tr>
<td id="L116" class="blob-num js-line-number" data-line-number="116"></td>
<td id="LC116" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> If it returns undefined then the member is deleted.</span></td>
</tr>
<tr>
<td id="L117" class="blob-num js-line-number" data-line-number="117"></td>
<td id="LC117" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L118" class="blob-num js-line-number" data-line-number="118"></td>
<td id="LC118" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> Example:</span></td>
</tr>
<tr>
<td id="L119" class="blob-num js-line-number" data-line-number="119"></td>
<td id="LC119" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L120" class="blob-num js-line-number" data-line-number="120"></td>
<td id="LC120" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> // Parse the text. Values that look like ISO date strings will</span></td>
</tr>
<tr>
<td id="L121" class="blob-num js-line-number" data-line-number="121"></td>
<td id="LC121" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> // be converted to Date objects.</span></td>
</tr>
<tr>
<td id="L122" class="blob-num js-line-number" data-line-number="122"></td>
<td id="LC122" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L123" class="blob-num js-line-number" data-line-number="123"></td>
<td id="LC123" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> myData = JSON.parse(text, function (key, value) {</span></td>
</tr>
<tr>
<td id="L124" class="blob-num js-line-number" data-line-number="124"></td>
<td id="LC124" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> var a;</span></td>
</tr>
<tr>
<td id="L125" class="blob-num js-line-number" data-line-number="125"></td>
<td id="LC125" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> if (typeof value === &#39;string&#39;) {</span></td>
</tr>
<tr>
<td id="L126" class="blob-num js-line-number" data-line-number="126"></td>
<td id="LC126" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> a =</span></td>
</tr>
<tr>
<td id="L127" class="blob-num js-line-number" data-line-number="127"></td>
<td id="LC127" class="blob-code blob-code-inner js-file-line"><span class="pl-c">/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);</span></td>
</tr>
<tr>
<td id="L128" class="blob-num js-line-number" data-line-number="128"></td>
<td id="LC128" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> if (a) {</span></td>
</tr>
<tr>
<td id="L129" class="blob-num js-line-number" data-line-number="129"></td>
<td id="LC129" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],</span></td>
</tr>
<tr>
<td id="L130" class="blob-num js-line-number" data-line-number="130"></td>
<td id="LC130" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> +a[5], +a[6]));</span></td>
</tr>
<tr>
<td id="L131" class="blob-num js-line-number" data-line-number="131"></td>
<td id="LC131" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> }</span></td>
</tr>
<tr>
<td id="L132" class="blob-num js-line-number" data-line-number="132"></td>
<td id="LC132" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> }</span></td>
</tr>
<tr>
<td id="L133" class="blob-num js-line-number" data-line-number="133"></td>
<td id="LC133" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> return value;</span></td>
</tr>
<tr>
<td id="L134" class="blob-num js-line-number" data-line-number="134"></td>
<td id="LC134" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> });</span></td>
</tr>
<tr>
<td id="L135" class="blob-num js-line-number" data-line-number="135"></td>
<td id="LC135" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L136" class="blob-num js-line-number" data-line-number="136"></td>
<td id="LC136" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> myData = JSON.parse(&#39;[&quot;Date(09/09/2001)&quot;]&#39;, function (key, value) {</span></td>
</tr>
<tr>
<td id="L137" class="blob-num js-line-number" data-line-number="137"></td>
<td id="LC137" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> var d;</span></td>
</tr>
<tr>
<td id="L138" class="blob-num js-line-number" data-line-number="138"></td>
<td id="LC138" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> if (typeof value === &#39;string&#39; &amp;&amp;</span></td>
</tr>
<tr>
<td id="L139" class="blob-num js-line-number" data-line-number="139"></td>
<td id="LC139" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> value.slice(0, 5) === &#39;Date(&#39; &amp;&amp;</span></td>
</tr>
<tr>
<td id="L140" class="blob-num js-line-number" data-line-number="140"></td>
<td id="LC140" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> value.slice(-1) === &#39;)&#39;) {</span></td>
</tr>
<tr>
<td id="L141" class="blob-num js-line-number" data-line-number="141"></td>
<td id="LC141" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> d = new Date(value.slice(5, -1));</span></td>
</tr>
<tr>
<td id="L142" class="blob-num js-line-number" data-line-number="142"></td>
<td id="LC142" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> if (d) {</span></td>
</tr>
<tr>
<td id="L143" class="blob-num js-line-number" data-line-number="143"></td>
<td id="LC143" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> return d;</span></td>
</tr>
<tr>
<td id="L144" class="blob-num js-line-number" data-line-number="144"></td>
<td id="LC144" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> }</span></td>
</tr>
<tr>
<td id="L145" class="blob-num js-line-number" data-line-number="145"></td>
<td id="LC145" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> }</span></td>
</tr>
<tr>
<td id="L146" class="blob-num js-line-number" data-line-number="146"></td>
<td id="LC146" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> return value;</span></td>
</tr>
<tr>
<td id="L147" class="blob-num js-line-number" data-line-number="147"></td>
<td id="LC147" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> });</span></td>
</tr>
<tr>
<td id="L148" class="blob-num js-line-number" data-line-number="148"></td>
<td id="LC148" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L149" class="blob-num js-line-number" data-line-number="149"></td>
<td id="LC149" class="blob-code blob-code-inner js-file-line"><span class="pl-c"></span></td>
</tr>
<tr>
<td id="L150" class="blob-num js-line-number" data-line-number="150"></td>
<td id="LC150" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> This is a reference implementation. You are free to copy, modify, or</span></td>
</tr>
<tr>
<td id="L151" class="blob-num js-line-number" data-line-number="151"></td>
<td id="LC151" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> redistribute.</span></td>
</tr>
<tr>
<td id="L152" class="blob-num js-line-number" data-line-number="152"></td>
<td id="LC152" class="blob-code blob-code-inner js-file-line"><span class="pl-c">*/</span></td>
</tr>
<tr>
<td id="L153" class="blob-num js-line-number" data-line-number="153"></td>
<td id="LC153" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L154" class="blob-num js-line-number" data-line-number="154"></td>
<td id="LC154" class="blob-code blob-code-inner js-file-line"><span class="pl-c">/*jslint </span></td>
</tr>
<tr>
<td id="L155" class="blob-num js-line-number" data-line-number="155"></td>
<td id="LC155" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> eval, for, this </span></td>
</tr>
<tr>
<td id="L156" class="blob-num js-line-number" data-line-number="156"></td>
<td id="LC156" class="blob-code blob-code-inner js-file-line"><span class="pl-c">*/</span></td>
</tr>
<tr>
<td id="L157" class="blob-num js-line-number" data-line-number="157"></td>
<td id="LC157" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L158" class="blob-num js-line-number" data-line-number="158"></td>
<td id="LC158" class="blob-code blob-code-inner js-file-line"><span class="pl-c">/*property</span></td>
</tr>
<tr>
<td id="L159" class="blob-num js-line-number" data-line-number="159"></td>
<td id="LC159" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,</span></td>
</tr>
<tr>
<td id="L160" class="blob-num js-line-number" data-line-number="160"></td>
<td id="LC160" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,</span></td>
</tr>
<tr>
<td id="L161" class="blob-num js-line-number" data-line-number="161"></td>
<td id="LC161" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> lastIndex, length, parse, prototype, push, replace, slice, stringify,</span></td>
</tr>
<tr>
<td id="L162" class="blob-num js-line-number" data-line-number="162"></td>
<td id="LC162" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> test, toJSON, toString, valueOf</span></td>
</tr>
<tr>
<td id="L163" class="blob-num js-line-number" data-line-number="163"></td>
<td id="LC163" class="blob-code blob-code-inner js-file-line"><span class="pl-c">*/</span></td>
</tr>
<tr>
<td id="L164" class="blob-num js-line-number" data-line-number="164"></td>
<td id="LC164" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L165" class="blob-num js-line-number" data-line-number="165"></td>
<td id="LC165" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L166" class="blob-num js-line-number" data-line-number="166"></td>
<td id="LC166" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Create a JSON object only if one does not already exist. We create the</span></td>
</tr>
<tr>
<td id="L167" class="blob-num js-line-number" data-line-number="167"></td>
<td id="LC167" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// methods in a closure to avoid creating global variables.</span></td>
</tr>
<tr>
<td id="L168" class="blob-num js-line-number" data-line-number="168"></td>
<td id="LC168" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L169" class="blob-num js-line-number" data-line-number="169"></td>
<td id="LC169" class="blob-code blob-code-inner js-file-line"><span class="pl-k">if</span> (<span class="pl-k">typeof</span> <span class="pl-c1">JSON</span> <span class="pl-k">!==</span> <span class="pl-s"><span class="pl-pds">&#39;</span>object<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L170" class="blob-num js-line-number" data-line-number="170"></td>
<td id="LC170" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">JSON</span> <span class="pl-k">=</span> {};</td>
</tr>
<tr>
<td id="L171" class="blob-num js-line-number" data-line-number="171"></td>
<td id="LC171" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="L172" class="blob-num js-line-number" data-line-number="172"></td>
<td id="LC172" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L173" class="blob-num js-line-number" data-line-number="173"></td>
<td id="LC173" class="blob-code blob-code-inner js-file-line">(<span class="pl-k">function</span> () {</td>
</tr>
<tr>
<td id="L174" class="blob-num js-line-number" data-line-number="174"></td>
<td id="LC174" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&#39;</span>use strict<span class="pl-pds">&#39;</span></span>;</td>
</tr>
<tr>
<td id="L175" class="blob-num js-line-number" data-line-number="175"></td>
<td id="LC175" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="L176" class="blob-num js-line-number" data-line-number="176"></td>
<td id="LC176" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">var</span> rx_one <span class="pl-k">=</span><span class="pl-sr"> <span class="pl-pds">/</span><span class="pl-k">^</span><span class="pl-c1">[<span class="pl-cce">\]</span>,:{}<span class="pl-c1">\s</span>]</span><span class="pl-k">*</span><span class="pl-k">$</span><span class="pl-pds">/</span></span>,</td>
</tr>
<tr>
<td id="L177" class="blob-num js-line-number" data-line-number="177"></td>
<td id="LC177" class="blob-code blob-code-inner js-file-line"> rx_two <span class="pl-k">=</span><span class="pl-sr"> <span class="pl-pds">/</span><span class="pl-cce">\\</span>(?:<span class="pl-c1">[&quot;<span class="pl-cce">\\\/</span>bfnrt]</span><span class="pl-k">|</span>u<span class="pl-c1">[<span class="pl-c1">0-9a-fA-F</span>]</span><span class="pl-k">{4}</span>)<span class="pl-pds">/</span>g</span>,</td>
</tr>
<tr>
<td id="L178" class="blob-num js-line-number" data-line-number="178"></td>
<td id="LC178" class="blob-code blob-code-inner js-file-line"> rx_three <span class="pl-k">=</span><span class="pl-sr"> <span class="pl-pds">/</span>&quot;<span class="pl-c1">[<span class="pl-k">^</span>&quot;<span class="pl-cce">\\\n\r</span>]</span><span class="pl-k">*</span>&quot;<span class="pl-k">|</span>true<span class="pl-k">|</span>false<span class="pl-k">|</span>null<span class="pl-k">|</span>-<span class="pl-k">?</span><span class="pl-c1">\d</span><span class="pl-k">+</span>(?:<span class="pl-cce">\.</span><span class="pl-c1">\d</span><span class="pl-k">*</span>)<span class="pl-k">?</span>(?:<span class="pl-c1">[eE][+<span class="pl-cce">\-</span>]</span><span class="pl-k">?</span><span class="pl-c1">\d</span><span class="pl-k">+</span>)<span class="pl-k">?</span><span class="pl-pds">/</span>g</span>,</td>
</tr>
<tr>
<td id="L179" class="blob-num js-line-number" data-line-number="179"></td>
<td id="LC179" class="blob-code blob-code-inner js-file-line"> rx_four <span class="pl-k">=</span><span class="pl-sr"> <span class="pl-pds">/</span>(?:<span class="pl-k">^</span><span class="pl-k">|</span>:<span class="pl-k">|</span>,)(?:<span class="pl-c1">\s</span><span class="pl-k">*</span><span class="pl-cce">\[</span>)<span class="pl-k">+</span><span class="pl-pds">/</span>g</span>,</td>
</tr>
<tr>
<td id="L180" class="blob-num js-line-number" data-line-number="180"></td>
<td id="LC180" class="blob-code blob-code-inner js-file-line"> rx_escapable <span class="pl-k">=</span><span class="pl-sr"> <span class="pl-pds">/</span><span class="pl-c1">[<span class="pl-cce">\\\&quot;\u</span>000<span class="pl-c1">0-<span class="pl-cce">\u</span></span>001f<span class="pl-cce">\u</span>007<span class="pl-c1">f-<span class="pl-cce">\u</span></span>009f<span class="pl-cce">\u</span>00ad<span class="pl-cce">\u</span>060<span class="pl-c1">0-<span class="pl-cce">\u</span></span>0604<span class="pl-cce">\u</span>070f<span class="pl-cce">\u</span>17b4<span class="pl-cce">\u</span>17b5<span class="pl-cce">\u</span>200<span class="pl-c1">c-<span class="pl-cce">\u</span></span>200f<span class="pl-cce">\u</span>202<span class="pl-c1">8-<span class="pl-cce">\u</span></span>202f<span class="pl-cce">\u</span>206<span class="pl-c1">0-<span class="pl-cce">\u</span></span>206f<span class="pl-cce">\u</span>feff<span class="pl-cce">\u</span>fff<span class="pl-c1">0-<span class="pl-cce">\u</span></span>ffff]</span><span class="pl-pds">/</span>g</span>,</td>
</tr>
<tr>
<td id="L181" class="blob-num js-line-number" data-line-number="181"></td>
<td id="LC181" class="blob-code blob-code-inner js-file-line"> rx_dangerous <span class="pl-k">=</span><span class="pl-sr"> <span class="pl-pds">/</span><span class="pl-c1">[<span class="pl-cce">\u</span>0000<span class="pl-cce">\u</span>00ad<span class="pl-cce">\u</span>060<span class="pl-c1">0-<span class="pl-cce">\u</span></span>0604<span class="pl-cce">\u</span>070f<span class="pl-cce">\u</span>17b4<span class="pl-cce">\u</span>17b5<span class="pl-cce">\u</span>200<span class="pl-c1">c-<span class="pl-cce">\u</span></span>200f<span class="pl-cce">\u</span>202<span class="pl-c1">8-<span class="pl-cce">\u</span></span>202f<span class="pl-cce">\u</span>206<span class="pl-c1">0-<span class="pl-cce">\u</span></span>206f<span class="pl-cce">\u</span>feff<span class="pl-cce">\u</span>fff<span class="pl-c1">0-<span class="pl-cce">\u</span></span>ffff]</span><span class="pl-pds">/</span>g</span>;</td>
</tr>
<tr>
<td id="L182" class="blob-num js-line-number" data-line-number="182"></td>
<td id="LC182" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L183" class="blob-num js-line-number" data-line-number="183"></td>
<td id="LC183" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">function</span> <span class="pl-en">f</span>(<span class="pl-smi">n</span>) {</td>
</tr>
<tr>
<td id="L184" class="blob-num js-line-number" data-line-number="184"></td>
<td id="LC184" class="blob-code blob-code-inner js-file-line"> <span class="pl-c">// Format integers to have at least two digits.</span></td>
</tr>
<tr>
<td id="L185" class="blob-num js-line-number" data-line-number="185"></td>
<td id="LC185" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> n <span class="pl-k">&lt;</span> <span class="pl-c1">10</span> </td>
</tr>
<tr>
<td id="L186" class="blob-num js-line-number" data-line-number="186"></td>
<td id="LC186" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">&#39;</span>0<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> n </td>
</tr>
<tr>
<td id="L187" class="blob-num js-line-number" data-line-number="187"></td>
<td id="LC187" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> n;</td>
</tr>
<tr>
<td id="L188" class="blob-num js-line-number" data-line-number="188"></td>
<td id="LC188" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L189" class="blob-num js-line-number" data-line-number="189"></td>
<td id="LC189" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="L190" class="blob-num js-line-number" data-line-number="190"></td>
<td id="LC190" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">function</span> <span class="pl-en">this_value</span>() {</td>
</tr>
<tr>
<td id="L191" class="blob-num js-line-number" data-line-number="191"></td>
<td id="LC191" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-v">this</span>.<span class="pl-c1">valueOf</span>();</td>
</tr>
<tr>
<td id="L192" class="blob-num js-line-number" data-line-number="192"></td>
<td id="LC192" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L193" class="blob-num js-line-number" data-line-number="193"></td>
<td id="LC193" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L194" class="blob-num js-line-number" data-line-number="194"></td>
<td id="LC194" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-k">typeof</span> <span class="pl-c1">Date</span>.<span class="pl-c1">prototype</span>.toJSON <span class="pl-k">!==</span> <span class="pl-s"><span class="pl-pds">&#39;</span>function<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L195" class="blob-num js-line-number" data-line-number="195"></td>
<td id="LC195" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L196" class="blob-num js-line-number" data-line-number="196"></td>
<td id="LC196" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">Date</span>.<span class="pl-c1">prototype</span>.<span class="pl-en">toJSON</span> <span class="pl-k">=</span> <span class="pl-k">function</span> () {</td>
</tr>
<tr>
<td id="L197" class="blob-num js-line-number" data-line-number="197"></td>
<td id="LC197" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L198" class="blob-num js-line-number" data-line-number="198"></td>
<td id="LC198" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">isFinite</span>(<span class="pl-v">this</span>.<span class="pl-c1">valueOf</span>())</td>
</tr>
<tr>
<td id="L199" class="blob-num js-line-number" data-line-number="199"></td>
<td id="LC199" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> <span class="pl-v">this</span>.<span class="pl-c1">getUTCFullYear</span>() <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>-<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span></td>
</tr>
<tr>
<td id="L200" class="blob-num js-line-number" data-line-number="200"></td>
<td id="LC200" class="blob-code blob-code-inner js-file-line"> f(<span class="pl-v">this</span>.<span class="pl-c1">getUTCMonth</span>() <span class="pl-k">+</span> <span class="pl-c1">1</span>) <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>-<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span></td>
</tr>
<tr>
<td id="L201" class="blob-num js-line-number" data-line-number="201"></td>
<td id="LC201" class="blob-code blob-code-inner js-file-line"> f(<span class="pl-v">this</span>.<span class="pl-c1">getUTCDate</span>()) <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>T<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span></td>
</tr>
<tr>
<td id="L202" class="blob-num js-line-number" data-line-number="202"></td>
<td id="LC202" class="blob-code blob-code-inner js-file-line"> f(<span class="pl-v">this</span>.<span class="pl-c1">getUTCHours</span>()) <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>:<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span></td>
</tr>
<tr>
<td id="L203" class="blob-num js-line-number" data-line-number="203"></td>
<td id="LC203" class="blob-code blob-code-inner js-file-line"> f(<span class="pl-v">this</span>.<span class="pl-c1">getUTCMinutes</span>()) <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>:<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span></td>
</tr>
<tr>
<td id="L204" class="blob-num js-line-number" data-line-number="204"></td>
<td id="LC204" class="blob-code blob-code-inner js-file-line"> f(<span class="pl-v">this</span>.<span class="pl-c1">getUTCSeconds</span>()) <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>Z<span class="pl-pds">&#39;</span></span></td>
</tr>
<tr>
<td id="L205" class="blob-num js-line-number" data-line-number="205"></td>
<td id="LC205" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> <span class="pl-c1">null</span>;</td>
</tr>
<tr>
<td id="L206" class="blob-num js-line-number" data-line-number="206"></td>
<td id="LC206" class="blob-code blob-code-inner js-file-line"> };</td>
</tr>
<tr>
<td id="L207" class="blob-num js-line-number" data-line-number="207"></td>
<td id="LC207" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L208" class="blob-num js-line-number" data-line-number="208"></td>
<td id="LC208" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">Boolean</span>.<span class="pl-c1">prototype</span>.<span class="pl-en">toJSON</span> <span class="pl-k">=</span> this_value;</td>
</tr>
<tr>
<td id="L209" class="blob-num js-line-number" data-line-number="209"></td>
<td id="LC209" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">Number</span>.<span class="pl-c1">prototype</span>.<span class="pl-en">toJSON</span> <span class="pl-k">=</span> this_value;</td>
</tr>
<tr>
<td id="L210" class="blob-num js-line-number" data-line-number="210"></td>
<td id="LC210" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">String</span>.<span class="pl-c1">prototype</span>.<span class="pl-en">toJSON</span> <span class="pl-k">=</span> this_value;</td>
</tr>
<tr>
<td id="L211" class="blob-num js-line-number" data-line-number="211"></td>
<td id="LC211" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L212" class="blob-num js-line-number" data-line-number="212"></td>
<td id="LC212" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L213" class="blob-num js-line-number" data-line-number="213"></td>
<td id="LC213" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">var</span> gap,</td>
</tr>
<tr>
<td id="L214" class="blob-num js-line-number" data-line-number="214"></td>
<td id="LC214" class="blob-code blob-code-inner js-file-line"> indent,</td>
</tr>
<tr>
<td id="L215" class="blob-num js-line-number" data-line-number="215"></td>
<td id="LC215" class="blob-code blob-code-inner js-file-line"> meta,</td>
</tr>
<tr>
<td id="L216" class="blob-num js-line-number" data-line-number="216"></td>
<td id="LC216" class="blob-code blob-code-inner js-file-line"> rep;</td>
</tr>
<tr>
<td id="L217" class="blob-num js-line-number" data-line-number="217"></td>
<td id="LC217" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L218" class="blob-num js-line-number" data-line-number="218"></td>
<td id="LC218" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L219" class="blob-num js-line-number" data-line-number="219"></td>
<td id="LC219" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">function</span> <span class="pl-en">quote</span>(<span class="pl-smi">string</span>) {</td>
</tr>
<tr>
<td id="L220" class="blob-num js-line-number" data-line-number="220"></td>
<td id="LC220" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L221" class="blob-num js-line-number" data-line-number="221"></td>
<td id="LC221" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If the string contains no control characters, no quote characters, and no</span></td>
</tr>
<tr>
<td id="L222" class="blob-num js-line-number" data-line-number="222"></td>
<td id="LC222" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// backslash characters, then we can safely slap some quotes around it.</span></td>
</tr>
<tr>
<td id="L223" class="blob-num js-line-number" data-line-number="223"></td>
<td id="LC223" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Otherwise we must also replace the offending characters with safe escape</span></td>
</tr>
<tr>
<td id="L224" class="blob-num js-line-number" data-line-number="224"></td>
<td id="LC224" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// sequences.</span></td>
</tr>
<tr>
<td id="L225" class="blob-num js-line-number" data-line-number="225"></td>
<td id="LC225" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L226" class="blob-num js-line-number" data-line-number="226"></td>
<td id="LC226" class="blob-code blob-code-inner js-file-line"> rx_escapable.<span class="pl-c1">lastIndex</span> <span class="pl-k">=</span> <span class="pl-c1">0</span>;</td>
</tr>
<tr>
<td id="L227" class="blob-num js-line-number" data-line-number="227"></td>
<td id="LC227" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> rx_escapable.<span class="pl-c1">test</span>(string) </td>
</tr>
<tr>
<td id="L228" class="blob-num js-line-number" data-line-number="228"></td>
<td id="LC228" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">&#39;</span>&quot;<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> string.<span class="pl-c1">replace</span>(rx_escapable, <span class="pl-k">function</span> (<span class="pl-smi">a</span>) {</td>
</tr>
<tr>
<td id="L229" class="blob-num js-line-number" data-line-number="229"></td>
<td id="LC229" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">var</span> c <span class="pl-k">=</span> meta[a];</td>
</tr>
<tr>
<td id="L230" class="blob-num js-line-number" data-line-number="230"></td>
<td id="LC230" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-k">typeof</span> c <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>string<span class="pl-pds">&#39;</span></span></td>
</tr>
<tr>
<td id="L231" class="blob-num js-line-number" data-line-number="231"></td>
<td id="LC231" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> c</td>
</tr>
<tr>
<td id="L232" class="blob-num js-line-number" data-line-number="232"></td>
<td id="LC232" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\\</span>u<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> (<span class="pl-s"><span class="pl-pds">&#39;</span>0000<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> a.<span class="pl-c1">charCodeAt</span>(<span class="pl-c1">0</span>).<span class="pl-c1">toString</span>(<span class="pl-c1">16</span>)).<span class="pl-c1">slice</span>(<span class="pl-k">-</span><span class="pl-c1">4</span>);</td>
</tr>
<tr>
<td id="L233" class="blob-num js-line-number" data-line-number="233"></td>
<td id="LC233" class="blob-code blob-code-inner js-file-line"> }) <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>&quot;<span class="pl-pds">&#39;</span></span> </td>
</tr>
<tr>
<td id="L234" class="blob-num js-line-number" data-line-number="234"></td>
<td id="LC234" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span>&quot;<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> string <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>&quot;<span class="pl-pds">&#39;</span></span>;</td>
</tr>
<tr>
<td id="L235" class="blob-num js-line-number" data-line-number="235"></td>
<td id="LC235" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L236" class="blob-num js-line-number" data-line-number="236"></td>
<td id="LC236" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L237" class="blob-num js-line-number" data-line-number="237"></td>
<td id="LC237" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L238" class="blob-num js-line-number" data-line-number="238"></td>
<td id="LC238" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">function</span> <span class="pl-en">str</span>(<span class="pl-smi">key</span>, <span class="pl-smi">holder</span>) {</td>
</tr>
<tr>
<td id="L239" class="blob-num js-line-number" data-line-number="239"></td>
<td id="LC239" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L240" class="blob-num js-line-number" data-line-number="240"></td>
<td id="LC240" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Produce a string from holder[key].</span></td>
</tr>
<tr>
<td id="L241" class="blob-num js-line-number" data-line-number="241"></td>
<td id="LC241" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L242" class="blob-num js-line-number" data-line-number="242"></td>
<td id="LC242" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">var</span> i, <span class="pl-c">// The loop counter.</span></td>
</tr>
<tr>
<td id="L243" class="blob-num js-line-number" data-line-number="243"></td>
<td id="LC243" class="blob-code blob-code-inner js-file-line"> k, <span class="pl-c">// The member key.</span></td>
</tr>
<tr>
<td id="L244" class="blob-num js-line-number" data-line-number="244"></td>
<td id="LC244" class="blob-code blob-code-inner js-file-line"> v, <span class="pl-c">// The member value.</span></td>
</tr>
<tr>
<td id="L245" class="blob-num js-line-number" data-line-number="245"></td>
<td id="LC245" class="blob-code blob-code-inner js-file-line"> length,</td>
</tr>
<tr>
<td id="L246" class="blob-num js-line-number" data-line-number="246"></td>
<td id="LC246" class="blob-code blob-code-inner js-file-line"> mind <span class="pl-k">=</span> gap,</td>
</tr>
<tr>
<td id="L247" class="blob-num js-line-number" data-line-number="247"></td>
<td id="LC247" class="blob-code blob-code-inner js-file-line"> partial,</td>
</tr>
<tr>
<td id="L248" class="blob-num js-line-number" data-line-number="248"></td>
<td id="LC248" class="blob-code blob-code-inner js-file-line"> value <span class="pl-k">=</span> holder[key];</td>
</tr>
<tr>
<td id="L249" class="blob-num js-line-number" data-line-number="249"></td>
<td id="LC249" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L250" class="blob-num js-line-number" data-line-number="250"></td>
<td id="LC250" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If the value has a toJSON method, call it to obtain a replacement value.</span></td>
</tr>
<tr>
<td id="L251" class="blob-num js-line-number" data-line-number="251"></td>
<td id="LC251" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L252" class="blob-num js-line-number" data-line-number="252"></td>
<td id="LC252" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (value <span class="pl-k">&amp;&amp;</span> <span class="pl-k">typeof</span> value <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>object<span class="pl-pds">&#39;</span></span> <span class="pl-k">&amp;&amp;</span></td>
</tr>
<tr>
<td id="L253" class="blob-num js-line-number" data-line-number="253"></td>
<td id="LC253" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">typeof</span> value.toJSON <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>function<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L254" class="blob-num js-line-number" data-line-number="254"></td>
<td id="LC254" class="blob-code blob-code-inner js-file-line"> value <span class="pl-k">=</span> value.toJSON(key);</td>
</tr>
<tr>
<td id="L255" class="blob-num js-line-number" data-line-number="255"></td>
<td id="LC255" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L256" class="blob-num js-line-number" data-line-number="256"></td>
<td id="LC256" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L257" class="blob-num js-line-number" data-line-number="257"></td>
<td id="LC257" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If we were called with a replacer function, then call the replacer to</span></td>
</tr>
<tr>
<td id="L258" class="blob-num js-line-number" data-line-number="258"></td>
<td id="LC258" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// obtain a replacement value.</span></td>
</tr>
<tr>
<td id="L259" class="blob-num js-line-number" data-line-number="259"></td>
<td id="LC259" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L260" class="blob-num js-line-number" data-line-number="260"></td>
<td id="LC260" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-k">typeof</span> rep <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>function<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L261" class="blob-num js-line-number" data-line-number="261"></td>
<td id="LC261" class="blob-code blob-code-inner js-file-line"> value <span class="pl-k">=</span> rep.<span class="pl-c1">call</span>(holder, key, value);</td>
</tr>
<tr>
<td id="L262" class="blob-num js-line-number" data-line-number="262"></td>
<td id="LC262" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L263" class="blob-num js-line-number" data-line-number="263"></td>
<td id="LC263" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L264" class="blob-num js-line-number" data-line-number="264"></td>
<td id="LC264" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// What happens next depends on the value&#39;s type.</span></td>
</tr>
<tr>
<td id="L265" class="blob-num js-line-number" data-line-number="265"></td>
<td id="LC265" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L266" class="blob-num js-line-number" data-line-number="266"></td>
<td id="LC266" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">switch</span> (<span class="pl-k">typeof</span> value) {</td>
</tr>
<tr>
<td id="L267" class="blob-num js-line-number" data-line-number="267"></td>
<td id="LC267" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">&#39;</span>string<span class="pl-pds">&#39;</span></span><span class="pl-k">:</span></td>
</tr>
<tr>
<td id="L268" class="blob-num js-line-number" data-line-number="268"></td>
<td id="LC268" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> quote(value);</td>
</tr>
<tr>
<td id="L269" class="blob-num js-line-number" data-line-number="269"></td>
<td id="LC269" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L270" class="blob-num js-line-number" data-line-number="270"></td>
<td id="LC270" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">&#39;</span>number<span class="pl-pds">&#39;</span></span><span class="pl-k">:</span></td>
</tr>
<tr>
<td id="L271" class="blob-num js-line-number" data-line-number="271"></td>
<td id="LC271" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L272" class="blob-num js-line-number" data-line-number="272"></td>
<td id="LC272" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// JSON numbers must be finite. Encode non-finite numbers as null.</span></td>
</tr>
<tr>
<td id="L273" class="blob-num js-line-number" data-line-number="273"></td>
<td id="LC273" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L274" class="blob-num js-line-number" data-line-number="274"></td>
<td id="LC274" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">isFinite</span>(value) </td>
</tr>
<tr>
<td id="L275" class="blob-num js-line-number" data-line-number="275"></td>
<td id="LC275" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> <span class="pl-c1">String</span>(value) </td>
</tr>
<tr>
<td id="L276" class="blob-num js-line-number" data-line-number="276"></td>
<td id="LC276" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span>null<span class="pl-pds">&#39;</span></span>;</td>
</tr>
<tr>
<td id="L277" class="blob-num js-line-number" data-line-number="277"></td>
<td id="LC277" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L278" class="blob-num js-line-number" data-line-number="278"></td>
<td id="LC278" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">&#39;</span>boolean<span class="pl-pds">&#39;</span></span><span class="pl-k">:</span></td>
</tr>
<tr>
<td id="L279" class="blob-num js-line-number" data-line-number="279"></td>
<td id="LC279" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">&#39;</span>null<span class="pl-pds">&#39;</span></span><span class="pl-k">:</span></td>
</tr>
<tr>
<td id="L280" class="blob-num js-line-number" data-line-number="280"></td>
<td id="LC280" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L281" class="blob-num js-line-number" data-line-number="281"></td>
<td id="LC281" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If the value is a boolean or null, convert it to a string. Note:</span></td>
</tr>
<tr>
<td id="L282" class="blob-num js-line-number" data-line-number="282"></td>
<td id="LC282" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// typeof null does not produce &#39;null&#39;. The case is included here in</span></td>
</tr>
<tr>
<td id="L283" class="blob-num js-line-number" data-line-number="283"></td>
<td id="LC283" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// the remote chance that this gets fixed someday.</span></td>
</tr>
<tr>
<td id="L284" class="blob-num js-line-number" data-line-number="284"></td>
<td id="LC284" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L285" class="blob-num js-line-number" data-line-number="285"></td>
<td id="LC285" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-c1">String</span>(value);</td>
</tr>
<tr>
<td id="L286" class="blob-num js-line-number" data-line-number="286"></td>
<td id="LC286" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L287" class="blob-num js-line-number" data-line-number="287"></td>
<td id="LC287" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If the type is &#39;object&#39;, we might be dealing with an object or an array or</span></td>
</tr>
<tr>
<td id="L288" class="blob-num js-line-number" data-line-number="288"></td>
<td id="LC288" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// null.</span></td>
</tr>
<tr>
<td id="L289" class="blob-num js-line-number" data-line-number="289"></td>
<td id="LC289" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L290" class="blob-num js-line-number" data-line-number="290"></td>
<td id="LC290" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">case</span> <span class="pl-s"><span class="pl-pds">&#39;</span>object<span class="pl-pds">&#39;</span></span><span class="pl-k">:</span></td>
</tr>
<tr>
<td id="L291" class="blob-num js-line-number" data-line-number="291"></td>
<td id="LC291" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L292" class="blob-num js-line-number" data-line-number="292"></td>
<td id="LC292" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Due to a specification blunder in ECMAScript, typeof null is &#39;object&#39;,</span></td>
</tr>
<tr>
<td id="L293" class="blob-num js-line-number" data-line-number="293"></td>
<td id="LC293" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// so watch out for that case.</span></td>
</tr>
<tr>
<td id="L294" class="blob-num js-line-number" data-line-number="294"></td>
<td id="LC294" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L295" class="blob-num js-line-number" data-line-number="295"></td>
<td id="LC295" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-k">!</span>value) {</td>
</tr>
<tr>
<td id="L296" class="blob-num js-line-number" data-line-number="296"></td>
<td id="LC296" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-s"><span class="pl-pds">&#39;</span>null<span class="pl-pds">&#39;</span></span>;</td>
</tr>
<tr>
<td id="L297" class="blob-num js-line-number" data-line-number="297"></td>
<td id="LC297" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L298" class="blob-num js-line-number" data-line-number="298"></td>
<td id="LC298" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L299" class="blob-num js-line-number" data-line-number="299"></td>
<td id="LC299" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Make an array to hold the partial results of stringifying this object value.</span></td>
</tr>
<tr>
<td id="L300" class="blob-num js-line-number" data-line-number="300"></td>
<td id="LC300" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L301" class="blob-num js-line-number" data-line-number="301"></td>
<td id="LC301" class="blob-code blob-code-inner js-file-line"> gap <span class="pl-k">+=</span> indent;</td>
</tr>
<tr>
<td id="L302" class="blob-num js-line-number" data-line-number="302"></td>
<td id="LC302" class="blob-code blob-code-inner js-file-line"> partial <span class="pl-k">=</span> [];</td>
</tr>
<tr>
<td id="L303" class="blob-num js-line-number" data-line-number="303"></td>
<td id="LC303" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L304" class="blob-num js-line-number" data-line-number="304"></td>
<td id="LC304" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Is the value an array?</span></td>
</tr>
<tr>
<td id="L305" class="blob-num js-line-number" data-line-number="305"></td>
<td id="LC305" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L306" class="blob-num js-line-number" data-line-number="306"></td>
<td id="LC306" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">Object</span>.<span class="pl-c1">prototype</span>.toString.<span class="pl-c1">apply</span>(value) <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>[object Array]<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L307" class="blob-num js-line-number" data-line-number="307"></td>
<td id="LC307" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L308" class="blob-num js-line-number" data-line-number="308"></td>
<td id="LC308" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// The value is an array. Stringify every element. Use null as a placeholder</span></td>
</tr>
<tr>
<td id="L309" class="blob-num js-line-number" data-line-number="309"></td>
<td id="LC309" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// for non-JSON values.</span></td>
</tr>
<tr>
<td id="L310" class="blob-num js-line-number" data-line-number="310"></td>
<td id="LC310" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L311" class="blob-num js-line-number" data-line-number="311"></td>
<td id="LC311" class="blob-code blob-code-inner js-file-line"> length <span class="pl-k">=</span> value.<span class="pl-c1">length</span>;</td>
</tr>
<tr>
<td id="L312" class="blob-num js-line-number" data-line-number="312"></td>
<td id="LC312" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (i <span class="pl-k">=</span> <span class="pl-c1">0</span>; i <span class="pl-k">&lt;</span> length; i <span class="pl-k">+=</span> <span class="pl-c1">1</span>) {</td>
</tr>
<tr>
<td id="L313" class="blob-num js-line-number" data-line-number="313"></td>
<td id="LC313" class="blob-code blob-code-inner js-file-line"> partial[i] <span class="pl-k">=</span> str(i, value) <span class="pl-k">||</span> <span class="pl-s"><span class="pl-pds">&#39;</span>null<span class="pl-pds">&#39;</span></span>;</td>
</tr>
<tr>
<td id="L314" class="blob-num js-line-number" data-line-number="314"></td>
<td id="LC314" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L315" class="blob-num js-line-number" data-line-number="315"></td>
<td id="LC315" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L316" class="blob-num js-line-number" data-line-number="316"></td>
<td id="LC316" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Join all of the elements together, separated with commas, and wrap them in</span></td>
</tr>
<tr>
<td id="L317" class="blob-num js-line-number" data-line-number="317"></td>
<td id="LC317" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// brackets.</span></td>
</tr>
<tr>
<td id="L318" class="blob-num js-line-number" data-line-number="318"></td>
<td id="LC318" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L319" class="blob-num js-line-number" data-line-number="319"></td>
<td id="LC319" class="blob-code blob-code-inner js-file-line"> v <span class="pl-k">=</span> partial.<span class="pl-c1">length</span> <span class="pl-k">===</span> <span class="pl-c1">0</span></td>
</tr>
<tr>
<td id="L320" class="blob-num js-line-number" data-line-number="320"></td>
<td id="LC320" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">&#39;</span>[]<span class="pl-pds">&#39;</span></span></td>
</tr>
<tr>
<td id="L321" class="blob-num js-line-number" data-line-number="321"></td>
<td id="LC321" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> gap</td>
</tr>
<tr>
<td id="L322" class="blob-num js-line-number" data-line-number="322"></td>
<td id="LC322" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">&#39;</span>[<span class="pl-cce">\n</span><span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> gap <span class="pl-k">+</span> partial.<span class="pl-c1">join</span>(<span class="pl-s"><span class="pl-pds">&#39;</span>,<span class="pl-cce">\n</span><span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> gap) <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\n</span><span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> mind <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>]<span class="pl-pds">&#39;</span></span></td>
</tr>
<tr>
<td id="L323" class="blob-num js-line-number" data-line-number="323"></td>
<td id="LC323" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span>[<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> partial.<span class="pl-c1">join</span>(<span class="pl-s"><span class="pl-pds">&#39;</span>,<span class="pl-pds">&#39;</span></span>) <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>]<span class="pl-pds">&#39;</span></span>;</td>
</tr>
<tr>
<td id="L324" class="blob-num js-line-number" data-line-number="324"></td>
<td id="LC324" class="blob-code blob-code-inner js-file-line"> gap <span class="pl-k">=</span> mind;</td>
</tr>
<tr>
<td id="L325" class="blob-num js-line-number" data-line-number="325"></td>
<td id="LC325" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> v;</td>
</tr>
<tr>
<td id="L326" class="blob-num js-line-number" data-line-number="326"></td>
<td id="LC326" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L327" class="blob-num js-line-number" data-line-number="327"></td>
<td id="LC327" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L328" class="blob-num js-line-number" data-line-number="328"></td>
<td id="LC328" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If the replacer is an array, use it to select the members to be stringified.</span></td>
</tr>
<tr>
<td id="L329" class="blob-num js-line-number" data-line-number="329"></td>
<td id="LC329" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L330" class="blob-num js-line-number" data-line-number="330"></td>
<td id="LC330" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (rep <span class="pl-k">&amp;&amp;</span> <span class="pl-k">typeof</span> rep <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>object<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L331" class="blob-num js-line-number" data-line-number="331"></td>
<td id="LC331" class="blob-code blob-code-inner js-file-line"> length <span class="pl-k">=</span> rep.<span class="pl-c1">length</span>;</td>
</tr>
<tr>
<td id="L332" class="blob-num js-line-number" data-line-number="332"></td>
<td id="LC332" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (i <span class="pl-k">=</span> <span class="pl-c1">0</span>; i <span class="pl-k">&lt;</span> length; i <span class="pl-k">+=</span> <span class="pl-c1">1</span>) {</td>
</tr>
<tr>
<td id="L333" class="blob-num js-line-number" data-line-number="333"></td>
<td id="LC333" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-k">typeof</span> rep[i] <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>string<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L334" class="blob-num js-line-number" data-line-number="334"></td>
<td id="LC334" class="blob-code blob-code-inner js-file-line"> k <span class="pl-k">=</span> rep[i];</td>
</tr>
<tr>
<td id="L335" class="blob-num js-line-number" data-line-number="335"></td>
<td id="LC335" class="blob-code blob-code-inner js-file-line"> v <span class="pl-k">=</span> str(k, value);</td>
</tr>
<tr>
<td id="L336" class="blob-num js-line-number" data-line-number="336"></td>
<td id="LC336" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (v) {</td>
</tr>
<tr>
<td id="L337" class="blob-num js-line-number" data-line-number="337"></td>
<td id="LC337" class="blob-code blob-code-inner js-file-line"> partial.<span class="pl-c1">push</span>(quote(k) <span class="pl-k">+</span> (</td>
</tr>
<tr>
<td id="L338" class="blob-num js-line-number" data-line-number="338"></td>
<td id="LC338" class="blob-code blob-code-inner js-file-line"> gap </td>
</tr>
<tr>
<td id="L339" class="blob-num js-line-number" data-line-number="339"></td>
<td id="LC339" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">&#39;</span>: <span class="pl-pds">&#39;</span></span> </td>
</tr>
<tr>
<td id="L340" class="blob-num js-line-number" data-line-number="340"></td>
<td id="LC340" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span>:<span class="pl-pds">&#39;</span></span></td>
</tr>
<tr>
<td id="L341" class="blob-num js-line-number" data-line-number="341"></td>
<td id="LC341" class="blob-code blob-code-inner js-file-line"> ) <span class="pl-k">+</span> v);</td>
</tr>
<tr>
<td id="L342" class="blob-num js-line-number" data-line-number="342"></td>
<td id="LC342" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L343" class="blob-num js-line-number" data-line-number="343"></td>
<td id="LC343" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L344" class="blob-num js-line-number" data-line-number="344"></td>
<td id="LC344" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L345" class="blob-num js-line-number" data-line-number="345"></td>
<td id="LC345" class="blob-code blob-code-inner js-file-line"> } <span class="pl-k">else</span> {</td>
</tr>
<tr>
<td id="L346" class="blob-num js-line-number" data-line-number="346"></td>
<td id="LC346" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L347" class="blob-num js-line-number" data-line-number="347"></td>
<td id="LC347" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Otherwise, iterate through all of the keys in the object.</span></td>
</tr>
<tr>
<td id="L348" class="blob-num js-line-number" data-line-number="348"></td>
<td id="LC348" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L349" class="blob-num js-line-number" data-line-number="349"></td>
<td id="LC349" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (k <span class="pl-k">in</span> value) {</td>
</tr>
<tr>
<td id="L350" class="blob-num js-line-number" data-line-number="350"></td>
<td id="LC350" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">Object</span>.<span class="pl-c1">prototype</span>.hasOwnProperty.<span class="pl-c1">call</span>(value, k)) {</td>
</tr>
<tr>
<td id="L351" class="blob-num js-line-number" data-line-number="351"></td>
<td id="LC351" class="blob-code blob-code-inner js-file-line"> v <span class="pl-k">=</span> str(k, value);</td>
</tr>
<tr>
<td id="L352" class="blob-num js-line-number" data-line-number="352"></td>
<td id="LC352" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (v) {</td>
</tr>
<tr>
<td id="L353" class="blob-num js-line-number" data-line-number="353"></td>
<td id="LC353" class="blob-code blob-code-inner js-file-line"> partial.<span class="pl-c1">push</span>(quote(k) <span class="pl-k">+</span> (</td>
</tr>
<tr>
<td id="L354" class="blob-num js-line-number" data-line-number="354"></td>
<td id="LC354" class="blob-code blob-code-inner js-file-line"> gap </td>
</tr>
<tr>
<td id="L355" class="blob-num js-line-number" data-line-number="355"></td>
<td id="LC355" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">&#39;</span>: <span class="pl-pds">&#39;</span></span> </td>
</tr>
<tr>
<td id="L356" class="blob-num js-line-number" data-line-number="356"></td>
<td id="LC356" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span>:<span class="pl-pds">&#39;</span></span></td>
</tr>
<tr>
<td id="L357" class="blob-num js-line-number" data-line-number="357"></td>
<td id="LC357" class="blob-code blob-code-inner js-file-line"> ) <span class="pl-k">+</span> v);</td>
</tr>
<tr>
<td id="L358" class="blob-num js-line-number" data-line-number="358"></td>
<td id="LC358" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L359" class="blob-num js-line-number" data-line-number="359"></td>
<td id="LC359" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L360" class="blob-num js-line-number" data-line-number="360"></td>
<td id="LC360" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L361" class="blob-num js-line-number" data-line-number="361"></td>
<td id="LC361" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L362" class="blob-num js-line-number" data-line-number="362"></td>
<td id="LC362" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L363" class="blob-num js-line-number" data-line-number="363"></td>
<td id="LC363" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Join all of the member texts together, separated with commas,</span></td>
</tr>
<tr>
<td id="L364" class="blob-num js-line-number" data-line-number="364"></td>
<td id="LC364" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// and wrap them in braces.</span></td>
</tr>
<tr>
<td id="L365" class="blob-num js-line-number" data-line-number="365"></td>
<td id="LC365" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L366" class="blob-num js-line-number" data-line-number="366"></td>
<td id="LC366" class="blob-code blob-code-inner js-file-line"> v <span class="pl-k">=</span> partial.<span class="pl-c1">length</span> <span class="pl-k">===</span> <span class="pl-c1">0</span></td>
</tr>
<tr>
<td id="L367" class="blob-num js-line-number" data-line-number="367"></td>
<td id="LC367" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">&#39;</span>{}<span class="pl-pds">&#39;</span></span></td>
</tr>
<tr>
<td id="L368" class="blob-num js-line-number" data-line-number="368"></td>
<td id="LC368" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> gap</td>
</tr>
<tr>
<td id="L369" class="blob-num js-line-number" data-line-number="369"></td>
<td id="LC369" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">&#39;</span>{<span class="pl-cce">\n</span><span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> gap <span class="pl-k">+</span> partial.<span class="pl-c1">join</span>(<span class="pl-s"><span class="pl-pds">&#39;</span>,<span class="pl-cce">\n</span><span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> gap) <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\n</span><span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> mind <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>}<span class="pl-pds">&#39;</span></span></td>
</tr>
<tr>
<td id="L370" class="blob-num js-line-number" data-line-number="370"></td>
<td id="LC370" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span>{<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> partial.<span class="pl-c1">join</span>(<span class="pl-s"><span class="pl-pds">&#39;</span>,<span class="pl-pds">&#39;</span></span>) <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>}<span class="pl-pds">&#39;</span></span>;</td>
</tr>
<tr>
<td id="L371" class="blob-num js-line-number" data-line-number="371"></td>
<td id="LC371" class="blob-code blob-code-inner js-file-line"> gap <span class="pl-k">=</span> mind;</td>
</tr>
<tr>
<td id="L372" class="blob-num js-line-number" data-line-number="372"></td>
<td id="LC372" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> v;</td>
</tr>
<tr>
<td id="L373" class="blob-num js-line-number" data-line-number="373"></td>
<td id="LC373" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L374" class="blob-num js-line-number" data-line-number="374"></td>
<td id="LC374" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L375" class="blob-num js-line-number" data-line-number="375"></td>
<td id="LC375" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L376" class="blob-num js-line-number" data-line-number="376"></td>
<td id="LC376" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If the JSON object does not yet have a stringify method, give it one.</span></td>
</tr>
<tr>
<td id="L377" class="blob-num js-line-number" data-line-number="377"></td>
<td id="LC377" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L378" class="blob-num js-line-number" data-line-number="378"></td>
<td id="LC378" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-k">typeof</span> <span class="pl-c1">JSON</span>.stringify <span class="pl-k">!==</span> <span class="pl-s"><span class="pl-pds">&#39;</span>function<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L379" class="blob-num js-line-number" data-line-number="379"></td>
<td id="LC379" class="blob-code blob-code-inner js-file-line"> meta <span class="pl-k">=</span> { <span class="pl-c">// table of character substitutions</span></td>
</tr>
<tr>
<td id="L380" class="blob-num js-line-number" data-line-number="380"></td>
<td id="LC380" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\b</span><span class="pl-pds">&#39;</span></span><span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\\</span>b<span class="pl-pds">&#39;</span></span>,</td>
</tr>
<tr>
<td id="L381" class="blob-num js-line-number" data-line-number="381"></td>
<td id="LC381" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\t</span><span class="pl-pds">&#39;</span></span><span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\\</span>t<span class="pl-pds">&#39;</span></span>,</td>
</tr>
<tr>
<td id="L382" class="blob-num js-line-number" data-line-number="382"></td>
<td id="LC382" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\n</span><span class="pl-pds">&#39;</span></span><span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\\</span>n<span class="pl-pds">&#39;</span></span>,</td>
</tr>
<tr>
<td id="L383" class="blob-num js-line-number" data-line-number="383"></td>
<td id="LC383" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\f</span><span class="pl-pds">&#39;</span></span><span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\\</span>f<span class="pl-pds">&#39;</span></span>,</td>
</tr>
<tr>
<td id="L384" class="blob-num js-line-number" data-line-number="384"></td>
<td id="LC384" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\r</span><span class="pl-pds">&#39;</span></span><span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\\</span>r<span class="pl-pds">&#39;</span></span>,</td>
</tr>
<tr>
<td id="L385" class="blob-num js-line-number" data-line-number="385"></td>
<td id="LC385" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&#39;</span>&quot;<span class="pl-pds">&#39;</span></span><span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\\</span>&quot;<span class="pl-pds">&#39;</span></span>,</td>
</tr>
<tr>
<td id="L386" class="blob-num js-line-number" data-line-number="386"></td>
<td id="LC386" class="blob-code blob-code-inner js-file-line"> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\\</span><span class="pl-pds">&#39;</span></span><span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\\\\</span><span class="pl-pds">&#39;</span></span></td>
</tr>
<tr>
<td id="L387" class="blob-num js-line-number" data-line-number="387"></td>
<td id="LC387" class="blob-code blob-code-inner js-file-line"> };</td>
</tr>
<tr>
<td id="L388" class="blob-num js-line-number" data-line-number="388"></td>
<td id="LC388" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">JSON</span>.<span class="pl-en">stringify</span> <span class="pl-k">=</span> <span class="pl-k">function</span> (<span class="pl-smi">value</span>, <span class="pl-smi">replacer</span>, <span class="pl-smi">space</span>) {</td>
</tr>
<tr>
<td id="L389" class="blob-num js-line-number" data-line-number="389"></td>
<td id="LC389" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L390" class="blob-num js-line-number" data-line-number="390"></td>
<td id="LC390" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// The stringify method takes a value and an optional replacer, and an optional</span></td>
</tr>
<tr>
<td id="L391" class="blob-num js-line-number" data-line-number="391"></td>
<td id="LC391" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// space parameter, and returns a JSON text. The replacer can be a function</span></td>
</tr>
<tr>
<td id="L392" class="blob-num js-line-number" data-line-number="392"></td>
<td id="LC392" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// that can replace values, or an array of strings that will select the keys.</span></td>
</tr>
<tr>
<td id="L393" class="blob-num js-line-number" data-line-number="393"></td>
<td id="LC393" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// A default replacer method can be provided. Use of the space parameter can</span></td>
</tr>
<tr>
<td id="L394" class="blob-num js-line-number" data-line-number="394"></td>
<td id="LC394" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// produce text that is more easily readable.</span></td>
</tr>
<tr>
<td id="L395" class="blob-num js-line-number" data-line-number="395"></td>
<td id="LC395" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L396" class="blob-num js-line-number" data-line-number="396"></td>
<td id="LC396" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">var</span> i;</td>
</tr>
<tr>
<td id="L397" class="blob-num js-line-number" data-line-number="397"></td>
<td id="LC397" class="blob-code blob-code-inner js-file-line"> gap <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-pds">&#39;</span></span>;</td>
</tr>
<tr>
<td id="L398" class="blob-num js-line-number" data-line-number="398"></td>
<td id="LC398" class="blob-code blob-code-inner js-file-line"> indent <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-pds">&#39;</span></span>;</td>
</tr>
<tr>
<td id="L399" class="blob-num js-line-number" data-line-number="399"></td>
<td id="LC399" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L400" class="blob-num js-line-number" data-line-number="400"></td>
<td id="LC400" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If the space parameter is a number, make an indent string containing that</span></td>
</tr>
<tr>
<td id="L401" class="blob-num js-line-number" data-line-number="401"></td>
<td id="LC401" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// many spaces.</span></td>
</tr>
<tr>
<td id="L402" class="blob-num js-line-number" data-line-number="402"></td>
<td id="LC402" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L403" class="blob-num js-line-number" data-line-number="403"></td>
<td id="LC403" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-k">typeof</span> space <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>number<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L404" class="blob-num js-line-number" data-line-number="404"></td>
<td id="LC404" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (i <span class="pl-k">=</span> <span class="pl-c1">0</span>; i <span class="pl-k">&lt;</span> space; i <span class="pl-k">+=</span> <span class="pl-c1">1</span>) {</td>
</tr>
<tr>
<td id="L405" class="blob-num js-line-number" data-line-number="405"></td>
<td id="LC405" class="blob-code blob-code-inner js-file-line"> indent <span class="pl-k">+=</span> <span class="pl-s"><span class="pl-pds">&#39;</span> <span class="pl-pds">&#39;</span></span>;</td>
</tr>
<tr>
<td id="L406" class="blob-num js-line-number" data-line-number="406"></td>
<td id="LC406" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L407" class="blob-num js-line-number" data-line-number="407"></td>
<td id="LC407" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L408" class="blob-num js-line-number" data-line-number="408"></td>
<td id="LC408" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If the space parameter is a string, it will be used as the indent string.</span></td>
</tr>
<tr>
<td id="L409" class="blob-num js-line-number" data-line-number="409"></td>
<td id="LC409" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L410" class="blob-num js-line-number" data-line-number="410"></td>
<td id="LC410" class="blob-code blob-code-inner js-file-line"> } <span class="pl-k">else</span> <span class="pl-k">if</span> (<span class="pl-k">typeof</span> space <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>string<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L411" class="blob-num js-line-number" data-line-number="411"></td>
<td id="LC411" class="blob-code blob-code-inner js-file-line"> indent <span class="pl-k">=</span> space;</td>
</tr>
<tr>
<td id="L412" class="blob-num js-line-number" data-line-number="412"></td>
<td id="LC412" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L413" class="blob-num js-line-number" data-line-number="413"></td>
<td id="LC413" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L414" class="blob-num js-line-number" data-line-number="414"></td>
<td id="LC414" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If there is a replacer, it must be a function or an array.</span></td>
</tr>
<tr>
<td id="L415" class="blob-num js-line-number" data-line-number="415"></td>
<td id="LC415" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Otherwise, throw an error.</span></td>
</tr>
<tr>
<td id="L416" class="blob-num js-line-number" data-line-number="416"></td>
<td id="LC416" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L417" class="blob-num js-line-number" data-line-number="417"></td>
<td id="LC417" class="blob-code blob-code-inner js-file-line"> rep <span class="pl-k">=</span> replacer;</td>
</tr>
<tr>
<td id="L418" class="blob-num js-line-number" data-line-number="418"></td>
<td id="LC418" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (replacer <span class="pl-k">&amp;&amp;</span> <span class="pl-k">typeof</span> replacer <span class="pl-k">!==</span> <span class="pl-s"><span class="pl-pds">&#39;</span>function<span class="pl-pds">&#39;</span></span> <span class="pl-k">&amp;&amp;</span></td>
</tr>
<tr>
<td id="L419" class="blob-num js-line-number" data-line-number="419"></td>
<td id="LC419" class="blob-code blob-code-inner js-file-line"> (<span class="pl-k">typeof</span> replacer <span class="pl-k">!==</span> <span class="pl-s"><span class="pl-pds">&#39;</span>object<span class="pl-pds">&#39;</span></span> <span class="pl-k">||</span></td>
</tr>
<tr>
<td id="L420" class="blob-num js-line-number" data-line-number="420"></td>
<td id="LC420" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">typeof</span> replacer.<span class="pl-c1">length</span> <span class="pl-k">!==</span> <span class="pl-s"><span class="pl-pds">&#39;</span>number<span class="pl-pds">&#39;</span></span>)) {</td>
</tr>
<tr>
<td id="L421" class="blob-num js-line-number" data-line-number="421"></td>
<td id="LC421" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-en">Error</span>(<span class="pl-s"><span class="pl-pds">&#39;</span>JSON.stringify<span class="pl-pds">&#39;</span></span>);</td>
</tr>
<tr>
<td id="L422" class="blob-num js-line-number" data-line-number="422"></td>
<td id="LC422" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L423" class="blob-num js-line-number" data-line-number="423"></td>
<td id="LC423" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L424" class="blob-num js-line-number" data-line-number="424"></td>
<td id="LC424" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Make a fake root object containing our value under the key of &#39;&#39;.</span></td>
</tr>
<tr>
<td id="L425" class="blob-num js-line-number" data-line-number="425"></td>
<td id="LC425" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Return the result of stringifying the value.</span></td>
</tr>
<tr>
<td id="L426" class="blob-num js-line-number" data-line-number="426"></td>
<td id="LC426" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L427" class="blob-num js-line-number" data-line-number="427"></td>
<td id="LC427" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> str(<span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-pds">&#39;</span></span>, {<span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-pds">&#39;</span></span><span class="pl-k">:</span> value});</td>
</tr>
<tr>
<td id="L428" class="blob-num js-line-number" data-line-number="428"></td>
<td id="LC428" class="blob-code blob-code-inner js-file-line"> };</td>
</tr>
<tr>
<td id="L429" class="blob-num js-line-number" data-line-number="429"></td>
<td id="LC429" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L430" class="blob-num js-line-number" data-line-number="430"></td>
<td id="LC430" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L431" class="blob-num js-line-number" data-line-number="431"></td>
<td id="LC431" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L432" class="blob-num js-line-number" data-line-number="432"></td>
<td id="LC432" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If the JSON object does not yet have a parse method, give it one.</span></td>
</tr>
<tr>
<td id="L433" class="blob-num js-line-number" data-line-number="433"></td>
<td id="LC433" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L434" class="blob-num js-line-number" data-line-number="434"></td>
<td id="LC434" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-k">typeof</span> <span class="pl-c1">JSON</span>.parse <span class="pl-k">!==</span> <span class="pl-s"><span class="pl-pds">&#39;</span>function<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L435" class="blob-num js-line-number" data-line-number="435"></td>
<td id="LC435" class="blob-code blob-code-inner js-file-line"> <span class="pl-c1">JSON</span>.<span class="pl-en">parse</span> <span class="pl-k">=</span> <span class="pl-k">function</span> (<span class="pl-smi">text</span>, <span class="pl-smi">reviver</span>) {</td>
</tr>
<tr>
<td id="L436" class="blob-num js-line-number" data-line-number="436"></td>
<td id="LC436" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L437" class="blob-num js-line-number" data-line-number="437"></td>
<td id="LC437" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// The parse method takes a text and an optional reviver function, and returns</span></td>
</tr>
<tr>
<td id="L438" class="blob-num js-line-number" data-line-number="438"></td>
<td id="LC438" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// a JavaScript value if the text is a valid JSON text.</span></td>
</tr>
<tr>
<td id="L439" class="blob-num js-line-number" data-line-number="439"></td>
<td id="LC439" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L440" class="blob-num js-line-number" data-line-number="440"></td>
<td id="LC440" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">var</span> j;</td>
</tr>
<tr>
<td id="L441" class="blob-num js-line-number" data-line-number="441"></td>
<td id="LC441" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L442" class="blob-num js-line-number" data-line-number="442"></td>
<td id="LC442" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">function</span> <span class="pl-en">walk</span>(<span class="pl-smi">holder</span>, <span class="pl-smi">key</span>) {</td>
</tr>
<tr>
<td id="L443" class="blob-num js-line-number" data-line-number="443"></td>
<td id="LC443" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L444" class="blob-num js-line-number" data-line-number="444"></td>
<td id="LC444" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// The walk method is used to recursively walk the resulting structure so</span></td>
</tr>
<tr>
<td id="L445" class="blob-num js-line-number" data-line-number="445"></td>
<td id="LC445" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// that modifications can be made.</span></td>
</tr>
<tr>
<td id="L446" class="blob-num js-line-number" data-line-number="446"></td>
<td id="LC446" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L447" class="blob-num js-line-number" data-line-number="447"></td>
<td id="LC447" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">var</span> k, v, value <span class="pl-k">=</span> holder[key];</td>
</tr>
<tr>
<td id="L448" class="blob-num js-line-number" data-line-number="448"></td>
<td id="LC448" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (value <span class="pl-k">&amp;&amp;</span> <span class="pl-k">typeof</span> value <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>object<span class="pl-pds">&#39;</span></span>) {</td>
</tr>
<tr>
<td id="L449" class="blob-num js-line-number" data-line-number="449"></td>
<td id="LC449" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">for</span> (k <span class="pl-k">in</span> value) {</td>
</tr>
<tr>
<td id="L450" class="blob-num js-line-number" data-line-number="450"></td>
<td id="LC450" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-c1">Object</span>.<span class="pl-c1">prototype</span>.hasOwnProperty.<span class="pl-c1">call</span>(value, k)) {</td>
</tr>
<tr>
<td id="L451" class="blob-num js-line-number" data-line-number="451"></td>
<td id="LC451" class="blob-code blob-code-inner js-file-line"> v <span class="pl-k">=</span> walk(value, k);</td>
</tr>
<tr>
<td id="L452" class="blob-num js-line-number" data-line-number="452"></td>
<td id="LC452" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (v <span class="pl-k">!==</span> <span class="pl-c1">undefined</span>) {</td>
</tr>
<tr>
<td id="L453" class="blob-num js-line-number" data-line-number="453"></td>
<td id="LC453" class="blob-code blob-code-inner js-file-line"> value[k] <span class="pl-k">=</span> v;</td>
</tr>
<tr>
<td id="L454" class="blob-num js-line-number" data-line-number="454"></td>
<td id="LC454" class="blob-code blob-code-inner js-file-line"> } <span class="pl-k">else</span> {</td>
</tr>
<tr>
<td id="L455" class="blob-num js-line-number" data-line-number="455"></td>
<td id="LC455" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">delete</span> value[k];</td>
</tr>
<tr>
<td id="L456" class="blob-num js-line-number" data-line-number="456"></td>
<td id="LC456" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L457" class="blob-num js-line-number" data-line-number="457"></td>
<td id="LC457" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L458" class="blob-num js-line-number" data-line-number="458"></td>
<td id="LC458" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L459" class="blob-num js-line-number" data-line-number="459"></td>
<td id="LC459" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L460" class="blob-num js-line-number" data-line-number="460"></td>
<td id="LC460" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> reviver.<span class="pl-c1">call</span>(holder, key, value);</td>
</tr>
<tr>
<td id="L461" class="blob-num js-line-number" data-line-number="461"></td>
<td id="LC461" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L462" class="blob-num js-line-number" data-line-number="462"></td>
<td id="LC462" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L463" class="blob-num js-line-number" data-line-number="463"></td>
<td id="LC463" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L464" class="blob-num js-line-number" data-line-number="464"></td>
<td id="LC464" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Parsing happens in four stages. In the first stage, we replace certain</span></td>
</tr>
<tr>
<td id="L465" class="blob-num js-line-number" data-line-number="465"></td>
<td id="LC465" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// Unicode characters with escape sequences. JavaScript handles many characters</span></td>
</tr>
<tr>
<td id="L466" class="blob-num js-line-number" data-line-number="466"></td>
<td id="LC466" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// incorrectly, either silently deleting them, or treating them as line endings.</span></td>
</tr>
<tr>
<td id="L467" class="blob-num js-line-number" data-line-number="467"></td>
<td id="LC467" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L468" class="blob-num js-line-number" data-line-number="468"></td>
<td id="LC468" class="blob-code blob-code-inner js-file-line"> text <span class="pl-k">=</span> <span class="pl-c1">String</span>(text);</td>
</tr>
<tr>
<td id="L469" class="blob-num js-line-number" data-line-number="469"></td>
<td id="LC469" class="blob-code blob-code-inner js-file-line"> rx_dangerous.<span class="pl-c1">lastIndex</span> <span class="pl-k">=</span> <span class="pl-c1">0</span>;</td>
</tr>
<tr>
<td id="L470" class="blob-num js-line-number" data-line-number="470"></td>
<td id="LC470" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (rx_dangerous.<span class="pl-c1">test</span>(text)) {</td>
</tr>
<tr>
<td id="L471" class="blob-num js-line-number" data-line-number="471"></td>
<td id="LC471" class="blob-code blob-code-inner js-file-line"> text <span class="pl-k">=</span> text.<span class="pl-c1">replace</span>(rx_dangerous, <span class="pl-k">function</span> (<span class="pl-smi">a</span>) {</td>
</tr>
<tr>
<td id="L472" class="blob-num js-line-number" data-line-number="472"></td>
<td id="LC472" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-cce">\\</span>u<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span></td>
</tr>
<tr>
<td id="L473" class="blob-num js-line-number" data-line-number="473"></td>
<td id="LC473" class="blob-code blob-code-inner js-file-line"> (<span class="pl-s"><span class="pl-pds">&#39;</span>0000<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> a.<span class="pl-c1">charCodeAt</span>(<span class="pl-c1">0</span>).<span class="pl-c1">toString</span>(<span class="pl-c1">16</span>)).<span class="pl-c1">slice</span>(<span class="pl-k">-</span><span class="pl-c1">4</span>);</td>
</tr>
<tr>
<td id="L474" class="blob-num js-line-number" data-line-number="474"></td>
<td id="LC474" class="blob-code blob-code-inner js-file-line"> });</td>
</tr>
<tr>
<td id="L475" class="blob-num js-line-number" data-line-number="475"></td>
<td id="LC475" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L476" class="blob-num js-line-number" data-line-number="476"></td>
<td id="LC476" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L477" class="blob-num js-line-number" data-line-number="477"></td>
<td id="LC477" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// In the second stage, we run the text against regular expressions that look</span></td>
</tr>
<tr>
<td id="L478" class="blob-num js-line-number" data-line-number="478"></td>
<td id="LC478" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// for non-JSON patterns. We are especially concerned with &#39;()&#39; and &#39;new&#39;</span></td>
</tr>
<tr>
<td id="L479" class="blob-num js-line-number" data-line-number="479"></td>
<td id="LC479" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// because they can cause invocation, and &#39;=&#39; because it can cause mutation.</span></td>
</tr>
<tr>
<td id="L480" class="blob-num js-line-number" data-line-number="480"></td>
<td id="LC480" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// But just to be safe, we want to reject all unexpected forms.</span></td>
</tr>
<tr>
<td id="L481" class="blob-num js-line-number" data-line-number="481"></td>
<td id="LC481" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L482" class="blob-num js-line-number" data-line-number="482"></td>
<td id="LC482" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// We split the second stage into 4 regexp operations in order to work around</span></td>
</tr>
<tr>
<td id="L483" class="blob-num js-line-number" data-line-number="483"></td>
<td id="LC483" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// crippling inefficiencies in IE&#39;s and Safari&#39;s regexp engines. First we</span></td>
</tr>
<tr>
<td id="L484" class="blob-num js-line-number" data-line-number="484"></td>
<td id="LC484" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// replace the JSON backslash pairs with &#39;@&#39; (a non-JSON character). Second, we</span></td>
</tr>
<tr>
<td id="L485" class="blob-num js-line-number" data-line-number="485"></td>
<td id="LC485" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// replace all simple value tokens with &#39;]&#39; characters. Third, we delete all</span></td>
</tr>
<tr>
<td id="L486" class="blob-num js-line-number" data-line-number="486"></td>
<td id="LC486" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// open brackets that follow a colon or comma or that begin the text. Finally,</span></td>
</tr>
<tr>
<td id="L487" class="blob-num js-line-number" data-line-number="487"></td>
<td id="LC487" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// we look to see that the remaining characters are only whitespace or &#39;]&#39; or</span></td>
</tr>
<tr>
<td id="L488" class="blob-num js-line-number" data-line-number="488"></td>
<td id="LC488" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// &#39;,&#39; or &#39;:&#39; or &#39;{&#39; or &#39;}&#39;. If that is so, then the text is safe for eval.</span></td>
</tr>
<tr>
<td id="L489" class="blob-num js-line-number" data-line-number="489"></td>
<td id="LC489" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L490" class="blob-num js-line-number" data-line-number="490"></td>
<td id="LC490" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">if</span> (</td>
</tr>
<tr>
<td id="L491" class="blob-num js-line-number" data-line-number="491"></td>
<td id="LC491" class="blob-code blob-code-inner js-file-line"> rx_one.<span class="pl-c1">test</span>(</td>
</tr>
<tr>
<td id="L492" class="blob-num js-line-number" data-line-number="492"></td>
<td id="LC492" class="blob-code blob-code-inner js-file-line"> text</td>
</tr>
<tr>
<td id="L493" class="blob-num js-line-number" data-line-number="493"></td>
<td id="LC493" class="blob-code blob-code-inner js-file-line"> .<span class="pl-c1">replace</span>(rx_two, <span class="pl-s"><span class="pl-pds">&#39;</span>@<span class="pl-pds">&#39;</span></span>)</td>
</tr>
<tr>
<td id="L494" class="blob-num js-line-number" data-line-number="494"></td>
<td id="LC494" class="blob-code blob-code-inner js-file-line"> .<span class="pl-c1">replace</span>(rx_three, <span class="pl-s"><span class="pl-pds">&#39;</span>]<span class="pl-pds">&#39;</span></span>)</td>
</tr>
<tr>
<td id="L495" class="blob-num js-line-number" data-line-number="495"></td>
<td id="LC495" class="blob-code blob-code-inner js-file-line"> .<span class="pl-c1">replace</span>(rx_four, <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-pds">&#39;</span></span>)</td>
</tr>
<tr>
<td id="L496" class="blob-num js-line-number" data-line-number="496"></td>
<td id="LC496" class="blob-code blob-code-inner js-file-line"> )</td>
</tr>
<tr>
<td id="L497" class="blob-num js-line-number" data-line-number="497"></td>
<td id="LC497" class="blob-code blob-code-inner js-file-line"> ) {</td>
</tr>
<tr>
<td id="L498" class="blob-num js-line-number" data-line-number="498"></td>
<td id="LC498" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L499" class="blob-num js-line-number" data-line-number="499"></td>
<td id="LC499" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// In the third stage we use the eval function to compile the text into a</span></td>
</tr>
<tr>
<td id="L500" class="blob-num js-line-number" data-line-number="500"></td>
<td id="LC500" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// JavaScript structure. The &#39;{&#39; operator is subject to a syntactic ambiguity</span></td>
</tr>
<tr>
<td id="L501" class="blob-num js-line-number" data-line-number="501"></td>
<td id="LC501" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// in JavaScript: it can begin a block or an object literal. We wrap the text</span></td>
</tr>
<tr>
<td id="L502" class="blob-num js-line-number" data-line-number="502"></td>
<td id="LC502" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// in parens to eliminate the ambiguity.</span></td>
</tr>
<tr>
<td id="L503" class="blob-num js-line-number" data-line-number="503"></td>
<td id="LC503" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L504" class="blob-num js-line-number" data-line-number="504"></td>
<td id="LC504" class="blob-code blob-code-inner js-file-line"> j <span class="pl-k">=</span> <span class="pl-c1">eval</span>(<span class="pl-s"><span class="pl-pds">&#39;</span>(<span class="pl-pds">&#39;</span></span> <span class="pl-k">+</span> text <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">&#39;</span>)<span class="pl-pds">&#39;</span></span>);</td>
</tr>
<tr>
<td id="L505" class="blob-num js-line-number" data-line-number="505"></td>
<td id="LC505" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L506" class="blob-num js-line-number" data-line-number="506"></td>
<td id="LC506" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// In the optional fourth stage, we recursively walk the new structure, passing</span></td>
</tr>
<tr>
<td id="L507" class="blob-num js-line-number" data-line-number="507"></td>
<td id="LC507" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// each name/value pair to a reviver function for possible transformation.</span></td>
</tr>
<tr>
<td id="L508" class="blob-num js-line-number" data-line-number="508"></td>
<td id="LC508" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L509" class="blob-num js-line-number" data-line-number="509"></td>
<td id="LC509" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">return</span> <span class="pl-k">typeof</span> reviver <span class="pl-k">===</span> <span class="pl-s"><span class="pl-pds">&#39;</span>function<span class="pl-pds">&#39;</span></span></td>
</tr>
<tr>
<td id="L510" class="blob-num js-line-number" data-line-number="510"></td>
<td id="LC510" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">?</span> walk({<span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-pds">&#39;</span></span><span class="pl-k">:</span> j}, <span class="pl-s"><span class="pl-pds">&#39;</span><span class="pl-pds">&#39;</span></span>)</td>
</tr>
<tr>
<td id="L511" class="blob-num js-line-number" data-line-number="511"></td>
<td id="LC511" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">:</span> j;</td>
</tr>
<tr>
<td id="L512" class="blob-num js-line-number" data-line-number="512"></td>
<td id="LC512" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L513" class="blob-num js-line-number" data-line-number="513"></td>
<td id="LC513" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L514" class="blob-num js-line-number" data-line-number="514"></td>
<td id="LC514" class="blob-code blob-code-inner js-file-line"><span class="pl-c">// If the text is not JSON parseable, then a SyntaxError is thrown.</span></td>
</tr>
<tr>
<td id="L515" class="blob-num js-line-number" data-line-number="515"></td>
<td id="LC515" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="L516" class="blob-num js-line-number" data-line-number="516"></td>
<td id="LC516" class="blob-code blob-code-inner js-file-line"> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-en">SyntaxError</span>(<span class="pl-s"><span class="pl-pds">&#39;</span>JSON.parse<span class="pl-pds">&#39;</span></span>);</td>
</tr>
<tr>
<td id="L517" class="blob-num js-line-number" data-line-number="517"></td>
<td id="LC517" class="blob-code blob-code-inner js-file-line"> };</td>
</tr>
<tr>
<td id="L518" class="blob-num js-line-number" data-line-number="518"></td>
<td id="LC518" class="blob-code blob-code-inner js-file-line"> }</td>
</tr>
<tr>
<td id="L519" class="blob-num js-line-number" data-line-number="519"></td>
<td id="LC519" class="blob-code blob-code-inner js-file-line">}());</td>
</tr>
</table>
</div>
</div>
<a href="#jump-to-line" rel="facebox[.linejump]" data-hotkey="l" style="display:none">Jump to Line</a>
<div id="jump-to-line" style="display:none">
<form accept-charset="UTF-8" action="" class="js-jump-to-line-form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
<input class="linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line&hellip;" autofocus>
<button type="submit" class="btn">Go</button>
</form></div>
</div>
</div><!-- /.repo-container -->
<div class="modal-backdrop"></div>
</div><!-- /.container -->
</div><!-- /.site -->
</div><!-- /.wrapper -->
<div class="container">
<div class="site-footer" role="contentinfo">
<ul class="site-footer-links right">
<li><a href="https://status.github.com/" data-ga-click="Footer, go to status, text:status">Status</a></li>
<li><a href="https://developer.github.com" data-ga-click="Footer, go to api, text:api">API</a></li>
<li><a href="https://training.github.com" data-ga-click="Footer, go to training, text:training">Training</a></li>
<li><a href="https://shop.github.com" data-ga-click="Footer, go to shop, text:shop">Shop</a></li>
<li><a href="https://github.com/blog" data-ga-click="Footer, go to blog, text:blog">Blog</a></li>
<li><a href="https://github.com/about" data-ga-click="Footer, go to about, text:about">About</a></li>
</ul>
<a href="https://github.com" aria-label="Homepage">
<span class="mega-octicon octicon-mark-github" title="GitHub"></span>
</a>
<ul class="site-footer-links">
<li>&copy; 2015 <span title="0.03851s from github-fe121-cp1-prd.iad.github.net">GitHub</span>, Inc.</li>
<li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
<li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li>
<li><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li>
<li><a href="https://github.com/contact" data-ga-click="Footer, go to contact, text:contact">Contact</a></li>
</ul>
</div>
</div>
<div class="fullscreen-overlay js-fullscreen-overlay" id="fullscreen_overlay">
<div class="fullscreen-container js-suggester-container">
<div class="textarea-wrap">
<textarea name="fullscreen-contents" id="fullscreen-contents" class="fullscreen-contents js-fullscreen-contents" placeholder=""></textarea>
<div class="suggester-container">
<div class="suggester fullscreen-suggester js-suggester js-navigation-container"></div>
</div>
</div>
</div>
<div class="fullscreen-sidebar">
<a href="#" class="exit-fullscreen js-exit-fullscreen tooltipped tooltipped-w" aria-label="Exit Zen Mode">
<span class="mega-octicon octicon-screen-normal"></span>
</a>
<a href="#" class="theme-switcher js-theme-switcher tooltipped tooltipped-w"
aria-label="Switch themes">
<span class="octicon octicon-color-mode"></span>
</a>
</div>
</div>
<div id="ajax-error-message" class="flash flash-error">
<span class="octicon octicon-alert"></span>
<a href="#" class="octicon octicon-x flash-close js-ajax-error-dismiss" aria-label="Dismiss error"></a>
Something went wrong with that request. Please try again.
</div>
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/frameworks-5c08de317e4054ec200d36d3b1361ddd3cb30c05c9070a9d72862ee28ab1d7f9.js"></script>
<script async="async" crossorigin="anonymous" src="https://assets-cdn.github.com/assets/github/index-9667fc87059ac15902a2b5cd195f6d286f579de6d08c171acc055b3ceddbe0b7.js"></script>
</body>
</html>

Комментарий ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/lunarsf-Lunar-Markdown-Editor.git
git@gitlife.ru:oschina-mirror/lunarsf-Lunar-Markdown-Editor.git
oschina-mirror
lunarsf-Lunar-Markdown-Editor
lunarsf-Lunar-Markdown-Editor
v0.4-beta8