aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/mozilla/projects
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/mozilla/projects')
-rw-r--r--files/zh-cn/mozilla/projects/crash_reporting/index.html47
-rw-r--r--files/zh-cn/mozilla/projects/emscripten/index.html37
-rw-r--r--files/zh-cn/mozilla/projects/index.html14
-rw-r--r--files/zh-cn/mozilla/projects/l20n/index.html127
-rw-r--r--files/zh-cn/mozilla/projects/nspr/index.html60
-rw-r--r--files/zh-cn/mozilla/projects/nspr/reference/index.html770
-rw-r--r--files/zh-cn/mozilla/projects/nspr/reference/memory_management_operations/index.html424
-rw-r--r--files/zh-cn/mozilla/projects/psm/index.html15
-rw-r--r--files/zh-cn/mozilla/projects/rhino/bsf/index.html10
-rw-r--r--files/zh-cn/mozilla/projects/rhino/community/index.html24
-rw-r--r--files/zh-cn/mozilla/projects/rhino/debugger/index.html220
-rw-r--r--files/zh-cn/mozilla/projects/rhino/documentation/index.html81
-rw-r--r--files/zh-cn/mozilla/projects/rhino/download_rhino/index.html106
-rw-r--r--files/zh-cn/mozilla/projects/rhino/embedding_tutorial/index.html221
-rw-r--r--files/zh-cn/mozilla/projects/rhino/examples/index.html35
-rw-r--r--files/zh-cn/mozilla/projects/rhino/index.html22
-rw-r--r--files/zh-cn/mozilla/projects/rhino/license/index.html47
-rw-r--r--files/zh-cn/mozilla/projects/rhino/overview/index.html78
-rw-r--r--files/zh-cn/mozilla/projects/rhino/requirements_and_limitations/index.html24
-rw-r--r--files/zh-cn/mozilla/projects/rhino/scripting_java/index.html397
-rw-r--r--files/zh-cn/mozilla/projects/rhino/shell/index.html179
-rw-r--r--files/zh-cn/mozilla/projects/social_api/index.html97
-rw-r--r--files/zh-cn/mozilla/projects/social_api/share/index.html86
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/build_documentation/index.html294
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/comparision_of_js_engines/index.html105
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/index.html132
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/internals/bytecodes/index.html30
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/internals/functions/index.html73
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/internals/index.html292
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/introduction_to_the_javascript_shell/index.html382
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/javascript-c引擎嵌入开发指南/index.html11
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/boolean_to_jsval/index.html53
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/index.html646
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_defineconstdoubles/index.html59
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_doublecolon_call/index.html92
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_doublecolon_ordinarytoprimitive/index.html66
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_evaluatescript/index.html69
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_getversion/index.html29
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_hasownproperty/index.html73
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_newruntime/index.html33
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_seterrorreporter/index.html61
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_valuetostring/index.html45
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsclass/index.html137
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsconstdoublespec/index.html56
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jserrorreport/index.html6
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsproperty/index.html29
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jspropertydescriptor/index.html69
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsruntime/index.html29
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/parser_api/index.html1625
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/releases/index.html42
-rw-r--r--files/zh-cn/mozilla/projects/spidermonkey/split_object/index.html72
51 files changed, 7731 insertions, 0 deletions
diff --git a/files/zh-cn/mozilla/projects/crash_reporting/index.html b/files/zh-cn/mozilla/projects/crash_reporting/index.html
new file mode 100644
index 0000000000..bb8fd91519
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/crash_reporting/index.html
@@ -0,0 +1,47 @@
+---
+title: Crash reporting
+slug: Mozilla/Projects/Crash_reporting
+tags:
+ - Crashes
+ - Developer Guide
+ - Developing Mozilla
+ - Firefox
+ - Mozilla
+ - NeedsTranslation
+ - QA
+ - TopicStub
+ - crash reports
+translation_of: Mozilla/Projects/Crash_reporting
+---
+<p>Firefox ships with an open-source crash reporting system. This system is combination of projects:</p>
+
+<ul>
+ <li><a href="http://code.google.com/p/google-breakpad/">Google Breakpad</a> client and server libraries</li>
+ <li>Mozilla-specific crash reporting user interface and bootstrap code</li>
+ <li><a href="https://github.com/mozilla/socorro">Socorro</a> Collection and reporting server</li>
+</ul>
+
+<h2 id="Where_did_my_crash_get_submitted.3F" name="Where_did_my_crash_get_submitted.3F">Where did my crash get submitted?</h2>
+
+<p>Crash data submitted using the Mozilla Crash Reporter is located on <a href="http://crash-stats.mozilla.com/">crash-stats</a>. If you want to find a specific crash that you submitted, you first need to find the Crash ID that the server has assigned your crash. Type <code>about:crashes</code> into your location bar to get a page listing both submitted and unsubmitted crash reports. For more information, see <a href="/en-US/docs/How_to_get_a_stacktrace_for_a_bug_report" title="How to get a stacktrace for a bug report">How to get a stacktrace for a bug report</a>.</p>
+
+<h2 id="Reports_and_queries">Reports and queries</h2>
+
+<p>crash-stats has built-in reports of "topcrashes" for each release grouped by signature. There is also a custom query tool which allows users to limit searches on more precise information.</p>
+
+<p>For more automated usage, a summary of each day's crash reports is published as a CSV file, as well as batch analysis jobs. These can be found at <a href="https://crash-analysis.mozilla.com/crash_analysis/">https://crash-analysis.mozilla.com/crash_analysis/</a></p>
+
+<p>Finally, a set of Mozilla employees have access to directly query the underlying data in either SQL summary or using mapreduce on the storage cluster. If you are interested in obtaining this advanced access, contact <a href="mailto:benjamin@smedbergs.us?subject=crash-stats%20access%20query" title="mailto:benjamin@smedbergs.us?subject=crash-stats%20access%20query">Benjamin Smedberg</a>.</p>
+
+<h2 id="Additional_information" name="Additional_information">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Mozilla/Projects/Crash_reporting/Understanding_crash_reports">Understanding crash reports</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/Crash_reporting/Searching_crash_reports">A guide to searching crash reports</a></li>
+ <li><a href="http://crash-stats.mozilla.com/">crash-stats</a></li>
+ <li><a href="/en-US/docs/Building_Firefox_with_Debug_Symbols">Building Firefox with Debug Symbols</a></li>
+ <li><a href="/en-US/docs/Environment_variables_affecting_crash_reporting">Environment variables affecting crash reporting</a></li>
+ <li><a href="/en-US/docs/Crash_Reporting_Guide_for_Firefox_OS_Partners" title="/en-US/docs/Crash_Reporting_Guide_for_Firefox_OS_Partners">Crash Reporting Guide for Firefox OS Partners</a></li>
+ <li><a href="/en-US/docs/Uploading_symbols_to_Mozillas_symbol_server" title="/en-US/docs/Uploading_symbols_to_Mozillas_symbol_server">Uploading Symbols to Mozilla's Symbol Server</a> (guide for partners)</li>
+ <li><a href="/en-US/docs/Using_Crash_Reporting_in_a_XULRunner_Application">Using Crash Reporting in a XULRunner Application</a></li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/emscripten/index.html b/files/zh-cn/mozilla/projects/emscripten/index.html
new file mode 100644
index 0000000000..9d488c2d8e
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/emscripten/index.html
@@ -0,0 +1,37 @@
+---
+title: Emscripten
+slug: Mozilla/Projects/Emscripten
+translation_of: Mozilla/Projects/Emscripten
+---
+<p><span class="seoSummary">Emscripten 是一个 LLVM (底层虚拟机)生成 JavaScript 的编译器. 它采用 LLVM 的字节码 (例如,使用 Clang 从 C/C++ 或者从其他语言生成的字节码) 并将其编译成可在 Web 上面运行的 </span>JavaScript<span class="seoSummary">。</span></p>
+
+<div class="warning">
+<p><strong>重要提示:</strong><font>本页简要介绍了 Emscripten 是什么。</font><font>要开始使用 Emscripten</font>,<a href="http://kripken.github.io/emscripten-site/index.html">请访问官方的Emscripten Wiki</a>。</p>
+</div>
+
+<p>使用 Emscripten,你可以</p>
+
+<ul>
+ <li>将 C 和 C++ 代码编译成 JavaScript</li>
+ <li>将可以翻译为 LLVM 字节码的任何其他代码编译为 JavaScript</li>
+ <li>将其他语言的 C / C ++ 运行时编译为 JavaScript,然后间接使用其他语言运行代码(已在Python和Lua中运行成功)!</li>
+</ul>
+
+<p>Emscripten 使原生代码可立即使用在 Web 上:是一个具有众多独立兼容的实现,可在从 PC 到 iPad 的任何地方运行的标准平台。</p>
+
+<p>借助 Emscripten,C / C ++ 开发人员无需手动将代码移植到 JavaScript 上,也无需学习 JavaScript。Web 开发人员也可以从中受益,因为他们可以在自己的站点中使用成千上万的已存在的原生实用程序和库。</p>
+
+<p>实际上,任何可移植的 C 或 C++ 代码库都可以通过 Emscripten 编译成 JavaScript,从需要渲染图形,播放声音,加载和处理文件的高性能游戏到诸如 Qt 的应用程序框架。</p>
+
+<p>Emscripten 生成的代码(其默认输出格式为 <a href="/en-US/docs/Games/Tools/asm.js">asm.js</a> ,这是 JavaScript 的高度优化子集)在许多情况下可以以接近原生的速度执行。</p>
+
+<div class="note">
+<p><strong>注意:</strong>听起来有趣吗? <a href="http://kripken.github.io/emscripten-site/docs/introducing_emscripten/about_emscripten.html">阅读有关 Emscripten 的更多信息并尝试一些 demo</a>,然后<a href="http://kripken.github.io/emscripten-site/docs/getting_started/index.html">开始使用它</a>。</p>
+</div>
+
+<h2 id="MDN上其他有趣的文章">MDN上其他有趣的文章</h2>
+
+<ul>
+ <li>我们的 <a href="/en-US/docs/Games">游戏专区</a> 包含了一些游戏开发相关的有用内容,这是一个 Emscripten 被广泛应用的领域</li>
+ <li>我们的 <a href="/en-US/docs/Mozilla/Projects/Emscripten/Techniques">Emscripten 技巧</a> 页面保存了许多未公开在 Emscripten Wiki 上的有关 Emscripten 的实用想法</li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/index.html b/files/zh-cn/mozilla/projects/index.html
new file mode 100644
index 0000000000..c1e43934a2
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/index.html
@@ -0,0 +1,14 @@
+---
+title: Projects
+slug: Mozilla/Projects
+tags:
+ - Mozilla
+ - NeedsContent
+ - NeedsTranslation
+ - Projects
+ - TopicStub
+translation_of: Mozilla/Projects
+---
+<p>{{ draft() }}</p>
+<p>Below you'll find links to documentation about various Mozilla projects; these are often parts of Firefox or other products, but may also be used in other projects as well.</p>
+<p>{{ LandingPageListSubpages() }}</p>
diff --git a/files/zh-cn/mozilla/projects/l20n/index.html b/files/zh-cn/mozilla/projects/l20n/index.html
new file mode 100644
index 0000000000..ce256b741f
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/l20n/index.html
@@ -0,0 +1,127 @@
+---
+title: L20n
+slug: Mozilla/Projects/L20n
+translation_of: Mozilla/Projects/L20n
+---
+<p>当这个文档还是草案的时候, 请上 <a href="https://github.com/l20n/l20n.js/tree/master/docs">GitHub</a>.</p>
+<div class="summary">
+ 一个JavaScript本地化框架, 释放你的本地语言的魅力, 仅使用简单的代码.</div>
+<div class="column-container">
+ <div class="column-half">
+ <h2 id="Introducing_L20n">Introducing L20n</h2>
+ <p>L20n reinvents software localization. Users should be able to benefit from the entire expressive power of the natural language. L20n keeps simple things simple, and at the same time makes complex things possible.</p>
+ <p>Through L20n, Mozilla is creating a new generation of technology that places more power in localizers' hands. <span class="seoSummary">L20n lets localizers reach higher levels of free linguistic expression by sharpening the divide between localization and application logic.</span> It allows to adapt your web application not only to languages and cultures, but also contextual data, user gender and screen dimensions.</p>
+ </div>
+ <div class="column-half">
+ <h2 id="What_L20n_looks_like">What L20n looks like</h2>
+ <p>Here is a simple, straightforward example showing an English string being provided:</p>
+ <pre class="brush: html">&lt;brandName "Firefox"&gt;
+&lt;about "About \{{ brandName }}"&gt;</pre>
+ <p>Here is the same string being provided in Slovenian:</p>
+ <pre class="brush: html">&lt;brandName {
+ nominative: "Firefox",
+ genitive: "Firefoxa",
+ dative: "Firefoxu",
+ accusative: "Firefox",
+ locative: "Firefoxu",
+ instrumental: "Firefoxom"
+}&gt;
+&lt;about "O \{{ brandName.locative }}"&gt;</pre>
+ </div>
+</div>
+<p> </p>
+<div class="column-container">
+ <div class="column-third">
+ <h2 class="Documentation" id="For_Developers">For Developers</h2>
+ <p><strong>Documentation for developers wanting to implement localization functionality on their web apps using L20n.</strong></p>
+ <dl>
+ <dt>
+ Internationalization for your web app</dt>
+ <dd>
+ First read for developers looking to use the L20n infrastructure.</dd>
+ <dt>
+ <a href="https://developer.mozilla.org/en-US/docs/L20n/HTML_Bindings">L20n's HTML bindings</a></dt>
+ <dd>
+ Tutorial on implementing L20n in your HTML code.</dd>
+ <dt>
+ <a href="/en-US/docs/L20n/Javascript_API">L20n JavaScript API</a></dt>
+ <dd>
+ An API for l20n.js.</dd>
+ <dt>
+ L20n syntax cheatsheet for developers</dt>
+ <dd>
+ A simple cheatsheet to help developers as they add L20n to their localization infrastructure.</dd>
+ </dl>
+ </div>
+ <div class="column-third">
+ <h2 class="Documentation" id="For_Localizers">For Localizers</h2>
+ <p><strong>Documentation for Localizers creating localized content for a project that uses L20n.</strong></p>
+ <dl>
+ <dt>
+ <a href="http://l20n.org/learn/">Learn the L20n syntax</a></dt>
+ <dd>
+ How to naturally localize applications using L20n. Complete with use cases and examples of L20n in action.</dd>
+ <dt>
+ <a href="https://developer.mozilla.org/en-US/docs/L20n/Localization_Use_Cases">Localization use-cases</a></dt>
+ <dd>
+ How to naturally localize applications using L20n. Complete with use cases and examples of L20n in action.</dd>
+ <dt>
+ L20n and Translation Memory eXchange (TMX)</dt>
+ <dd>
+ How L20n impacts the Translation Memory eXchange standard for translation memory data.</dd>
+ <dt>
+ L20n syntax cheatsheet for localizers</dt>
+ <dd>
+ A simple cheatsheet to help localizers as they localize projects with L20n.</dd>
+ </dl>
+ </div>
+ <div class="column-third">
+ <h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">Additional resources</h2>
+ <p><strong>Some additional resources for developers and localizers involved with L20n.</strong></p>
+ <dl>
+ <dt>
+ <a href="http://www.l20n.org" title="http://www.l20n.org">L20n.org</a></dt>
+ <dd>
+ You can try L20n live in your browser on the project page.</dd>
+ <dt>
+ <a href="http://l20n.github.io/tinker/" title="http://l20n.github.io/tinker/">L20n Tinker</a></dt>
+ <dd>
+ Test out your own L20n code in L20n Tinker.</dd>
+ <dt>
+ <a href="https://github.com/l20n" title="https://github.com/l20n/l20n.js">GitHub</a></dt>
+ <dd>
+ Where the main code for the L20n infrastructure and design spec lives.</dd>
+ <dt>
+ <a href="https://wiki.mozilla.org/L20n" title="https://wiki.mozilla.org/L20n">Wiki page</a></dt>
+ <dd>
+ Info about the project to develop L20n.</dd>
+ </dl>
+ </div>
+</div>
+<h2 id="Subnav">Subnav</h2>
+<ol>
+ <li><a href="#" title="Documentation for developers wanting to implement localization functionality on their web apps using L20n">For Developers</a>
+ <ol>
+ <li><a href="#" title="First read for developers looking to use the L20n infrastructure">Internationalization for your web app</a></li>
+ <li><a href="#" title="Tutorial on implementing L20n in your HTML code">L20n's HTML bindings</a></li>
+ <li><a href="#" title="A complete description of the use, function, and role of L20n's .lol format.">.lol file format</a></li>
+ <li><a href="#" title="A simple cheatsheet to help developers as they add L20n to their localization infrastructure.">L20n syntax cheatsheet for developers</a></li>
+ </ol>
+ </li>
+ <li><a href="#" title="Documentation for Localizers creating localized content for a project that uses L20n.">For Localizers</a>
+ <ol>
+ <li><a href="#" title="How to naturally localize applications using L20n. Complete with use cases and examples of L20n in action.">Learn the L20n syntax</a></li>
+ <li><a href="/en-US/docs/L20n/Localization_Use_Cases">Localization use cases</a></li>
+ <li><a href="#" title="How L20n impacts the Translation Memory eXchange standard for translation memory data.">L20n and Translation Memory eXchange (TMX)</a></li>
+ <li><a href="#" title="A simple cheatsheet to help localizers as they localize projects with L20n.">L20n syntax cheatsheet for localizers</a></li>
+ </ol>
+ </li>
+ <li><a href="#" title="Some additional resources for developers and localizers involved with L20n.">Additional resources</a>
+ <ol>
+ <li><a href="http://www.l20n.org" title="You can try L20n live in your browser on the project page">L20n.org</a></li>
+ <li><a href="http://l20n.github.io/tinker/" title="Test out your own L20n code in L20n Tinker">L20n Tinker</a></li>
+ <li><a href="https://github.com/l20n/l20n.js" title="Where the main code for the L20n infrastructure and language lives">L20n GitHub repo</a></li>
+ <li><a href="https://wiki.mozilla.org/L20n" title="Info about the project to develop L20n">Mozilla Wiki</a></li>
+ </ol>
+ </li>
+</ol>
diff --git a/files/zh-cn/mozilla/projects/nspr/index.html b/files/zh-cn/mozilla/projects/nspr/index.html
new file mode 100644
index 0000000000..2ae2b7b9d5
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/nspr/index.html
@@ -0,0 +1,60 @@
+---
+title: NSPR
+slug: Mozilla/Projects/NSPR
+translation_of: Mozilla/Projects/NSPR
+---
+<h2 id="Netscape_Portable_Runtime_(NSPR)_提供一套面向系统级的与平台无关的_API_和类似于libc的函数._这些API被用在Mozilla客户端_Red_Hat公司、Sun公司的服务应用程序以及其他公司的一些软件中。"><strong>Netscape Portable Runtime</strong> (<strong>NSPR</strong>)  提供一套面向系统级的与平台无关的 API  和类似于libc的函数. 这些API被用在Mozilla客户端, Red Hat公司、Sun公司的服务应用程序以及其他公司的一些软件中。</h2>
+<table class="topicpage-table">
+ <tbody>
+ <tr>
+ <td>
+ <h2 id="Documentation" name="Documentation"><a href="/Special:Tags?tag=NSPR&amp;language=en" title="Special:Tags?tag=NSPR&amp;language=en">文档</a></h2>
+ <dl>
+ <dt>
+ <a class="external" href="http://www.mozilla.org/projects/nspr/">NSPR工程页面</a></dt>
+ <dd>
+ <small>Contains some older technical notes and training materials. (at mozilla.org)</small></dd>
+ </dl>
+ <dl>
+ <dt>
+ <a href="/en/About_NSPR" title="en/About_NSPR">关于 NSPR</a></dt>
+ <dd>
+ <small>This topic describes, in general terms, the goals of NSPR and a bit about how it does it.</small></dd>
+ </dl>
+ <dl>
+ <dt>
+ <a href="/en/NSPR_API_Reference" title="en/NSPR_API_Reference">NSPR API Reference</a></dt>
+ <dd>
+ <small>The reference describes each API public macro, structure and function in the NSPR API.</small></dd>
+ </dl>
+ <dl>
+ <dt>
+ <a href="/en/NSPR_build_instructions" title="en/NSPR_build_instructions">NSPR build instructions</a></dt>
+ <dd>
+ <small>How to checkout and build from source.</small></dd>
+ </dl>
+ <dl>
+ <dt>
+ <a href="/en/NSPR_release_process" title="en/NSPR_release_process">NSPR release process</a></dt>
+ <dd>
+ <small>How to prepare an NSPR release.</small></dd>
+ </dl>
+ <p><span class="alllinks"><a href="/Special:Tags?tag=NSPR&amp;language=en" title="Special:Tags?tag=NSPR&amp;language=en">View All...</a></span></p>
+ </td>
+ <td>
+ <h2 id="Community" name="Community">Community</h2>
+ <ul>
+ <li>View Mozilla forums...</li>
+ </ul>
+ <p>{{ DiscussionList("dev-tech-nspr", "mozilla.dev.tech.nspr") }}</p>
+ <h2 id="Related_Topics" name="Related_Topics">Related Topics</h2>
+ <dl>
+ <dd>
+ <a href="/en/Necko" title="en/Necko">Necko</a>, <a href="/en/NSS" title="en/NSS">NSS</a></dd>
+ </dl>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<p> </p>
+<p>{{ languages( { "ja": "ja/NSPR", "it": "it/NSPR" } ) }}</p>
diff --git a/files/zh-cn/mozilla/projects/nspr/reference/index.html b/files/zh-cn/mozilla/projects/nspr/reference/index.html
new file mode 100644
index 0000000000..fe690af267
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/nspr/reference/index.html
@@ -0,0 +1,770 @@
+---
+title: NSPR API Reference
+slug: Mozilla/Projects/NSPR/Reference
+tags:
+ - NSPR
+ - NSPR_API_Reference
+ - NeedsTranslation
+ - TopicStub
+translation_of: Mozilla/Projects/NSPR/Reference
+---
+<section id="Quick_Links">
+<ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR">NSPR</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/About_NSPR">About NSPR</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference">NSPR API Reference</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/NSPR_build_instructions">NSPR Build Instruction</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Release_process">NSPR Release Process</a></li>
+ <li class="toggle">
+ <details>
+ <summary>Introduction to NSPR</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Naming_Conventions">NSPR Naming Conventions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Threads">NSPR Threads</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Thread_Schedoling">Thread Scheduling</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Setting_Thread_Priorities">Setting Thread Priorities</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Preempting_Threads">Preempting Threads</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Interrupting_Threads">Interrupting Threads</a></li>
+ </ol>
+ </li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Thread_Synchronization">NSPR Thread Synchronization</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Locks_and_Monitors">Locks and Monitors</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Condition_Variables">Condition Variables</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Sample_Code">NSPR Sample Code</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>NSPR Types</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Calling_Convention_Types">Calling Convention Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Algebraic_Types">Algebraic Types</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#8-.2C_16-.2C_and_32-bit_Integer_Types">8-, 16-, and 32-bit Integer Types</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Signed_Integers">Signed Integers</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Unsigned_Integers">Unsigned Integers</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#64-bit_Integer_Types">64-bit Integer Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Floating-Point_Number_Type">Floating-Point Integer Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Native_OS_Integer_Types">Native OS Integer Types</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Miscellaneous_Types">Miscellaneous Types</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Size_Type">Size Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Pointer_Difference_Types">Pointer Difference Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Boolean_Types">Boolean Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Status_Type_for_Return_Values">Status Type for Return Values</a></li>
+ </ol>
+ </li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Threads</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Threading_Types_and_Constants">Threading Types and Constants</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Threading_Functions">Threading Functions</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Creating.2C_Joining.2C_and_Identifying_Threads">Creating, Joining, and Identifying Threads</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Controlling_Thread_Priorities">Controlling Thread Priorities</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Controlling_Per-Thread_Private_Data">Controlling Per-Thread Private Data</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Interrupting_and_Yielding">Interrupting and Yielding</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Setting_Global_Thread_Concurrency">Setting Global Thread Concurrency</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Getting_a_Thread.27s_Scope">Getting a Thread's Scope</a></li>
+ </ol>
+ </li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Process Initialization</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Initialization#Identity_and_Versioning">Identity and Versioning</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Initialization#Name_and_Version_Constants">Name and Version Constants</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Initialization#Initialization_and_Cleanup">Initialization and Cleanup</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Initialization#Module_Initialization">Module Initialization</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Locks</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Locks#Lock_Type">Lock Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Locks#Lock_Functions">Lock Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Condition Variables</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Condition_Variables#Condition_Variable_Type">Condition Variable Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Condition_Variables#Condition_Variable_Functions">Condition Variable Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Monitors</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Monitors#Monitor_Type">Monitor Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Monitors#Monitor_Functions">Monitor Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Cached Monitors</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Cached_Monitors#Cached_Monitor_Functions">Cached Monitor Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>I/O Types</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#Directory_Type">Directory Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#File_Descriptor_Types">File Descriptor Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#File_Info_Types">File Info Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#Network_Address_Types">Network Address Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#Types_Used_with_Socket_Options_Functions">Types Used with Socket Options Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#Type_Used_with_Memory-Mapped_I.2FO">Type Used with Memory-Mapped I/O</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#Offset_Interpretation_for_Seek_Functions">Offset Interpretation for Seek Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>I/O Functions</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Functions_that_Operate_on_Pathnames">Functions that Operate on Pathnames</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Functions_that_Act_on_File_Descriptors">Functions that Act on File Descriptors</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Directory_I.2FO_Functions">Directory I/O Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Socket_Manipolation_Functions">Socket Manipolation Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Converting_Between_Host_and_Network_Addresses">Converting Between Host and Network Addresses</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Memory-Mapped_I.2FO_Functions">Memory-Mapped I/O Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Anonymous_Pipe_Function">Anonymous Pipe Function</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Polling_Functions">Polling Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Pollable_Events">Pollable Events</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Manipulating_Layers">Manipulating Layers</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Network Addresses</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Network_Addresses#Network_Address_Types_and_Constants">Network Address Types and Constants</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Network_Addresses#Network_Address_Functions">Network Address Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Atomic Operations</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_AtomicIncrement">PR_AtomicIncrement</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_AtomicDecrement">PR_AtomicDecrement</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_AtomicSet">PR_AtomicSet</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Interval Timing</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Interval_Timing#Interval_Time_Type_and_Constants">Interval Time Type and Constants</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Interval_Timing#Interval_Functions">Interval Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Date and Time</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Date_and_Time#Types_and_Constants">Types and Constants</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Date_and_Time#Time_Parameter_Callback_Functions">Time Parameter Callback Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Date_and_Time#Functions">Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Memory Management Operations</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Memory_Management_Operations#Memory_Allocation_Functions">Memory Allocation Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Memory_Management_Operations#Memory_Allocation_Macros">Memory Allocation Macros</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>String Operations</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PL_strlen">PL_strlen</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PL_strcpy">PL_strcpy</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PL_strdup">PL_strdup</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PL_strfree">PL_strfree</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Floating Point Number to String Conversion</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_strtod">PR_strtod</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_dtoa">PR_dtoa</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_cnvtf">PR_cnvtf</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Linked Lists</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Linked_Lists#Linked_List_Types">Linked List Types</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRCList">PRCList</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Linked_Lists#Linked_List_Macros">Linked List Macros</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_INIT_CLIST">PR_INIT_CLIST</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_INIT_STATIC_CLIST">PR_INIT_STATIC_CLIST</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_APPEND_LINK">PR_APPEND_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_INSERT_LINK">PR_INSERT_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_NEXT_LINK">PR_NEXT_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_PREV_LINK">PR_PREV_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_REMOVE_LINK">PR_REMOVE_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_REMOVE_AND_INIT_LINK">PR_REMOVE_AND_INIT_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_INSERT_BEFORE">PR_INSERT_BEFORE</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_INSERT_AFTER">PR_INSERT_AFTER</a></li>
+ </ol>
+ </li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Dynamic Library Linking</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Library_Linking_Types">Library Linking Types</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRLibrary">PRLibrary</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRStaticLinkTable">PRStaticLinkTable</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Library_Linking_Functions">Library Linking Functions</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_SetLibraryPath">PR_SetLibraryPath</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_GetLibraryPath">PR_GetLibraryPath</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_GetLibraryName">PR_GetLibraryName</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_FreeLibraryName">PR_FreeLibraryName</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_LoadLibrary">PR_LoadLibrary</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_UnloadLibrary">PR_UnloadLibrary</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_FindSymbol">PR_FindSymbol</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_FindSymbolAndLibrary">PR_FindSymbolAndLibrary</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Finding_Symbols_Defined_in_the_Main_Executable_Program">Finding Symbols Defined in the Main Executable Program</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Platform_Notes">Platform Notes</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Dynamic_Library_Search_Path">Dynamic Library Search Path</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Exporting_Symbols_from_the_Main_Executable_Program">Exporting Symbols from the Main Executable Program</a></li>
+ </ol>
+ </li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Process Management and Interprocess Communication</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Management_and_Interprocess_Communication#Process_Management_Types_and_Constants">Process Management Types and Constants</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRProcess">PRProcess</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRProcessAttr">PRProcessAttr</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Management_and_Interprocess_Communication#Process_Management_Functions">Process Management Functions</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Management_and_Interprocess_Communication#Setting_the_Attributes_of_a_New_Process">Setting the Attributes of a New Process</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Management_and_Interprocess_Communication#Creating_and_Managing_Processes">Creating and Managing Processes</a></li>
+ </ol>
+ </li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Logging</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Logging#Conditional_Compilation_and_Execution">Conditional Compilation and Execution</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Logging#Log_Types_and_Variables">Log Types and Variables</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRLogModoleInfo">PRLogModoleInfo</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRLogModoleLevel">PRLogModoleLevel</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_LOG_MODULES">NSPR_LOG_MODULES</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_LOG_FILE">NSPR_LOG_FILE</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Logging#Logging_Functions_and_Macros">Logging Functions and Macros</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_NewLogModole">PR_NewLogModole</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_SetLogFile">PR_SetLogFile</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_SetLogBuffering">PR_SetLogBuffering</a>/li&gt;
+ </li><li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_LogPrint">PR_LogPrint</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_LogFlush">PR_LogFlush</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_LOG_TEST">PR_LOG_TEST</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_LOG">PR_LOG</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_Assert_">PR_Assert</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_ASSERT">PR_ASSERT</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_NOT_REACHED">PR_NOT_REACHED</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Logging#Use_Example">Use Example</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Named Shared Memory</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Named_Shared_Memory#Shared_Memory_Protocol">Shared Memory Protocol</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Named_Shared_Memory#Named_Shared_Memory_Functions">Named Shared Memory Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Anonymous Shared Memory</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Anonymous_Shared_Memory#Anonymous_Memory_Protocol">Anonymous Memory Protocol</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Anonymous_Shared_Memory#Anonymous_Shared_Memory_Functions">Anonymous Shared Memory Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>IPC Semaphores</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/IPC_Semaphores#IPC_Semaphore_Functions">IPC Semaphore Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Thread Pools</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Thread_Pools#Thread_Pool_Types">Thread Pool Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Thread_Pools#Thread_Pool_Functions">Thread Pool Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Random Number Generator</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Random_Number_Generator#Random_Number_Generator_Function">Random Number Generator Function</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Hash Tables</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Hash_Tables#Hash_Tables_and_Type_Constants">Hash Tables and Type Constants</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Hash_Tables#Hash_Table_Functions">Hash Table Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>NSPR Error Handling</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling#Error_Type">Error Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling#Error_Functions">Error Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling#Error_Codes">Error Codes</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details>
+ <summary>Contribute</summary>
+ <ol>
+ <li><a href="/en-US/docs/MDN/Doc_status/NSPR"></a></li>
+ <li><a href="/en-US/docs/MDN">The MDN Project</a></li>
+ </ol>
+ </details>
+ </li>
+ </ol>
+</section>
+
+<h2 id="Introduction_to_NSPR" name="Introduction_to_NSPR"><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR">Introduction to NSPR</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Naming_Conventions">NSPR Naming Conventions</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Threads">NSPR Threads</a>
+ <ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Thread_Scheduling">Thread Scheduling</a>
+ <ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Setting_Thread_Priorities">Setting Thread Priorities</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Preempting_Threads">Preempting Threads</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Interrupting_Threads">Interrupting Threads</a></li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Thread_Synchronization">NSPR Thread Synchronization</a>
+ <ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Locks_and_Monitors">Locks and Monitors</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Condition_Variables">Condition Variables</a></li>
+ </ul>
+ </li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Sample_Code">NSPR Sample Code</a></li>
+</ul>
+
+<h2 id="NSPR_Types" name="NSPR_Types"><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types">NSPR Types</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Calling_Convention_Types">Calling Convention Types</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Algebraic_Types">Algebraic Types</a>
+ <ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#8-.2C_16-.2C_and_32-bit_Integer_Types">8-, 16-, and 32-bit Integer Types</a>
+ <ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Signed_Integers">Signed Integers</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Unsigned_Integers">Unsigned Integers</a></li>
+ </ul>
+ </li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#64-bit_Integer_Types">64-bit Integer Types</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Floating-Point_Number_Type">Floating-Point Integer Type</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Native_OS_Integer_Types">Native OS Integer Types</a></li>
+ </ul>
+ </li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Miscellaneous_Types">Miscellaneous Types</a>
+ <ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Size_Type">Size Type</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Pointer_Difference_Types">Pointer Difference Types</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Boolean_Types">Boolean Types</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Types#Status_Type_for_Return_Values">Status Type for Return Values</a></li>
+ </ul>
+ </li>
+</ul>
+
+<h2 id="Threads" name="Threads"><a href="/Mozilla/Projects/NSPR/Reference/Threads">Threads</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Threads#Threading_Types_and_Constants">Threading Types and Constants</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Threads#Threading_Functions">Threading Functions</a>
+ <ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Threads#Creating.2C_Joining.2C_and_Identifying_Threads">Creating, Joining, and Identifying Threads</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Threads#Controlling_Thread_Priorities">Controlling Thread Priorities</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Threads#Controlling_Per-Thread_Private_Data">Controlling Per-Thread Private Data</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Threads#Interrupting_and_Yielding">Interrupting and Yielding</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Threads#Setting_Global_Thread_Concurrency">Setting Global Thread Concurrency</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Threads#Getting_a_Thread.27s_Scope">Getting a Thread's Scope</a></li>
+ </ul>
+ </li>
+</ul>
+
+<h2 id="Process_Initialization" name="Process_Initialization"><a href="/Mozilla/Projects/NSPR/Reference/Process_Initialization">Process Initialization</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Process_Initialization#Identity_and_Versioning">Identity and Versioning</a>
+
+ <ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Process_Initialization#Name_and_Version_Constants">Name and Version Constants</a></li>
+ </ul>
+ </li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Process_Initialization#Initialization_and_Cleanup">Initialization and Cleanup</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Process_Initialization#Module_Initialization">Module Initialization</a></li>
+</ul>
+
+<h2 id="Locks" name="Locks"><a href="/Mozilla/Projects/NSPR/Reference/Locks">Locks</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Locks#Lock_Type">Lock Type</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Locks#Lock_Functions">Lock Functions</a></li>
+</ul>
+
+<h2 id="Condition_Variables" name="Condition_Variables"><a href="/Mozilla/Projects/NSPR/Reference/Condition_Variables">Condition Variables</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Condition_Variables#Condition_Variable_Type">Condition Variable Type</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Condition_Variables#Condition_Variable_Functions">Condition Variable Functions</a></li>
+</ul>
+
+<h2 id="Monitors" name="Monitors"><a href="/Mozilla/Projects/NSPR/Reference/Monitors">Monitors</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Monitors#Monitor_Type">Monitor Type</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Monitors#Monitor_Functions">Monitor Functions</a></li>
+</ul>
+
+<h2 id="Cached_Monitors" name="Cached_Monitors"><a href="/Mozilla/Projects/NSPR/Reference/Cached_Monitors">Cached Monitors</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Cached_Monitors#Cached_Monitor_Functions">Cached Monitor Functions</a></li>
+</ul>
+
+<h2 id="I.2FO_Types" name="I.2FO_Types"><a href="/Mozilla/Projects/NSPR/Reference/I_O_Types">I/O Types</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Types#Directory_Type">Directory Type</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Types#File_Descriptor_Types">File Descriptor Types</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Types#File_Info_Types">File Info Types</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Types#Network_Address_Types">Network Address Types</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Types#Types_Used_with_Socket_Options_Functions">Types Used with Socket Options Functions</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Types#Type_Used_with_Memory-Mapped_I.2FO">Type Used with Memory-Mapped I/O</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Types#Offset_Interpretation_for_Seek_Functions">Offset Interpretation for Seek Functions</a></li>
+</ul>
+
+<h2 id="I.2FO_Functions" name="I.2FO_Functions"><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions">I/O Functions</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions#Functions_that_Operate_on_Pathnames">Functions that Operate on Pathnames</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions#Functions_that_Act_on_File_Descriptors">Functions that Act on File Descriptors</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions#Directory_I.2FO_Functions">Directory I/O Functions</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions#Socket_Manipulation_Functions">Socket Manipulation Functions</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions#Converting_Between_Host_and_Network_Addresses">Converting Between Host and Network Addresses</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions#Memory-Mapped_I.2FO_Functions">Memory-Mapped I/O Functions</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions#Anonymous_Pipe_Function">Anonymous Pipe Function</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions#Polling_Functions">Polling Functions</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions#Pollable_Events">Pollable Events</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/I_O_Functions#Manipulating_Layers">Manipulating Layers</a></li>
+</ul>
+
+<h2 id="Network_Addresses" name="Network_Addresses"><a href="/Mozilla/Projects/NSPR/Reference/Network_Addresses">Network Addresses</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Network_Addresses#Network_Address_Types_and_Constants">Network Address Types and Constants</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Network_Addresses#Network_Address_Functions">Network Address Functions</a></li>
+</ul>
+
+<h2 id="Atomic_Operations" name="Atomic_Operations"><a href="/Mozilla/Projects/NSPR/Reference/Atomic_Operations">Atomic Operations</a></h2>
+
+<ul>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_AtomicIncrement">PR_AtomicIncrement</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_AtomicDecrement">PR_AtomicDecrement</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_AtomicSet">PR_AtomicSet</a></code></li>
+</ul>
+
+<h2 id="Interval_Timing" name="Interval_Timing"><a href="/Mozilla/Projects/NSPR/Reference/Interval_Timing">Interval Timing</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Interval_Timing#Interval_Time_Type_and_Constants">Interval Time Type and Constants</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Interval_Timing#Interval_Functions">Interval Functions</a></li>
+</ul>
+
+<h2 id="Date_and_Time" name="Date_and_Time"><a href="/Mozilla/Projects/NSPR/Reference/Date_and_Time">Date and Time</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Date_and_Time#Types_and_Constants">Types and Constants</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Date_and_Time#Time_Parameter_Callback_Functions">Time Parameter Callback Functions</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Date_and_Time#Functions">Functions</a></li>
+</ul>
+
+<h2 id="Memory_Management_Operations" name="Memory_Management_Operations"><a href="/Mozilla/Projects/NSPR/Reference/Memory_Management_Operations">Memory Management Operations</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Memory_Management_Operations#Memory_Allocation_Functions">Memory Allocation Functions</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Memory_Management_Operations#Memory_Allocation_Macros">Memory Allocation Macros</a></li>
+</ul>
+
+<h2 id="String_Operations" name="String_Operations"><a href="/Mozilla/Projects/NSPR/Reference/String_Operations">String Operations</a></h2>
+
+<ul>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PL_strlen">PL_strlen</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PL_strcpy">PL_strcpy</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PL_strdup">PL_strdup</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PL_strfree">PL_strfree</a></code></li>
+</ul>
+
+<h2 id="Floating_Point_Number_to_String_Conversion" name="Floating_Point_Number_to_String_Conversion"><a href="/Mozilla/Projects/NSPR/Reference/Floating_Point_Number_to_String_Conversion">Floating Point Number to String Conversion</a></h2>
+
+<ul>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_strtod">PR_strtod</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_dtoa">PR_dtoa</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_cnvtf">PR_cnvtf</a></code></li>
+</ul>
+
+<h2 id="Long_Long_.2864-bit.29_Integers" name="Long_Long_.2864-bit.29_Integers">Long Long (64-bit) Integers</h2>
+
+<h2 id="BitMaps" name="BitMaps">BitMaps</h2>
+
+<h2 id="Formatted_Printing" name="Formatted_Printing">Formatted Printing</h2>
+
+<h2 id="Linked_Lists" name="Linked_Lists"><a href="/Mozilla/Projects/NSPR/Reference/Linked_Lists">Linked Lists</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Linked_Lists#Linked_List_Types">Linked List Types</a>
+
+ <ul>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PRCList">PRCList</a></code></li>
+ </ul>
+ </li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Linked_Lists#Linked_List_Macros">Linked List Macros</a>
+ <ul>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_INIT_CLIST">PR_INIT_CLIST</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_INIT_STATIC_CLIST">PR_INIT_STATIC_CLIST</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_APPEND_LINK">PR_APPEND_LINK</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_INSERT_LINK">PR_INSERT_LINK</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_NEXT_LINK">PR_NEXT_LINK</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_PREV_LINK">PR_PREV_LINK</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_REMOVE_LINK">PR_REMOVE_LINK</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_REMOVE_AND_INIT_LINK">PR_REMOVE_AND_INIT_LINK</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_INSERT_BEFORE">PR_INSERT_BEFORE</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_INSERT_AFTER">PR_INSERT_AFTER</a></code></li>
+ </ul>
+ </li>
+</ul>
+
+<h2 id="Dynamic_Library_Linking" name="Dynamic_Library_Linking"><a href="/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking">Dynamic Library Linking</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Library_Linking_Types">Library Linking Types</a>
+
+ <ul>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PRLibrary">PRLibrary</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PRStaticLinkTable">PRStaticLinkTable</a></code></li>
+ </ul>
+ </li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Library_Linking_Functions">Library Linking Functions</a>
+ <ul>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_SetLibraryPath">PR_SetLibraryPath</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_GetLibraryPath">PR_GetLibraryPath</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_GetLibraryName">PR_GetLibraryName</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_FreeLibraryName">PR_FreeLibraryName</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_LoadLibrary">PR_LoadLibrary</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_UnloadLibrary">PR_UnloadLibrary</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_FindSymbol">PR_FindSymbol</a></code></li>
+ <li><code><a href="/Mozilla/Projects/NSPR/Reference/PR_FindSymbolAndLibrary">PR_FindSymbolAndLibrary</a></code></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Finding_Symbols_Defined_in_the_Main_Executable_Program">Finding Symbols Defined in the Main Executable Program</a></li>
+ </ul>
+ </li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Platform_Notes">Platform Notes</a>
+ <ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Dynamic_Library_Search_Path">Dynamic Library Search Path</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Exporting_Symbols_from_the_Main_Executable_Program">Exporting Symbols from the Main Executable Program </a></li>
+ </ul>
+ </li>
+</ul>
+
+<h2 id="Process_Management_and_Interprocess_Communication" name="Process_Management_and_Interprocess_Communication"><a href="/En/NSPR_API_Reference/Process_Management_and_Interprocess_Communication">Process Management and Interprocess Communication</a></h2>
+
+<ul>
+ <li><a class="internal" href="/En/NSPR_API_Reference/Process_Management_and_Interprocess_Communication#Process_Management_Types_and_Constants">Process Management Types and Constants</a>
+
+ <ul>
+ <li><code><a class="internal" href="/En/PRProcess">PRProcess</a></code></li>
+ <li><code><a class="internal" href="/En/PRProcessAttr">PRProcessAttr</a></code></li>
+ </ul>
+ </li>
+ <li><a class="internal" href="/En/NSPR_API_Reference/Process_Management_and_Interprocess_Communication#Process_Management_Functions">Process Management Functions</a>
+ <ul>
+ <li><a class="internal" href="/En/NSPR_API_Reference/Process_Management_and_Interprocess_Communication#Setting_the_Attributes_of_a_New_Process">Setting the Attributes of a New Process</a></li>
+ <li><a class="internal" href="/En/NSPR_API_Reference/Process_Management_and_Interprocess_Communication#Creating_and_Managing_Processes">Creating and Managing Processes</a></li>
+ </ul>
+ </li>
+</ul>
+
+<h2 id="Multiwait_Receive" name="Multiwait_Receive">Multiwait Receive</h2>
+
+<h2 id="System_Information_and_Environment_Variables" name="System_Information_and_Environment_Variables">System Information and Environment Variables</h2>
+
+<h2 id="Logging" name="Logging"><a href="/NSPR_API_Reference/Logging">Logging</a></h2>
+
+<ul>
+ <li><a href="/NSPR_API_Reference/Logging#Conditional_Compilation_and_Execution">Conditional Compilation and Execution</a></li>
+ <li><a href="/NSPR_API_Reference/Logging#Log_Types_and_Variables">Log Types and Variables</a>
+ <ul>
+ <li><code><a href="/docs/Mozilla/Projects/NSPR/Reference/Logging/PRLogModuleInfo">PRLogModuleInfo</a></code></li>
+ <li><code><a href="/docs/Mozilla/Projects/NSPR/Reference/Logging/PRLogModuleLevel">PRLogModuleLevel</a></code></li>
+ <li><code><a href="/docs/Mozilla/Projects/NSPR/Reference/Logging/NSPR_LOG_MODULES">NSPR_LOG_MODULES</a></code></li>
+ <li><code><a href="/docs/Mozilla/Projects/NSPR/Reference/Logging/NSPR_LOG_FILE">NSPR_LOG_FILE</a></code></li>
+ </ul>
+ </li>
+ <li><a href="/NSPR_API_Reference/Logging#Logging_Functions_and_Macros">Logging Functions and Macros</a>
+ <ul>
+ <li><code><a href="PR_NewLogModule">PR_NewLogModule</a></code></li>
+ <li><code><a href="PR_SetLogFile">PR_SetLogFile</a></code></li>
+ <li><code><a href="PR_SetLogBuffering">PR_SetLogBuffering</a></code></li>
+ <li><code><a href="PR_LogPrint">PR_LogPrint</a></code></li>
+ <li><code><a href="PR_LogFlush">PR_LogFlush</a></code></li>
+ <li><code><a href="PR_LOG_TEST">PR_LOG_TEST</a></code></li>
+ <li><code><a href="PR_LOG">PR_LOG</a></code></li>
+ <li><code><a href="PR_Assert_">PR_Assert</a></code></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_ASSERT">PR_ASSERT</a></li>
+ <li><code><a href="PR_NOT_REACHED">PR_NOT_REACHED</a></code></li>
+ </ul>
+ </li>
+ <li><a href="/NSPR_API_Reference/Logging#Use_Example">Use Example</a></li>
+</ul>
+
+<h2 id="Instrumentation_Counters" name="Instrumentation_Counters">Instrumentation Counters</h2>
+
+<h2 id="Named_Shared_Memory" name="Named_Shared_Memory"><a href="/Mozilla/Projects/NSPR/Reference/Named_Shared_Memory">Named Shared Memory</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Named_Shared_Memory#Shared_Memory_Protocol">Shared Memory Protocol</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Named_Shared_Memory#Named_Shared_Memory_Functions">Named Shared Memory Functions</a></li>
+</ul>
+
+<h2 id="Anonymous_Shared_Memory" name="Anonymous_Shared_Memory"><a href="/Mozilla/Projects/NSPR/Reference/Anonymous_Shared_Memory">Anonymous Shared Memory</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Anonymous_Shared_Memory#Anonymous_Memory_Protocol">Anonymous Memory Protocol</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Anonymous_Shared_Memory#Anonymous_Shared_Memory_Functions">Anonymous Shared Memory Functions</a></li>
+</ul>
+
+<h2 id="IPC_Semaphores" name="IPC_Semaphores"><a href="/Mozilla/Projects/NSPR/Reference/IPC_Semaphores">IPC Semaphores</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/IPC_Semaphores#IPC_Semaphore_Functions">IPC Semaphore Functions</a></li>
+</ul>
+
+<h2 id="Thread_Pools" name="Thread_Pools"><a href="/Mozilla/Projects/NSPR/Reference/Thread_Pools">Thread Pools</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Thread_Pools#Thread_Pool_Types">Thread Pool Types</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Thread_Pools#Thread_Pool_Functions">Thread Pool Functions</a></li>
+</ul>
+
+<h2 id="Random_Number_Generator" name="Random_Number_Generator"><a href="/Mozilla/Projects/NSPR/Reference/Random_Number_Generator">Random Number Generator</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Random_Number_Generator#Random_Number_Generator_Function">Random Number Generator Function</a></li>
+</ul>
+
+<h2 id="Hash_Tables" name="Hash_Tables"><a href="/Mozilla/Projects/NSPR/Reference/Hash_Tables">Hash Tables</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Hash_Tables#Hash_Tables_and_Type_Constants">Hash Tables and Type Constants</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/Hash_Tables#Hash_Table_Functions">Hash Table Functions</a></li>
+</ul>
+
+<h2 id="NSPR_Error_Handling" name="NSPR_Error_Handling"><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling">NSPR Error Handling</a></h2>
+
+<ul>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling#Error_Type">Error Type</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling#Error_Functions">Error Functions</a></li>
+ <li><a href="/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling#Error_Codes">Error Codes</a></li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/nspr/reference/memory_management_operations/index.html b/files/zh-cn/mozilla/projects/nspr/reference/memory_management_operations/index.html
new file mode 100644
index 0000000000..9fbb05ae70
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/nspr/reference/memory_management_operations/index.html
@@ -0,0 +1,424 @@
+---
+title: 内存管理操作
+slug: Mozilla/Projects/NSPR/Reference/Memory_Management_Operations
+tags:
+ - GC
+ - NSPR
+translation_of: Mozilla/Projects/NSPR/Reference/Memory_Management_Operations
+---
+<section id="Quick_Links">
+<ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR">NSPR</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/About_NSPR">About NSPR</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference">NSPR API Reference</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/NSPR_build_instructions">NSPR Build Instruction</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Release_process">NSPR Release Process</a></li>
+ <li class="toggle">
+ <details><summary>Introduction to NSPR</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Naming_Conventions">NSPR Naming Conventions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Threads">NSPR Threads</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Thread_Schedoling">Thread Scheduling</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Setting_Thread_Priorities">Setting Thread Priorities</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Preempting_Threads">Preempting Threads</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Interrupting_Threads">Interrupting Threads</a></li>
+ </ol>
+ </li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Thread_Synchronization">NSPR Thread Synchronization</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Locks_and_Monitors">Locks and Monitors</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#Condition_Variables">Condition Variables</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Introduction_to_NSPR#NSPR_Sample_Code">NSPR Sample Code</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>NSPR Types</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Calling_Convention_Types">Calling Convention Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Algebraic_Types">Algebraic Types</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#8-.2C_16-.2C_and_32-bit_Integer_Types">8-, 16-, and 32-bit Integer Types</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Signed_Integers">Signed Integers</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Unsigned_Integers">Unsigned Integers</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#64-bit_Integer_Types">64-bit Integer Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Floating-Point_Number_Type">Floating-Point Integer Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Native_OS_Integer_Types">Native OS Integer Types</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Miscellaneous_Types">Miscellaneous Types</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Size_Type">Size Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Pointer_Difference_Types">Pointer Difference Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Boolean_Types">Boolean Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Types#Status_Type_for_Return_Values">Status Type for Return Values</a></li>
+ </ol>
+ </li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Threads</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Threading_Types_and_Constants">Threading Types and Constants</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Threading_Functions">Threading Functions</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Creating.2C_Joining.2C_and_Identifying_Threads">Creating, Joining, and Identifying Threads</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Controlling_Thread_Priorities">Controlling Thread Priorities</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Controlling_Per-Thread_Private_Data">Controlling Per-Thread Private Data</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Interrupting_and_Yielding">Interrupting and Yielding</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Setting_Global_Thread_Concurrency">Setting Global Thread Concurrency</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Threads#Getting_a_Thread.27s_Scope">Getting a Thread's Scope</a></li>
+ </ol>
+ </li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Process Initialization</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Initialization#Identity_and_Versioning">Identity and Versioning</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Initialization#Name_and_Version_Constants">Name and Version Constants</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Initialization#Initialization_and_Cleanup">Initialization and Cleanup</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Initialization#Module_Initialization">Module Initialization</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Locks</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Locks#Lock_Type">Lock Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Locks#Lock_Functions">Lock Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Condition Variables</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Condition_Variables#Condition_Variable_Type">Condition Variable Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Condition_Variables#Condition_Variable_Functions">Condition Variable Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Monitors</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Monitors#Monitor_Type">Monitor Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Monitors#Monitor_Functions">Monitor Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Cached Monitors</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Cached_Monitors#Cached_Monitor_Functions">Cached Monitor Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>I/O Types</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#Directory_Type">Directory Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#File_Descriptor_Types">File Descriptor Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#File_Info_Types">File Info Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#Network_Address_Types">Network Address Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#Types_Used_with_Socket_Options_Functions">Types Used with Socket Options Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#Type_Used_with_Memory-Mapped_I.2FO">Type Used with Memory-Mapped I/O</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Types#Offset_Interpretation_for_Seek_Functions">Offset Interpretation for Seek Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>I/O Functions</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Functions_that_Operate_on_Pathnames">Functions that Operate on Pathnames</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Functions_that_Act_on_File_Descriptors">Functions that Act on File Descriptors</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Directory_I.2FO_Functions">Directory I/O Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Socket_Manipolation_Functions">Socket Manipolation Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Converting_Between_Host_and_Network_Addresses">Converting Between Host and Network Addresses</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Memory-Mapped_I.2FO_Functions">Memory-Mapped I/O Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Anonymous_Pipe_Function">Anonymous Pipe Function</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Polling_Functions">Polling Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Pollable_Events">Pollable Events</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/I_O_Functions#Manipulating_Layers">Manipulating Layers</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Network Addresses</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Network_Addresses#Network_Address_Types_and_Constants">Network Address Types and Constants</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Network_Addresses#Network_Address_Functions">Network Address Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Atomic Operations</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_AtomicIncrement">PR_AtomicIncrement</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_AtomicDecrement">PR_AtomicDecrement</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_AtomicSet">PR_AtomicSet</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Interval Timing</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Interval_Timing#Interval_Time_Type_and_Constants">Interval Time Type and Constants</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Interval_Timing#Interval_Functions">Interval Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Date and Time</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Date_and_Time#Types_and_Constants">Types and Constants</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Date_and_Time#Time_Parameter_Callback_Functions">Time Parameter Callback Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Date_and_Time#Functions">Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details open><summary>Memory Management Operations</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Memory_Management_Operations#Memory_Allocation_Functions">Memory Allocation Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Memory_Management_Operations#Memory_Allocation_Macros">Memory Allocation Macros</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>String Operations</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PL_strlen">PL_strlen</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PL_strcpy">PL_strcpy</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PL_strdup">PL_strdup</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PL_strfree">PL_strfree</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Floating Point Number to String Conversion</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_strtod">PR_strtod</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_dtoa">PR_dtoa</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_cnvtf">PR_cnvtf</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Linked Lists</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Linked_Lists#Linked_List_Types">Linked List Types</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRCList">PRCList</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Linked_Lists#Linked_List_Macros">Linked List Macros</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_INIT_CLIST">PR_INIT_CLIST</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_INIT_STATIC_CLIST">PR_INIT_STATIC_CLIST</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_APPEND_LINK">PR_APPEND_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_INSERT_LINK">PR_INSERT_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_NEXT_LINK">PR_NEXT_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_PREV_LINK">PR_PREV_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_REMOVE_LINK">PR_REMOVE_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_REMOVE_AND_INIT_LINK">PR_REMOVE_AND_INIT_LINK</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_INSERT_BEFORE">PR_INSERT_BEFORE</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_INSERT_AFTER">PR_INSERT_AFTER</a></li>
+ </ol>
+ </li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Dynamic Library Linking</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Library_Linking_Types">Library Linking Types</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRLibrary">PRLibrary</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRStaticLinkTable">PRStaticLinkTable</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Library_Linking_Functions">Library Linking Functions</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_SetLibraryPath">PR_SetLibraryPath</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_GetLibraryPath">PR_GetLibraryPath</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_GetLibraryName">PR_GetLibraryName</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_FreeLibraryName">PR_FreeLibraryName</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_LoadLibrary">PR_LoadLibrary</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_UnloadLibrary">PR_UnloadLibrary</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_FindSymbol">PR_FindSymbol</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_FindSymbolAndLibrary">PR_FindSymbolAndLibrary</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Finding_Symbols_Defined_in_the_Main_Executable_Program">Finding Symbols Defined in the Main Executable Program</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Platform_Notes">Platform Notes</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Dynamic_Library_Search_Path">Dynamic Library Search Path</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Dynamic_Library_Linking#Exporting_Symbols_from_the_Main_Executable_Program">Exporting Symbols from the Main Executable Program</a></li>
+ </ol>
+ </li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Process Management and Interprocess Communication</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Management_and_Interprocess_Communication#Process_Management_Types_and_Constants">Process Management Types and Constants</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRProcess">PRProcess</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRProcessAttr">PRProcessAttr</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Management_and_Interprocess_Communication#Process_Management_Functions">Process Management Functions</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Management_and_Interprocess_Communication#Setting_the_Attributes_of_a_New_Process">Setting the Attributes of a New Process</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Process_Management_and_Interprocess_Communication#Creating_and_Managing_Processes">Creating and Managing Processes</a></li>
+ </ol>
+ </li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Logging</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Logging#Conditional_Compilation_and_Execution">Conditional Compilation and Execution</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Logging#Log_Types_and_Variables">Log Types and Variables</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRLogModoleInfo">PRLogModoleInfo</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PRLogModoleLevel">PRLogModoleLevel</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_LOG_MODULES">NSPR_LOG_MODULES</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_LOG_FILE">NSPR_LOG_FILE</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Logging#Logging_Functions_and_Macros">Logging Functions and Macros</a>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_NewLogModole">PR_NewLogModole</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_SetLogFile">PR_SetLogFile</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_SetLogBuffering">PR_SetLogBuffering</a>/li&gt;</li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_LogPrint">PR_LogPrint</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_LogFlush">PR_LogFlush</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_LOG_TEST">PR_LOG_TEST</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_LOG">PR_LOG</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_Assert_">PR_Assert</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_ASSERT">PR_ASSERT</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_NOT_REACHED">PR_NOT_REACHED</a></li>
+ </ol>
+ </li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Logging#Use_Example">Use Example</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Named Shared Memory</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Named_Shared_Memory#Shared_Memory_Protocol">Shared Memory Protocol</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Named_Shared_Memory#Named_Shared_Memory_Functions">Named Shared Memory Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Anonymous Shared Memory</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Anonymous_Shared_Memory#Anonymous_Memory_Protocol">Anonymous Memory Protocol</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Anonymous_Shared_Memory#Anonymous_Shared_Memory_Functions">Anonymous Shared Memory Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>IPC Semaphores</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/IPC_Semaphores#IPC_Semaphore_Functions">IPC Semaphore Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Thread Pools</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Thread_Pools#Thread_Pool_Types">Thread Pool Types</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Thread_Pools#Thread_Pool_Functions">Thread Pool Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Random Number Generator</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Random_Number_Generator#Random_Number_Generator_Function">Random Number Generator Function</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Hash Tables</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Hash_Tables#Hash_Tables_and_Type_Constants">Hash Tables and Type Constants</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/Hash_Tables#Hash_Table_Functions">Hash Table Functions</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>NSPR Error Handling</summary>
+ <ol>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling#Error_Type">Error Type</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling#Error_Functions">Error Functions</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling#Error_Codes">Error Codes</a></li>
+ </ol>
+ </details>
+ </li>
+ <li class="toggle">
+ <details><summary>Contribute</summary>
+ <ol>
+ <li></li>
+ <li><a href="/en-US/docs/MDN">The MDN Project</a></li>
+ </ol>
+ </details>
+ </li>
+</ol>
+</section>
+
+<p>本章介绍用于执行内存管理的全局函数和宏。NSPR 提供基于堆内存管理的函数,映射到熟悉的<code>malloc()</code>, <code>calloc()</code>, <code>realloc()</code>, 和 <code>free()</code>.</p>
+
+<ul>
+ <li><a href="#Memory_Allocation_Functions">Memory Allocation Functions</a></li>
+ <li><a href="#Memory_Allocation_Macros">Memory Allocation Macros</a></li>
+</ul>
+
+<h2 id="Memory_Allocation_Functions" name="Memory_Allocation_Functions">内存分配函数</h2>
+
+<p>NSPR has its own heap, and these functions act on that heap. Libraries built on top of NSPR, such as the Netscape security libraries, use these functions to allocate and free memory. If you are allocating memory for use by such libraries or freeing memory that was allocated by such libraries, you must use these NSPR functions rather than the libc equivalents.</p>
+
+<p>Memory allocation functions are:</p>
+
+<ul>
+ <li><code><a href="PR_Malloc">PR_Malloc</a></code></li>
+ <li><code><a href="PR_Calloc">PR_Calloc</a></code></li>
+ <li><code><a href="PR_Realloc">PR_Realloc</a></code></li>
+ <li><code><a href="PR_Free">PR_Free</a></code></li>
+</ul>
+
+<p><code>PR_Malloc()</code>, <code>PR_Calloc()</code>, <code>PR_Realloc()</code>, and <code>PR_Free()</code> have the same signatures as their libc equivalents <code>malloc()</code>, <code>calloc()</code>, <code>realloc()</code>, and <code>free()</code>, and have the same semantics. (Note that the argument type <code>size_t</code> is replaced by <code>PRUint32</code>.) Memory allocated by <code>PR_Malloc()</code>, <code>PR_Calloc()</code>, or <code>PR_Realloc()</code> must be freed by <code>PR_Free()</code>.</p>
+
+<h2 id="Memory_Allocation_Macros" name="Memory_Allocation_Macros">内存分配 Macros</h2>
+
+<p>Macro versions of the memory allocation functions are available, as well as additional macros that provide programming convenience:</p>
+
+<ul>
+ <li><code><a href="PR_MALLOC">PR_MALLOC</a></code></li>
+ <li><code><a href="PR_NEW">PR_NEW</a></code></li>
+ <li><code><a href="PR_REALLOC">PR_REALLOC</a></code></li>
+ <li><code><a href="PR_CALLOC">PR_CALLOC</a></code></li>
+ <li><code><a href="PR_NEWZAP">PR_NEWZAP</a></code></li>
+ <li><code><a href="PR_DELETE">PR_DELETE</a></code></li>
+ <li><code><a href="PR_FREEIF">PR_FREEIF</a></code></li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/psm/index.html b/files/zh-cn/mozilla/projects/psm/index.html
new file mode 100644
index 0000000000..69fcd93234
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/psm/index.html
@@ -0,0 +1,15 @@
+---
+title: Personal Security Manager (PSM)
+slug: Mozilla/Projects/PSM
+translation_of: Mozilla/Projects/PSM
+---
+<p>PSM全称为Personal Security Manager,包含了一套在客户应用程序上执行密码操作的代码库。这些操作包括设置SSL连接,对象签名和签名认证,证书管理(包括发行和废弃),和其它通用PKI函数。</p>
+
+<p>注意:</p>
+
+<ul>
+ <li>PSM 现在总是随Firefox一起编译, 所以没有分离的编译命令.</li>
+ <li><a href="http://www-archive.mozilla.org/projects/security/pki/psm/">Archived Information about PSM</a></li>
+</ul>
+
+<p> </p>
diff --git a/files/zh-cn/mozilla/projects/rhino/bsf/index.html b/files/zh-cn/mozilla/projects/rhino/bsf/index.html
new file mode 100644
index 0000000000..8cf8b6c13e
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/bsf/index.html
@@ -0,0 +1,10 @@
+---
+title: BSF
+slug: Mozilla/Projects/Rhino/BSF
+translation_of: Mozilla/Projects/Rhino/BSF
+---
+<h2 id="BSF是什么">BSF是什么?</h2>
+<p><a class="ex-ref external" href="http://jakarta.apache.org/bsf/"><dfn>Bean Scripting Framework (BSF)</dfn></a>起初被IBM开发,后来作为Apache Software Foundation开源代码的一部分.它为Java上的大量的脚本语言提供了一个框架,Rhino是被支持的语言之一.</p>
+<p>这个框架已被大量的开源项目嵌入代码中, 包括 XSL 处理器 <a class="ex-ref external" href="http://xml.apache.org/xalan-j/">Xalan</a> 和  XML/Java 构建工具 <a class="ex-ref external" href="http://ant.apache.org/">Ant</a>. 查看 <a class="ex-ref external" href="http://xml.apache.org/xalan-j/extensions.html">Xalan-Java Extensions</a> 可以获取更多关于把JavaScript添加至XSL、在<a class="ex-ref external" href="http://ant.apache.org/manual/">Apache Ant Manual</a>中使用脚本构建项目时脚本任务的命令项的描述等信息.</p>
+<h2 id="Using_BSF_with_Rhino">Using BSF with Rhino</h2>
+<p>Now that the Apache Jakarta <dfn>Bean Scripting Framework (BSF)</dfn>, version 2.4.0, has been officially released, you can use Rhino easily with BSF. See <a class="ex-ref external" href="http://jakarta.apache.org/bsf/index.html">http://jakarta.apache.org/bsf/index.html</a>.</p>
diff --git a/files/zh-cn/mozilla/projects/rhino/community/index.html b/files/zh-cn/mozilla/projects/rhino/community/index.html
new file mode 100644
index 0000000000..8d5c3a446c
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/community/index.html
@@ -0,0 +1,24 @@
+---
+title: Rhino社区
+slug: Mozilla/Projects/Rhino/Community
+translation_of: Mozilla/Projects/Rhino/Community
+---
+<p>是否有在<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Documentation">Rhino文档</a>中找不到解答的问题?下面这些资源可以给你一些帮助:</p>
+
+<h4 id="Newsgroup_and_Mail_Gateway" name="Newsgroup_and_Mail_Gateway">邮件列表</h4>
+
+<p>在Google讨论组中有一个叫<a href="https://groups.google.com/group/mozilla-rhino">mozilla-rhino</a>的讨论组,可以讨论Rhino相关的话题.</p>
+
+<p>还有一个比较老的讨论组叫<a href="news://news.mozilla.org/mozilla.dev.tech.js-engine.rhino">mozilla.dev.tech.js-engine.rhino</a>,已经很久没有维护了,请使用新的讨论组,但是这个老的组可能也包含一些比较有历史意义的讨论,可以去参考浏览一下.</p>
+
+<p><a class="link-news" href="news://news.mozilla.org/mozilla.dev.tech.js-engine">mozilla.dev.tech.js-engine</a>这个讨论组讨论的是关于使用C语言实现的Javascript,也有在2007年9月27日之前关于Rhino的讨论.要看在2007年9月27日之前的讨论,请移步一个叫<a class="external" href="http://groups.google.com/group/mozilla.dev.tech.js-engine/topics">Google group for the earlier newsgroup</a>的Google讨论组.</p>
+
+<h4 id="Bug_System" name="Bug_System">Bug 系统</h4>
+
+<p>最好的提交Rhino bug的方式是在Rhino的<a href="https://github.com/mozilla/rhino/issues">Github</a>中提交.</p>
+
+<p>如果你愿意解决一些提交的Bug,我们非常欢迎您解决她,并提交一个<a href="https://github.com/mozilla/rhino/pulls">pull请求</a>.</p>
+
+<p>许多老的Rhino的问题都被记录在<a class="link-https" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Rhino">Bugzilla</a>中.也许有一些比较有历史意义的bug. 最后注意Rhino有自己的产品类目.</p>
+
+<p>{{ languages( { "ja": "ja/Rhino_help" } ) }}</p>
diff --git a/files/zh-cn/mozilla/projects/rhino/debugger/index.html b/files/zh-cn/mozilla/projects/rhino/debugger/index.html
new file mode 100644
index 0000000000..8b5ab147ca
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/debugger/index.html
@@ -0,0 +1,220 @@
+---
+title: Rhino Debugger
+slug: Mozilla/Projects/Rhino/Debugger
+translation_of: Mozilla/Projects/Rhino/Debugger
+---
+<p>The Rhino JavaScript debugger is a GUI that allows debugging of interpreted JavaScript scripts run in Rhino. Note that this debugger <strong>will not</strong> work with JavaScript scripts run in the mozilla browser since Rhino is not the engine used in such environments.</p>
+<p><img alt="" height="460" src="jsdebug.jpg" width="600"></p>
+<p>Current limitations:</p>
+<ul>
+ <li>No breakpoint menu</li>
+</ul>
+<h2 id="Using_the_Rhino_JavaScript_Debugger">Using the Rhino JavaScript Debugger</h2>
+<p>The Mozilla Rhino JavaScript engine includes a source-level debugger for debugging JavaScript scripts. The debugger is itself a Java program which you may run as</p>
+<pre class="code" style="white-space: -moz-pre-wrap; white-space: pre-wrap;">java org.mozilla.javascript.tools.debugger.Main [options] [filename.js] [script-arguments]
+
+</pre>
+<p>where the options are the same as the shell.</p>
+<p>The Rhino JavaScript Debugger can debug scripts running in multiple threads and provides facilities to set and clear breakpoints, control execution, view variables, and evaluate arbitrary JavaScript code in the current scope of an executing script.</p>
+<dl>
+ <dt>
+ <a id="console" name="console">Console Window</a></dt>
+ <dd>
+ The debugger redirects the System.out, System.in, and System.err streams to an internal JavaScript console window which provides an editable command line for you to enter JavaScript code and view system output. The console window maintains a history of the commands you have entered. You may move backward and forward through the history list by pressing the Up/Down arrow keys on the keyboard.</dd>
+ <dt>
+ <a id="opening" name="opening">Opening Scripts</a></dt>
+ <dd>
+ You may select the <b>
+ <i>
+ File-&gt;Open</i>
+ </b> menu item on the menu bar to load JavaScript scripts contained in files. This action will display a file-selection dialog box prompting you for the location of a script to load. The selected file will be compiled and displayed in a new window.</dd>
+ <dt>
+ <a id="running" name="running">Running Scripts</a></dt>
+ <dd>
+ You may select the <b>
+ <i>
+ File-&gt;Run</i>
+ </b> menu item on the menu bar to execute JavaScript scripts contained in files. This action will display a file-selection dialog box prompting you for the location of a script to execute. The loaded script will be run in a new thread and control will be given to the debugger on its first instruction.</dd>
+</dl>
+<h2 id="Controlling_Execution">Controlling Execution</h2>
+<p>The debugger provides the following facilities for you to control the execution of scripts you are debugging:</p>
+<dl>
+ <dt>
+ <a id="stepinto" name="stepinto">Step Into</a></dt>
+ <dd>
+ To single step entering any function calls, you may do any of the following:
+ <ul>
+ <li>Select the <b>
+ <i>
+ Debug-&gt;Step Into</i>
+ </b>menu item on the menu bar</li>
+ <li>Press the <b>
+ <i>
+ Step Into</i>
+ </b> button on the toolbar</li>
+ <li>Press the F11 key on the keyboard</li>
+ </ul>
+ <p>Execution will resume. If the current line in the script contains a function call control will return to the debugger upon entry into the function. Otherwise control will return to the debugger at the next line in the current function.</p>
+ </dd>
+ <dt>
+ <a id="stepover" name="stepover">Step Over</a></dt>
+ <dd>
+ To single step to the next line in the current function, you may do any of the following:
+ <ul>
+ <li>Select the <b>
+ <i>
+ Debug-&gt;Step Over</i>
+ </b> menu item on the menu bar</li>
+ <li>Press the <b>
+ <i>
+ Step Over</i>
+ </b> button on the toolbar</li>
+ <li>Press the F7 key on the keyboard</li>
+ </ul>
+ <p>Execution will resume but control will return to the debugger at the next line in the current function or top-level script.</p>
+ </dd>
+ <dt>
+ <a id="stepout" name="stepout">Step Out</a></dt>
+ <dd>
+ To continue execution until the current function returns you may do any of the following:
+ <ul>
+ <li>Select the <b>
+ <i>
+ Debug-&gt;Step Out</i>
+ </b> menu item on the menu bar</li>
+ <li>Press the <b>
+ <i>
+ Step Out</i>
+ </b> button on the toolbar</li>
+ <li>Press the F8 key on the keyboard</li>
+ </ul>
+ <p>Execution will resume until the current function returns or a breakpoint is hit.</p>
+ </dd>
+ <dt>
+ <a id="go" name="go">Go</a></dt>
+ <dd>
+ To resume execution of a script you may do any of the following:
+ <ul>
+ <li>Select the <b>
+ <i>
+ Debug-&gt;Go</i>
+ </b> menu item on the menu bar</li>
+ <li>Press the <b>
+ <i>
+ Go</i>
+ </b> button on the toolbar</li>
+ <li>Press the F5 key on the keyboard</li>
+ </ul>
+ <p>Execution will resume until a breakpoint is hit or the script completes.</p>
+ </dd>
+ <dt>
+ <a id="break" name="break">Break</a></dt>
+ <dd>
+ To stop all running scripts and give control to the debugger you may do any of the following:
+ <ul>
+ <li>Select the <b>
+ <i>
+ Debug-&gt;Break</i>
+ </b> menu item on the menu bar</li>
+ <li>Press the <b>
+ <i>
+ Break</i>
+ </b> button on the toolbar</li>
+ <li>Press the Pause/Break key on the keyboard</li>
+ </ul>
+ </dd>
+ <dt>
+ Break on Exceptions</dt>
+ <dd>
+ To give control to the debugger whenever a JavaScript is exception is thrown select the <b>
+ <i>
+ Debug-&gt;Break on Exceptions</i>
+ </b> checkbox from the menu bar. Whenever a JavaScript exception is thrown by a script a message dialog will be displayed and control will be given to the debugger at the location the exception is raised.</dd>
+ <dt>
+ Break on Function Enter</dt>
+ <dd>
+ Selecting <b>
+ <i>
+ Debug-&gt;Break on Function Enter</i>
+ </b> will give control to the debugger whenever the execution is entered into a function or script.</dd>
+ <dt>
+ Break on Function Exit</dt>
+ <dd>
+ Selecting <b>
+ <i>
+ Debug-&gt;Break on Function Return</i>
+ </b> will give control to the debugger whenever the execution is about to return from a function or script.</dd>
+ <dt>
+ Moving Up and Down the Stack</dt>
+ <dd>
+ The lower-left (dockable) pane in the debugger main window contains a combo-box labeled "Context:" which displays the current stack of the executing script. You may move up and down the stack by selecting an entry in the combo-box. When you select a stack frame the variables and watch windows are updated to reflect the names and values of the variables visible at that scope.</dd>
+ <dt>
+ <a id="setclearbkpts" name="setclearbkpts">Setting and Clearing Breakpoints</a></dt>
+ <dd>
+ The main desktop of the debugger contains file windows which display the contents of each script you are debugging. You may set a breakpoint in a script by doing one of the following:
+ <ul>
+ <li>Place the cursor on the line at which you want to set a breakpoint and right-click with the mouse. This action will display a pop-up menu. Select the <b>
+ <i>
+ Set Breakpoint</i>
+ </b> menu item.</li>
+ <li>Simply single-click on the line number of the line at which you want to set a breakpoint.</li>
+ </ul>
+ <p>If the selected line contains executable code a red dot will appear next to the line number and a breakpoint will be set at that location.</p>
+ <p>You may clear breakpoint in a script by doing one of the following:</p>
+ <ul>
+ <li>Place the cursor on the line at which you want to clear a breakpoint and right-click with the mouse. This action will display a pop-up menu. Select the <b>
+ <i>
+ Clear Breakpoint</i>
+ </b> menu item.</li>
+ <li>Simply single-click on the red dot or the line number of the line at which you want to clear a breakpoint.</li>
+ </ul>
+ <p>The red dot will disappear and the breakpoint at that location will be cleared.</p>
+ </dd>
+</dl>
+<h2 id="Viewing_Variables">Viewing Variables</h2>
+<p>The lower-left (dockable) pane in the debugger main window contains a tab-pane with two tabs, labeled "this" and "Locals". Each pane contains a tree-table which displays the properties of the current object and currently visible local variables, respectively.</p>
+<dl>
+ <dt>
+ <a id="this" name="this">This</a></dt>
+ <dd>
+ The properties of the current object are displayed in the <b>
+ <i>
+ this</i>
+ </b> table. If a property is itself a JavaScript object the property may be expanded to show its sub-properties. The <b>
+ <i>
+ this</i>
+ </b> table is updated each time control returns to the debugger or when you change the stack location in the <b>
+ <i>
+ Context:</i>
+ </b> window.</dd>
+ <dt>
+ <a id="locals" name="locals">Locals</a></dt>
+ <dd>
+ The local variables of the current function are displayed in the <b>
+ <i>
+ Locals</i>
+ </b> table. If a variable is itself a JavaScript object the variable may be expanded to show its sub-properties. The <b>
+ <i>
+ Locals</i>
+ </b> table is updated each time control returns to the debugger or when you change the stack location in the <b>
+ <i>
+ Context:</i>
+ </b> window</dd>
+ <dt>
+ Watch Window</dt>
+ <dd>
+ You may enter arbitrary JavaScript expressions in the <b>
+ <i>
+ Watch:</i>
+ </b> table located in the lower-right (dockable) pane in the debugger main window. The expressions you enter are re-evaluated in the current scope and their current values displayed each time control returns to the debugger or when you change the stack location in the <b>
+ <i>
+ Context:</i>
+ </b> window.</dd>
+ <dt>
+ Evaluation Window</dt>
+ <dd>
+ The <b>
+ <i>
+ Evaluate</i>
+ </b> pane located in the lower-right (dockable) pane in the debugger main window contains an editable command line where you may enter arbitrary JavaScript code. The code is evaluated in the context of the current stack frame. The window maintains a history of the commands you have entered. You may move backward or forward through the history by pressing the Up/Down arrow keys on the keyboard.</dd>
+</dl>
diff --git a/files/zh-cn/mozilla/projects/rhino/documentation/index.html b/files/zh-cn/mozilla/projects/rhino/documentation/index.html
new file mode 100644
index 0000000000..74ae49d94e
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/documentation/index.html
@@ -0,0 +1,81 @@
+---
+title: Rhino 文档
+slug: Mozilla/Projects/Rhino/Documentation
+translation_of: Mozilla/Projects/Rhino/Documentation
+---
+<p>以下是面向 Rhino 脚本创作者和集成者的信息.</p>
+
+<h2 id="General" name="General">概述</h2>
+
+<dl>
+ <dt><a href="/zh-CN/docs/Rhino/Overview" title="Rhino_Overview">简介</a></dt>
+ <dd>Rhino 和 JavaScript 的简介.</dd>
+ <dt><a href="/zh-CN/docs/Rhino/License" title="Rhino_License">许可</a></dt>
+ <dd>Rhino 的许可信息.</dd>
+ <dt><a href="/zh-CN/docs/Rhino/Requirements_and_Limitations" title="Rhino_Requirements_and_Limitations">依赖和局限</a></dt>
+ <dd>运行 Rhino 所需要的要件; 以及 Rhino 不能做什么.</dd>
+ <dt><a href="/zh-CN/docs/Rhino/Downloads_archive" title="Rhino_downloads_archive">发布存档</a></dt>
+ <dd>Rhino 的历史版本以及发行说明.</dd>
+ <dt><a href="/zh-CN/docs/Rhino/Optimization" title="Rhino_Optimization">优化</a></dt>
+ <dd>优化级别的详细说明.</dd>
+ <dt><a href="/zh-CN/docs/Rhino/FAQ" title="Rhino_FAQ">FAQ</a></dt>
+ <dd>针对 Rhino 的 FAQ.</dd>
+ <dt><a href="/zh-CN/docs/Rhino/History">Rhino 的历史</a></dt>
+ <dd>关于这只野兽(Rhino)的历史.</dd>
+</dl>
+
+<h2 id="Writing_Scripts" name="Writing_Scripts">撰写脚本</h2>
+
+<dl>
+ <dt><a class="internal" href="/zh-CN/docs/Scripting_Java" title="Scripting Java">在 Java 中撰写脚本</a></dt>
+ <dd>使用 Rhino 编写 Java 类的方法.</dd>
+ <dt><a class="external" href="http://www.mozilla.org/rhino/scriptjava.html">在 Java 中撰写脚本</a></dt>
+ <dd>使用 Rhino 编写 Java 类的方法. (旧版).</dd>
+ <dt><a href="/en-US/docs/Rhino/Performance">性能</a></dt>
+ <dd>撰写更高效的 JavaScript 的窍门.</dd>
+</dl>
+
+<h2 id="JavaScript_Tools" name="JavaScript_Tools">JavaScript 工具</h2>
+
+<dl>
+ <dt><a href="/en-US/docs/Rhino/Shell" title="Rhino_Shell">Rhino Shell</a></dt>
+ <dd>交互式或批处理式执行脚本.</dd>
+ <dt><a href="/en-US/docs/Rhino/Debugger">JavaScript 调试器</a></dt>
+ <dd>调试执行于 Rhino 中的脚本.</dd>
+ <dt><a href="/en-US/docs/Rhino/JavaScript_Compiler" title="Rhino_JavaScript_Compiler">JavaScript 编译器</a></dt>
+ <dd>将脚本编译成类文件.</dd>
+ <dt><a href="/en-US/docs/Running_the_Rhino_tests" title="Running_the_Rhino_tests">运行Rhino测试</a></dt>
+ <dd>使用Rhino运行javascript单元测试.</dd>
+</dl>
+
+<h2 id="Embedding_Rhino" name="Embedding_Rhino">嵌入 Rhino</h2>
+
+<dl>
+ <dt><a href="/en-US/docs/Rhino/Embedding_tutorial">嵌入教程</a></dt>
+ <dd>一个介绍如何将Rhino嵌入到你的应用程序的简短教程.</dd>
+ <dt><a class="external" href="http://mozilla.github.io/rhino/javadoc/index.html">API Javadoc Reference</a> (无法访问?  <a href="http://www.jarvana.com/jarvana/view/org/mozilla/rhino/1.7R3/rhino-1.7R3-javadoc.jar!/index.html" title="http://www.jarvana.com/jarvana/view/org/mozilla/rhino/1.7R3/rhino-1.7R3-javadoc.jar!/index.html">Try this at Jarvana.</a>)</dt>
+ <dd>一个带有解释的Rhino编程api大纲(只有一些小提示).</dd>
+ <dt><a href="/en-US/docs/Rhino/Scopes_and_Contexts" title="https://developer.mozilla.org/editor/fckeditor/core/editor/en-US/docs/Rhino_documentation/Scopes_and_Contexts">Scopes and Contexts</a></dt>
+ <dd>描述如何在多线程环境中高效、灵活的使用scopes和contexts.</dd>
+ <dt><a href="/en-US/docs/Rhino/Serialization">序列化</a></dt>
+ <dd>如何在Rhino中序列化javascript对象和函数.</dd>
+ <dt><a href="/en-US/docs/Rhino/Runtime">运行时</a></dt>
+ <dd>一个对于javascrit运行时的简短介绍.</dd>
+ <dt><a href="/en-US/docs/Rhino/Footprint">Small Footprint</a></dt>
+ <dd>对于那些热衷于小面积脚本嵌入(small-footprint embeddings)的人的提示.</dd>
+ <dt><a href="/en-US/docs/Rhino/Examples">例子</a></dt>
+ <dd>一些展示如何控制javascript引擎以及创建javascript<span class="web-item">宿主对象的例子.</span></dd>
+ <dt><a href="/en-US/docs/Rhino/BSF">Using Rhino with Bean Scripting Framework (BSF)</a></dt>
+ <dd>如何在支持BSF(Bean 脚本框架)的app中通过Apache Jakarta project使用Rhino.</dd>
+</dl>
+
+<h2 id="External_references" name="External_references">外部链接</h2>
+
+<dl>
+ <dt><a class="external" href="http://www.ociweb.com/jnb/archive/jnbMar2001.html">在java中使用的脚本语言</a></dt>
+ <dd>一篇将Rhino和Jython进行对比的文章.</dd>
+</dl>
+
+<h2 id="Rhino_contributors" name="Rhino_contributors">Rhino 贡献者</h2>
+
+<p>有志于为 Rhino 贡献力量? 来看看 <a href="/en-US/docs/Rhino_Wish_List" title="Rhino_Wish_List">Rhino Wish List</a> 吧.</p>
diff --git a/files/zh-cn/mozilla/projects/rhino/download_rhino/index.html b/files/zh-cn/mozilla/projects/rhino/download_rhino/index.html
new file mode 100644
index 0000000000..54bf9966b8
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/download_rhino/index.html
@@ -0,0 +1,106 @@
+---
+title: 下载 Rhino
+slug: Mozilla/Projects/Rhino/Download_Rhino
+translation_of: Mozilla/Projects/Rhino/Download_Rhino
+---
+<p>Rhino 同时提供源代码和已编译形式的下载.</p>
+
+<h2 id="字节码文件">字节码文件</h2>
+
+<p>Rhino 1.7R5 是最新的稳定发行版.</p>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">发行版本</th>
+ <th scope="col">发行时间</th>
+ <th scope="col">变更日志</th>
+ <th scope="col">下载链接</th>
+ </tr>
+ <tr>
+ <td>Rhino 1.7R4</td>
+ <td>2012-06-18</td>
+ <td><a href="/En/New_in_Rhino_1.7R4" title="En/New_in_Rhino_1.7R4">New in Rhino 1.7R4</a></td>
+ <td><a class="link-https" href="https://github.com/downloads/mozilla/rhino/rhino1_7R4.zip" title="https://github.com/downloads/mozilla/rhino/rhino1_7R4.zip">rhino1_7R4.zip</a></td>
+ </tr>
+ <tr>
+ <td>Rhino 1.7R5</td>
+ <td>2015-01-29</td>
+ <td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7R5_RELEASE">变更日志</a></td>
+ <td><a href="https://github.com/mozilla/rhino/releases/download/Rhino1_7R5_RELEASE/rhino1_7R5.zip">rhino1_7R5.zip</a></td>
+ </tr>
+ <tr>
+ <td>Rhino 1.7.6</td>
+ <td>2015-04-15</td>
+ <td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_6_RELEASE">变更日志</a></td>
+ <td><a href="https://github.com/mozilla/rhino/releases/download/Rhino1_7_6_RELEASE/rhino1.7.6.zip">rhino1.7.6.zip</a></td>
+ </tr>
+ <tr>
+ <td>Rhino 1.7.7</td>
+ <td>2015-06-17</td>
+ <td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_7_RELEASE">变更日志</a></td>
+ <td><a href="https://github.com/mozilla/rhino/releases/download/Rhino1_7_7_RELEASE/rhino1.7.7.zip">rhino1.7.7.zip</a></td>
+ </tr>
+ <tr>
+ <td>Rhino 1.7.7.1</td>
+ <td>2016-02-01</td>
+ <td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_7_1_RELEASE">变更日志</a></td>
+ <td><a href="https://github.com/mozilla/rhino/releases/download/Rhino1_7_7_1_RELEASE/rhino-1.7.7.1.zip">rhino1.7.7.1.zip </a></td>
+ </tr>
+ <tr>
+ <td>Rhino 1.7.7.2</td>
+ <td>2017-08-24</td>
+ <td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_7_2_Release">变更日志</a></td>
+ <td><a href="https://github.com/mozilla/rhino/releases/download/Rhino1_7_7_2_Release/rhino-1.7.7.2.zip">rhino1.7.7.2.zip </a></td>
+ </tr>
+ <tr>
+ <td>Rhino 1.7.8</td>
+ <td>2018-01-22</td>
+ <td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_8_Release">变更日志</a></td>
+ <td><a href="https://github.com/mozilla/rhino/releases/download/Rhino1_7_8_Release/rhino-1.7.8.zip">rhino1.7.8.zip</a></td>
+ </tr>
+ <tr>
+ <td>Rhino 1.7.9</td>
+ <td>2018-03-15</td>
+ <td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_9_Release">变更日志</a></td>
+ <td><a href="https://github.com/mozilla/rhino/releases/download/Rhino1_7_9_Release/rhino-1.7.9.zip">rhino1.7.9.zip</a></td>
+ </tr>
+ <tr>
+ <td>Rhino 1.7.10</td>
+ <td>2018-04-09</td>
+ <td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_10_Release">变更日志</a></td>
+ <td><a href="https://github.com/mozilla/rhino/releases/download/Rhino1_7_10_Release/rhino-1.7.10.zip">rhino1.7.10.zip</a></td>
+ </tr>
+ <tr>
+ <td>Rhino 1.7.11</td>
+ <td>2019-05-30</td>
+ <td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_11_Release">变更日志</a></td>
+ <td><a href="https://github.com/mozilla/rhino/releases/download/Rhino1_7_11_Release/rhino-1.7.11.zip">rhino1.7.11.zip</a></td>
+ </tr>
+ <tr>
+ <td>Rhino 1.7.12</td>
+ <td>2020-01-13</td>
+ <td><a href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_12_Release">变更日志</a></td>
+ <td><a href="https://github.com/mozilla/rhino/releases/download/Rhino1_7_12_Release/rhino-1.7.12.zip">rhino1.7.12.zip</a></td>
+ </tr>
+ </tbody>
+</table>
+
+<p>下载较旧版本的Rhino,可以参考 <a class="external" href="http://developer.mozilla.org/zh-cn/docs/Rhino_downloads_archive">Rhino 下载存档.</a></p>
+
+<h2 id="许可">许可</h2>
+
+<p>Rhino 是开源的, 从 1.7R4 开始以 MPL 2.0 许可.</p>
+
+<p>在此之前的版本遵循 <a class="external" href="http://www.mozilla.org/MPL/">MPL</a> 1.1/GPL 2.0 许可.</p>
+
+<p>参考更详细的 <a href="/zh-cn/Rhino/License" title="en/Rhino license">Rhino 许可证</a> 信息.</p>
+
+<h2 id="源代码">源代码</h2>
+
+<p>除了从上面zip文件获取源外,Rhino 的源代码可以在GitHub上的<a href="https://github.com/mozilla/rhino">https://github.com/mozilla/rhino</a>找到。 要获取源,使用命令</p>
+
+<pre class="brush: bash">$ git clone https://github.com/mozilla/rhino.git
+</pre>
+
+<p>Rhino 使用 <a class="ex-ref external" href="http://ant.apache.org/">Ant</a> 作为它的构建系统.。在Rhino分配的顶级目录运行 <code>ant</code> 命令将打印打印可构建目标的清单。</p>
diff --git a/files/zh-cn/mozilla/projects/rhino/embedding_tutorial/index.html b/files/zh-cn/mozilla/projects/rhino/embedding_tutorial/index.html
new file mode 100644
index 0000000000..b7cf0168f5
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/embedding_tutorial/index.html
@@ -0,0 +1,221 @@
+---
+title: 'Tutorial: Embedding Rhino'
+slug: Mozilla/Projects/Rhino/Embedding_tutorial
+translation_of: Mozilla/Projects/Rhino/Embedding_tutorial
+---
+<p>Embedding Rhino can be done simply with good results. With more effort on the part of the embedder, the objects exposed to scripts can be customized further.</p>
+<p>This tutorial leads you through the steps from a simple embedding to more customized, complex embeddings. Fully compilable examples are provided along the way.</p>
+<p>The examples live in the <code>rhino/examples</code> directory in the distribution and in <code>mozilla/js/rhino/examples</code> in cvs. This document will link to them using <a href="http://lxr.mozilla.org/">lxr</a>.</p>
+<p>In this document, JavaScript code will be in <span class="java_js_code">green</span>, Java code will be in <span class="java_js_code">green,</span> and shell logs will be in <span class="shell_logs_code">purple</span>.</p>
+<h2 id="In_this_document">In this document:</h2>
+<ul class="toc">
+ <li><a href="#runScript">RunScript: A simple embedding</a>
+ <ul>
+ <li><a href="#enteringContext">Entering a Context</a></li>
+ <li><a href="#initializing">Initializing standard objects</a></li>
+ <li><a href="#collecting">Collecting the arguments</a></li>
+ <li><a href="#evaluating">Evaluating a script</a></li>
+ <li><a href="#print">Printing the result</a></li>
+ <li><a href="#exit">Exiting the Context</a></li>
+ </ul>
+ </li>
+ <li><a href="#expose">Expose Java APIs</a>
+ <ul>
+ <li><a href="#useJava">Using Java APIs</a></li>
+ <li><a href="#implementingInterfaces">Implementing interfaces</a></li>
+ <li><a href="#addJava">Adding Java objects</a></li>
+ </ul>
+ </li>
+ <li><a href="#usingJSObjs">Using JavaScript objects from Java</a>
+ <ul>
+ <li><a href="#usingJSvars">Using JavaScript variables</a></li>
+ <li><a href="#callingJSfuns">Calling JavaScript functions</a></li>
+ </ul>
+ </li>
+ <li><a href="#javaScriptHostObjects">JavaScript host objects</a>
+ <ul>
+ <li><a href="#definingHostObjects">Defining Host Objects</a></li>
+ <li><a href="#counter">Counter example</a>
+ <ul>
+ <li><a href="#counterCtors">Counter's constructors</a></li>
+ <li><a href="#classname">Class name</a></li>
+ <li><a href="#dynamic">Dynamic properties</a></li>
+ <li><a href="#definingMethods">Defining JavaScript "methods"</a></li>
+ <li><a href="#addingCounter">Adding Counter to RunScript</a></li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+</ul>
+<h2 id="RunScript_A_simple_embedding"><a id="runScript" name="runScript">RunScript: A simple embedding</a></h2>
+<p>About the simplest embedding of Rhino possible is the <a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/RunScript.java">RunScript example</a>. All it does it read a script from the command line, execute it, and print a result.</p>
+<p>Here's an example use of RunScript from a shell command line:</p>
+<pre class="code shell_logs_code">$ java RunScript "Math.cos(Math.PI)"
+-1
+$ java RunScript "function f(x){return x+1} f(7)"
+8
+</pre>
+<p>Note that you'll have to have both the Rhino classes and the RunScript example class file in the classpath. Let's step through the body of <code>main</code> one line at time.</p>
+<h3 id="Entering_a_Context"><a id="enteringContext" name="enteringContext">Entering a Context</a></h3>
+<p>The code</p>
+<pre class="code java_js_code">Context cx = Context.enter();
+</pre>
+<p>Creates and enters a <code>Context</code>. A <code>Context</code> stores information about the execution environment of a script.</p>
+<h3 id="Initializing_standard_objects"><a name="initializing">Initializing standard objects</a></h3>
+<p>The code</p>
+<pre class="code java_js_code">Scriptable scope = cx.initStandardObjects();
+</pre>
+<p>Initializes the standard objects (<code>Object</code>, <code>Function</code>, etc.) This must be done before scripts can be executed. The <var>null</var> parameter tells <code>initStandardObjects</code> to create and return a scope object that we use in later calls.</p>
+<h3 id="Collecting_the_arguments"><a id="collecting" name="collecting">Collecting the arguments</a></h3>
+<p>This code is standard Java and not specific to Rhino. It just collects all the arguments and concatenates them together.</p>
+<pre class="code java_js_code">String s = "";
+for (int i=0; i &lt; args.length; i++) {
+ s += args[i];
+}
+</pre>
+<h3 id="Evaluating_a_script"><a id="evaluating" name="evaluating">Evaluating a script</a></h3>
+<p>The code</p>
+<pre class="code java_js_code">Object result = cx.evaluateString(scope, s, "&lt;cmd&gt;", 1, null);
+</pre>
+<p>uses the Context <code>cx</code> to evaluate a string. Evaluation of the script looks up variables in <var>scope</var>, and errors will be reported with the filename <code>&lt;cmd&gt;</code> and line number 1.</p>
+<h3 id="Printing_the_result"><a id="print" name="print">Printing the result</a></h3>
+<p>The code</p>
+<pre class="code java_js_code">System.out.println(cx.toString(result));
+</pre>
+<p>prints the result of evaluating the script (contained in the variable <var>result</var>). <var>result</var> could be a string, JavaScript object, or other values. The <code>toString</code> method converts any JavaScript value to a string.</p>
+<h3 id="Exiting_the_Context"><a id="exit" name="exit">Exiting the Context</a></h3>
+<p>The code</p>
+<pre class="code java_js_code">} finally {
+ Context.exit();
+}
+</pre>
+<p>exits the Context. This removes the association between the Context and the current thread and is an essential cleanup action. There should be a call to <code>exit</code> for every call to <code>enter</code>. To make sure that it is called even if an exception is thrown, it is put into the finally block corresponding to the try block starting after <code>Context.enter()</code>.</p>
+<h2 id="Expose_Java_APIs"><a id="expose" name="expose">Expose Java APIs</a></h2>
+<h3 id="Using_Java_APIs"><a id="useJava" name="useJava">Using Java APIs</a></h3>
+<p>No additional code in the embedding needed! The JavaScript feature called
+ <i>
+ LiveConnect</i>
+ allows JavaScript programs to interact with Java objects:</p>
+<pre class="code shell_logs_code">$ java RunScript "java.lang.System.out.println(3)"
+3.0
+undefined
+</pre>
+<h3 id="Implementing_interfaces"><a id="implementingInterfaces" name="implementingInterfaces">Implementing interfaces</a></h3>
+<p>Using Rhino, JavaScript objects can implement arbitrary Java interfaces. There's no Java code to write -- it's part of Rhino's LiveConnect implementation. For example, we can see how to implement java.lang.Runnable in a Rhino shell session:</p>
+<pre class="code shell_logs_code">js&gt; obj = { run: function() { print("hi"); } }
+[object Object]
+js&gt; obj.run()
+hi
+js&gt; r = new java.lang.Runnable(obj);
+[object Object]
+js&gt; t = new java.lang.Thread(r)
+Thread[Thread-0,5,main]
+js&gt; t.start()
+hi
+</pre>
+<h3 id="Adding_Java_objects"><a id="addJava" name="addJava">Adding Java objects</a></h3>
+<p>The next example is <a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/RunScript2.java">RunScript2</a>. This is the same as RunScript, but with the addition of two extra lines of code:</p>
+<pre class="code java_js_code">Object wrappedOut = Context.javaToJS(System.out, scope);
+ScriptableObject.putProperty(scope, "out", wrappedOut);
+</pre>
+<p>These lines add a global variable <code>out</code> that is a JavaScript reflection of the <code>System.out</code> variable:</p>
+<pre class="code shell_logs_code">$ java RunScript2 "out.println(42)"
+42.0
+undefined
+</pre>
+<h2 id="Using_JavaScript_objects_from_Java"><a id="usingJSObjs" name="usingJSObjs">Using JavaScript objects from Java</a></h2>
+<p>After evaluating a script it's possible to query the scope for variables and functions, extracting values and calling JavaScript functions. This is illustrated in the <a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/RunScript3.java">RunScript3</a> example. This example adds the ability to print the value of variable <var>x</var> and the result of calling function <code>f</code>. Both <var>x</var> and <var>f</var> are expected to be defined by the evaluated script. For example,</p>
+<pre class="code shell_logs_code">$ java RunScript3 "x = 7"
+x = 7
+f is undefined or not a function.
+$ java RunScript3 "function f(a) { return a; }"
+x is not defined.
+f("my args") = my arg
+</pre>
+<h3 id="Using_JavaScript_variables"><a id="usingJSvars" name="usingJSvars">Using JavaScript variables</a></h3>
+<p>To print out the value of <var>x</var>, we add the following code:</p>
+<pre class="code java_js_code">Object x = scope.get("x", scope);
+if (x == Scriptable.NOT_FOUND) {
+ System.out.println("x is not defined.");
+} else {
+ System.out.println("x = " + Context.toString(x));
+}
+</pre>
+<h3 id="Calling_JavaScript_functions"><a id="callingJSfuns" name="callingJSfuns">Calling JavaScript functions</a></h3>
+<p>To get the function <var>f</var>, call it, and print the result, we add this code:</p>
+<pre class="code java_js_code">Object fObj = scope.get("f", scope);
+if (!(fObj instanceof Function)) {
+ System.out.println("f is undefined or not a function.");
+} else {
+ Object functionArgs[] = { "my arg" };
+ Function f = (Function)fObj;
+ Object result = f.call(cx, scope, scope, functionArgs);
+ String report = "f('my args') = " + Context.toString(result);
+ System.out.println(report);
+}
+</pre>
+<h2 id="JavaScript_host_objects"><a id="javaScriptHostObjects" name="javaScriptHostObjects">JavaScript host objects</a></h2>
+<h3 id="Defining_Host_Objects"><a id="definingHostObjects" name="definingHostObjects">Defining Host Objects</a></h3>
+<p>Custom host objects can implement special JavaScript features like dynamic properties.</p>
+<h3 id="Counter_example"><a id="counter" name="counter">Counter example</a></h3>
+<p>The <a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/Counter.java">Counter example</a> is a simple host object. We'll go through it method by method below.</p>
+<p>It's easy to try out new host object classes in the shell using its built-in <code>defineClass</code> function. We'll see how to add it to RunScript later. (Note that because the <code>java -jar</code> option preempts the rest of the classpath, we can't use that and access the <code>Counter</code> class.)</p>
+<pre class="code shell_logs_code">$ java -cp "js.jar;examples" org.mozilla.javascript.tools.shell.Main
+js&gt; defineClass("Counter")
+js&gt; c = new Counter(7)
+[object Counter]
+js&gt; c.count
+7
+js&gt; c.count
+8
+js&gt; c.count
+9
+js&gt; c.resetCount()
+js&gt; c.count
+0
+</pre>
+<h3 id="Counter's_constructors"><a id="counterCtors" name="counterCtors">Counter's constructors</a></h3>
+<p>The zero-argument constructor is used by Rhino runtime to create instances. For the counter example, no initialization work is needed, so the implementation is empty.</p>
+<pre class="code java_js_code">public Counter () { }
+</pre>
+<p>The method <code>jsConstructor</code> defines the JavaScript constructor that was called with the expression <code>new Counter(7)</code> in the JavaScript code above.</p>
+<pre class="code java_js_code">public void jsConstructor(int a) { count
+= a; }
+</pre>
+<h3 id="Class_name"><a id="classname" name="classname">Class name</a></h3>
+<p>The class name is defined by the <code>getClassName</code> method. This is used to determine the name of the constructor.</p>
+<pre class="code java_js_code">public String getClassName() { return "Counter";
+}
+</pre>
+<h3 id="Dynamic_properties"><a id="dynamic" name="dynamic">Dynamic properties</a></h3>
+<p>Dynamic properties are defined by methods beginning with <code>jsGet_</code> or <code>jsSet_</code>. The method <code>jsGet_count</code> defines the
+ <i>
+ count</i>
+ property.</p>
+<pre class="code java_js_code">public int jsGet_count() { return count++;
+}
+</pre>
+<p>The expression <code>c.count</code> in the JavaScript code above results in a call to this method.</p>
+<h3 id="Defining_JavaScript_methods"><a id="definingMethods" name="definingMethods">Defining JavaScript "methods"</a></h3>
+<p>Methods can be defined using the <code>jsFunction_ prefix</code>. Here we define <code>resetCount</code> for JavaScript.</p>
+<pre class="code java_js_code">public void jsFunction_resetCount() { count
+= 0; }
+</pre>
+<p>The call <code>c.resetCount()</code> above calls this method.</p>
+<h3 id="Adding_Counter_to_RunScript"><a id="addingCounter" name="addingCounter">Adding Counter to RunScript</a></h3>
+<p>Now take a look at the <a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/RunScript4.java">RunScript4 example</a>. It's the same as RunScript except for two additions. The method <code>ScriptableObject.defineClass</code> uses a Java class to define the Counter "class" in the top-level scope:</p>
+<pre class="code java_js_code">ScriptableObject.defineClass(scope, Counter.class);
+</pre>
+<p>Now we can reference the <code>Counter</code> object from our script:</p>
+<pre class="code shell_logs_code">$ java RunScript4 "c = new Counter(3); c.count;
+c.count;"
+</pre>
+<p>It also creates a new instance of the <code>Counter</code> object from within our Java code, constructing it with the value 7, and assigning it to the top-level variable <code>myCounter</code>:</p>
+<pre class="code java_js_code">Object[] arg = { new Integer(7) };
+Scriptable myCounter = cx.newObject(scope, "Counter", arg);
+scope.put("myCounter", scope, myCounter);
+</pre>
+<p>Now we can reference the <code>myCounter</code> object from our script:</p>
+<pre class="code shell_logs_code">$ java RunScript3 'RunScript4 'myCounter.count; myCounter.count'
+8
+</pre>
diff --git a/files/zh-cn/mozilla/projects/rhino/examples/index.html b/files/zh-cn/mozilla/projects/rhino/examples/index.html
new file mode 100644
index 0000000000..087697b94a
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/examples/index.html
@@ -0,0 +1,35 @@
+---
+title: Rhino Examples
+slug: Mozilla/Projects/Rhino/Examples
+translation_of: Mozilla/Projects/Rhino/Examples
+---
+<div>
+  </div>
+<p></p>
+<p>Examples have been provided that show how to control the JavaScript engine and how  to implement scriptable host objects. All the examples are in the git tree at <code><a href="https://github.com/mozilla/rhino/tree/master/examples/">mozilla/js/rhino/examples</a></code>.</p>
+<h2 id="Sample_Scripts"><a id="sample" name="sample">Sample Scripts</a></h2>
+<p>The <code><a href="https://github.com/mozilla/rhino/tree/master/examples/unique.js">unique.js</a></code> script allows printing unique lines from a file.</p>
+<p>The <code><a href="https://github.com/mozilla/rhino/tree/master/examples/liveConnect.js">liveConnect.js</a></code> script shows a sample usage of LiveConnect (Java-to-JavaScript connectivity).</p>
+<p>The <code><a href="https://github.com/mozilla/rhino/tree/master/examples/jsdoc.js">jsdoc.js</a></code> script is a JavaScript analog to Java's <code>javadoc</code>. It makes heavy use of regular expressions.</p>
+<p>The <code><a href="https://github.com/mozilla/rhino/tree/master/examples/checkParam.js">checkParam.js</a></code> script is a useful tool to check that <code>@param</code> tags in Java documentation comments match the parameters in the corresponding Java method.</p>
+<p>The <code><a href="https://github.com/mozilla/rhino/tree/master/examples/enum.js">enum.js</a></code> script is a good example of using a JavaAdapter to implement a Java interface using a JavaScript object.</p>
+<p>The <a href="https://github.com/mozilla/rhino/tree/master/examples/NervousText.js">NervousText.js</a> script is a JavaScript implementation of the famous NervousText applet using JavaScript compiled to Java classes using <a href="jsc.html">jsc</a>. It can be run in the HTML page <a href="https://github.com/mozilla/rhino/tree/master/examples/NervousText.html">NervousText.html</a>.</p>
+<h2 id="Controlling_the_JavaScript_Engine"><a id="controlling" name="controlling">Controlling the JavaScript Engine</a></h2>
+<h4 id="The_RunScript_class">The RunScript class</h4>
+<p><code><a href="https://github.com/mozilla/rhino/tree/master/examples/RunScript.java">RunScript.java</a></code> is a simple program that executes a script from the command line.</p>
+<h4 id="The_Control_class">The Control class</h4>
+<p><code><a href="https://github.com/mozilla/rhino/tree/master/examples/Control.java">Control.java</a></code> is a program that executes a simple script and then manipulates the result.</p>
+<h4 id="JavaScript_Shell">JavaScript Shell</h4>
+<p><code><a href="https://github.com/mozilla/rhino/tree/master/examples/Shell.java">Shell.java</a></code> is a program that executes JavaScript programs; it is a simplified version of the shell in the <code>tools</code> package. The programs may be specified as files on the command line or by typing interactively while the shell is running.</p>
+<h4 id="PrimitiveWrapFactory">PrimitiveWrapFactory</h4>
+<p><a href="https://github.com/mozilla/rhino/tree/master/examples/PrimitiveWrapFactory.java">PrimitiveWrapFactory.java</a> is an example of a WrapFactory that can be used to control the wrapping behavior of the Rhino engine on calls to Java methods.</p>
+<h4 id="Multithreaded_Script_Execution">Multithreaded Script Execution</h4>
+<p><code><a href="https://github.com/mozilla/rhino/tree/master/examples/DynamicScopes.java">DynamicScopes.java</a></code> is a program that creates a single global scope object and then shares it across multiple threads. Sharing the global scope allows both information to be shared across threads, and amortizes the cost of Context.initStandardObjects by only performing that expensive operation once.</p>
+<h2 id="Implementing_Host_Objects">Implementing Host Objects</h2>
+<p>First check out the <a href="/en/docs/Rhino/Embedding_tutorial">tutorial</a> if you haven't already.</p>
+<h4 id="The_Foo_class_-_Extending_ScriptableObject">The Foo class - Extending ScriptableObject</h4>
+<p><code><a href="https://github.com/mozilla/rhino/tree/master/examples/Foo.java">Foo.java</a></code> is a simple JavaScript host object that includes a property with an associated action and a variable argument method.</p>
+<h4 id="The_Matrix_class_-_Implementing_Scriptable">The Matrix class - Implementing Scriptable</h4>
+<p><code><a href="https://github.com/mozilla/rhino/tree/master/examples/Matrix.java">Matrix.java</a></code> provides a simple multidimensional array by implementing the Scriptable interface.</p>
+<h4 id="The_File_class_-_An_advanced_example">The File class - An advanced example</h4>
+<p><code><a href="https://github.com/mozilla/rhino/tree/master/examples/File.java">File.java</a></code> extends ScriptableObject to provide a means of reading and writing files from JavaScript. A more involved example of host object definition.</p>
diff --git a/files/zh-cn/mozilla/projects/rhino/index.html b/files/zh-cn/mozilla/projects/rhino/index.html
new file mode 100644
index 0000000000..86818aa172
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/index.html
@@ -0,0 +1,22 @@
+---
+title: Rhino
+slug: Mozilla/Projects/Rhino
+translation_of: Mozilla/Projects/Rhino
+---
+<p><img alt="Image:rhino.jpg" class="internal" src="/@api/deki/files/832/=Rhino.jpg"></p>
+
+<p><strong>Rhino </strong>是一个完全使用Java语言编写的开源<a href="/zh-CN/docs/Web/JavaScript">JavaScript</a>实现。Rhino通常用于在Java程序中,为最终用户提供脚本化能力。它被作为J2SE 6上的默认Java脚本化引擎。</p>
+
+<h4 id="Rhino_downloads" name="Rhino_downloads">Rhino 下载</h4>
+
+<p>如何 <a class="internal" href="/zh-cn/Rhino/Download_Rhino" title="zh-cn/Rhino/Download Rhino">获取源码和二进制文件</a><a id="fck_paste_padding"></a><a id="fck_paste_padding"></a>. </p>
+
+<h4 id="Rhino_documentation" name="Rhino_documentation">Rhino 文档</h4>
+
+<p>为脚本编写者和嵌入者提供的 <a href="/zh-CN/docs/Mozilla/Projects/Rhino/Documentation">一些Rhino信息</a>.</p>
+
+<h4 id="Rhino_help" name="Rhino_help">Rhino 帮助</h4>
+
+<p>如果你被卡住了,可以参考 <a href="/zh-CN/docs/Mozilla/Projects/Rhino/Community">这里的一些资源</a>.</p>
+
+<p>{{ languages( { "zh-cn": "zh-cn/Rhino" } ) }}</p>
diff --git a/files/zh-cn/mozilla/projects/rhino/license/index.html b/files/zh-cn/mozilla/projects/rhino/license/index.html
new file mode 100644
index 0000000000..035688ed65
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/license/index.html
@@ -0,0 +1,47 @@
+---
+title: Rhino license
+slug: Mozilla/Projects/Rhino/License
+translation_of: Mozilla/Projects/Rhino/License
+---
+<p>Rhino is available under open source licenses.</p>
+
+<h2 id="MPL.2FGPL_License" name="MPL.2FGPL_License">MPL/GPL License</h2>
+
+<p>The majority of the source code for Rhino is available under a <a class="external" href="http://www.mozilla.org/MPL/">MPL 1.1/GPL 2.0</a> license.</p>
+
+<h2 id="License_for_portions_of_the_Rhino_debugger" name="License_for_portions_of_the_Rhino_debugger">License for portions of the Rhino debugger</h2>
+
+<p>Additionally, some files (currently the contents of toolsrc/org/mozilla/javascript/tools/debugger/treetable/) are available under the following license:</p>
+
+<pre> * Copyright 1997, 1998 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Sun Microsystems nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+</pre>
+
+<hr>
+<p><a href="/User:Norrisboyd" title="User:Norrisboyd">Norrisboyd</a> 06:16, 14 April 2008 (PDT)</p>
diff --git a/files/zh-cn/mozilla/projects/rhino/overview/index.html b/files/zh-cn/mozilla/projects/rhino/overview/index.html
new file mode 100644
index 0000000000..ba6a9aaa18
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/overview/index.html
@@ -0,0 +1,78 @@
+---
+title: Rhino overview
+slug: Mozilla/Projects/Rhino/Overview
+translation_of: Mozilla/Projects/Rhino/Overview
+---
+<h3 id="Introduction" name="Introduction">简介</h3>
+
+<p>大多数用过 <a href="/en/JavaScript" title="en/JavaScript">JavaScript</a> 的人都是将js脚本放入<a href="/en/HTML" title="en/HTML">HTML</a>页面中使用。然而, Rhino 仅仅是对javascript核心部分的实现,并没有包含操作HTML的对象或方法。</p>
+
+<p>Rhino 包括</p>
+
+<ul>
+ <li> <a href="/en/New_in_JavaScript_1.7" title="en/New_in_JavaScript_1.7">JavaScript 1.7</a>的全部特性</li>
+ <li>可以用脚本方式调用Java</li>
+ <li>用一个<a href="/en/Rhino/Shell" title="en/Rhino/Shell">JavaScript Shell</a>来执行JavaScript脚本</li>
+ <li>用一个<a href="/en/Rhino/JavaScript_Compiler" title="en/Rhino/JavaScript_Compiler">JavaScript编译器</a> 来将JavaScript脚本文件转换成Java类文件</li>
+ <li>用一个<a class="external" href="http://www.mozilla.org/rhino/debugger.html">JavaScript调试器</a> 来调试Rhino执行的脚本</li>
+</ul>
+
+<h3 id="Language" name="Language">语言</h3>
+
+<p>JavaScript 的标准是 <a class="external" href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">Standard ECMA-262 ECMAScript: A general purpose, cross-platform programming language</a>. Rhino 1.3 及以上版本遵照上述标准的第3版。</p>
+
+<p>Rhino 1.6 及以上版本实现了 <a class="external" href="http://www.ecma-international.org/publications/standards/Ecma-357.htm">ECMA-357 ECMAScript for XML (E4X)</a> 标准. 查看详细的规格说明可以获得更多的信息,查看 <a class="external" href="http://www.mozilla.org/rhino/rhino16R1.html#E4X">Rhino version 1.6R1 release notes</a> 可以看到Rhino对标准实现的具体情况。</p>
+
+<p>此外,Rhino实现了JavaAdapters,这样我们可以用一个JavaScript对象来实现任何java的接口或者继承任何java的类。查看下载文件中example文件夹中的<code class="filename">enum.js获取更多的信息。</code>.</p>
+
+<p>有很多JavaScript的书和教程。 我们推荐<a class="external" href="http://www.oreilly.com/catalog/jscript5/">JavaScript: The Definitive Guide</a> 这本书,里面有一章是说Rhino的。</p>
+
+<h3 id="Deprecated_Language_Features" name="Deprecated_Language_Features">废弃的语言特性</h3>
+
+<p>很多在JavaScript 1.2中定义的特性已经被废弃了. 这些特性允许“计算反射”:可以决定和影响它被评价方法等方面的能力。 这些特性没有被广泛使用,他们对阻碍和防止优化的行为强加了重要的约束。 这些被废弃的特性是 <code>__proto__</code> 和 <code>__parent__</code> 属性, 还有构造函数 <code>With</code>,、<code>Closure<font face="Open Sans, sans-serif"><span style="line-height: 21px;">和</span></font></code><code>Call。</code>在JavaScript 1.4中使用这些特性会产生错误。在其他的版本中使用这些特性,会产生警告。</p>
+
+<h3 id="Internationalization" name="Internationalization">国际化</h3>
+
+<p>The messages reported by the JavaScript engine are by default retrieved from the property file <code class="filename">org/mozilla/javascript/resources/Messages.properties</code>. If other properties files with extensions corresponding to the current locale exist, they will be used instead.</p>
+
+<h3 id="JavaScript_Language_Versions" name="JavaScript_Language_Versions">JavaScript语言版本</h3>
+
+<p>JavaScript引擎的很多行为与语言的版本有关。在浏览器调用中,JavaScript版本的选择是通过script标签中的LANGUAGE属性定义的,比如"JavaScript1.2"。</p>
+
+<p>1.3 和更高版本是ECMA一致的。</p>
+
+<h4 id="Operators_.3D.3D_and_.21.3D" name="Operators_.3D.3D_and_.21.3D">操作符 <code>==</code>  和 <code>!=</code></h4>
+
+<p>1.2版本用 <code>==</code> 和 <code>!=</code> 来处理绝对相等的问题。 在1.3或更高的版本里, <code>==</code> 和 <code>!=</code> 和ECMA中所描述的一样。 操作符 <code>===</code> and <code>!==</code> 在所有版本中都表示绝对相等。</p>
+
+<h4 id="ToBoolean" name="ToBoolean">布尔转换</h4>
+
+<p><code>1.3之前的所有版本Boolean(new Boolean(false))</code> 值为<code>false</code> 。在1.3及1.3之后,它的值为<font face="Courier New, Andale Mono, monospace"><span style="line-height: normal;">true。</span></font></p>
+
+<h4 id="Array.prototype.toString_and_Object.prototype.toString" name="Array.prototype.toString_and_Object.prototype.toString"><code>Array.prototype.toString 和 Object.prototype.toString</code></h4>
+
+<p>1.2版本只是返回数组或对象的文字符号 (比如<code>"{{ mediawiki.external(1,2,3) }}"</code> or <code>"{a:1, b:2}"</code> )。 在1.3或更高版本中这些函数与ECMA标准一致。</p>
+
+<h4 id="Array_constructor" name="Array_constructor"><code>Array</code> 构造函数</h4>
+
+<p><code>只有在1.2版本中,Array(<var>i</var>)</code> 用一个参数i构造一个只有一个元素且元素的值为i的数组。 在其他版本中,使用和ECMA一致的标准 (一个没有元素的数组被构造,长度为i)。</p>
+
+<h4 id="String.prototype.substring" name="String.prototype.substring"><code>String.prototype.substring</code></h4>
+
+<p>只有在1.2版本中, 如果第一个参数小于第二个参数,两个参数不会互换。其他的版本都符合ECMA标准。</p>
+
+<h4 id="String.prototype.split" name="String.prototype.split"><code>String.prototype.split</code></h4>
+
+<p>只有对1.2版本,split按照Perl4的特例当用一个单独的空格字符作参数时, (跳过最先的空白,用空白分割). 其他的版本完全按照ECMA的标准分割。</p>
+
+<h3 id="Security" name="Security">安全</h3>
+
+<p>Rhino的安全特性提供了找到代码片段的来源的功能 (还有任何会轮流产生的代码片段)。这些特性考虑到了传统的基于URL的安全策略(在网景领航员中的JavaScript)的实现。执行信任的JavaScript代码时可以不考虑安全性特征。</p>
+
+<p>运行不被信任的JavaScript代码时,需要做两件事来保证安全性。第一,每一个被创建的Context必须被提供一个实现SecuritySupport接口的实例。 这样在功能上给Rhino提供了让它执行安全相关任务的支持。</p>
+
+<p>第二, <code>security.requireSecurityDomain属性的值应该被改为</code><code>true在资源束</code>bundle <code>org.mozilla.javascript.resources.Security中</code>. 这个属性的值可以在运行时通过调用<code style="font-size: 14px;">Context<font face="Open Sans, sans-serif"><span style="line-height: 21px;">的</span></font></code><code style="font-size: 14px;">isSecurityDomainRequired方法来决定。将这个属性设置为ture,要求任何编译或评估JavaScript的调用必须提供一个安全区域对象(任意类型),用来标识JavaScript代码。在一个典型的客户端嵌入中,这个对象可能是提供javascript的服务器的URL,或者是一个包含代码片段的签发人的代表(用于基于证书的安全策略)。</code></p>
+
+<p>当JavaScript代码想要执行一个受限制的行为时,安全区域会被后面的方法检索。类上下文会从安全管理(<code>java.lang.SecurityManager.getClassContext())中得到。执行限制行为的代码对应的类</code> 可以通过寻找一个在类上下文中合适的位置得到。如果调用者是JavaScript,得到的类可能是一种或两种类型。首先,它可能是解释器(如果解释器模式有效)。第二,它有可能是一个生成的类,如果类文件生成支持。一个植入可以区分两种情况,通过调用在Context Class中调用<code>isInterpreterClass()。</code> 如果是解释器类,调用Context的<code>getInterpreterSecurityDomain()</code> 方法来获取当前正在执行的被解释的脚本或方法的安全区域。否则,就是一个生成的类,一个嵌入可以调用在实现<span style="font-family: courier new,andale mono,monospace; line-height: normal;">SecuritySupport的类中调用</span><code style="font-size: 14px;">getSecurityDomain()。当类被定义而且被打开,恰当的安全区域和它建立关联,而且可以通过调用这个方法找回。一旦安全区域被决定,一个植入可以执行任何检查者适合去决定是否允许去做的操作。</code></p>
+
+<p>{{ languages( { "ja": "ja/Rhino_Overview" } ) }}</p>
diff --git a/files/zh-cn/mozilla/projects/rhino/requirements_and_limitations/index.html b/files/zh-cn/mozilla/projects/rhino/requirements_and_limitations/index.html
new file mode 100644
index 0000000000..8a159ae843
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/requirements_and_limitations/index.html
@@ -0,0 +1,24 @@
+---
+title: Rhino requirements and limitations
+slug: Mozilla/Projects/Rhino/Requirements_and_Limitations
+translation_of: Mozilla/Projects/Rhino/Requirements_and_Limitations
+---
+<h2 id="Requirements" name="Requirements">Requirements</h2>
+<p>Recent versions of Rhino have only been tested with JDK 1.4 and greater. Older versions support JDKs as early as 1.1.</p>
+<p>To use the JavaAdapter feature or an optimization level of 0 or greater, Rhino must be running under a security manager that allows the definition of class loaders.</p>
+<h2 id="Limitations" name="Limitations">Limitations</h2>
+<h3 id="LiveConnect" name="LiveConnect">LiveConnect</h3>
+<p>If a JavaObject's field's name collides with that of a method, the value of that field is retrieved lazily, and can be counter-intuitively affected by later assignments:</p>
+<pre>javaObj.fieldAndMethod = 5;
+var field = javaObj.fieldAndMethod;
+javaObj.fieldAndMethod = 7;
+// now, field == 7
+</pre>
+<p>You can work around this by forcing the field value to be converted to a JavaScript type when you take its value:</p>
+<pre>javaObj.fieldAndMethod = 5;
+var field = javaObj.fieldAndMethod + 0; // force conversion now
+javaObj.fieldAndMethod = 7;
+// now, field == 5
+</pre>
+<h3 id="JSObject" name="JSObject">JSObject</h3>
+<p>Rhino does <strong>NOT</strong> support the <code class="filename">netscape.javascript.JSObject</code> class.</p>
diff --git a/files/zh-cn/mozilla/projects/rhino/scripting_java/index.html b/files/zh-cn/mozilla/projects/rhino/scripting_java/index.html
new file mode 100644
index 0000000000..013ad3aa89
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/scripting_java/index.html
@@ -0,0 +1,397 @@
+---
+title: Scripting Java
+slug: Mozilla/Projects/Rhino/Scripting_Java
+translation_of: Mozilla/Projects/Rhino/Scripting_Java
+---
+<p>这篇文章描述了如何在rhino中使用java。使用脚本调用Java有很多用途,它使得我们可以利用Java中现有的库,来帮助我们构建强大的脚本。我们可以通过编写脚本,来对Java程序进行测试。可以通过脚本来进行探索式编程,辅助Java的开发,所谓探索式编程,就是通过快速地编程调用库或API来探索这些库或API可以做什么,显而易见,脚本语言很适合探索式编程。</p>
+
+<p>这里注意,ECMA标准并没有包含和Java(或者其他任何对象系统)交互的标准。本文所描述的所有内容,应该被认为是一个扩展。</p>
+
+
+
+<h3 id="访问_Java_Packages_和_Classes">访问 Java Packages 和 Classes</h3>
+
+<p>Java的每段代码都是类的一部分,每一个JAVA类都是包的一部分。在Javascript中,脚本不属于任何package。我们可以访问Java包中的类么?</p>
+
+<p>Rhino定义了一个顶层的变量Packages。Packages的所有属性都是Java中顶层的包,比如java和com。比如我们可以访问java包:</p>
+
+<pre class="code">js&gt; Packages.java
+[JavaPackage java]</pre>
+
+<p>还有一种更方便的方式,Rhino定义了一个顶层的变量java,等价于Packages.java。所以上面的例子可以更简介地写成:</p>
+
+<pre class="code">js&gt; java
+[JavaPackage java]
+</pre>
+
+<p>我们可以通过访问包的下层,来直接访问java类:</p>
+
+<pre class="code">js&gt; java.io.File
+[JavaClass java.io.File]
+</pre>
+
+<p>如果你的脚本需要访问很多的Java类,每次都附带完整的包名会使得编程很麻烦。Rhino提供了一个顶层的方法importPackage,它的功能和Java的import一样。比如,我们可以导入java.io包中的所有类,然后直接通过类名File来访问java.io.File:</p>
+
+<pre class="code">js&gt; importPackage(java.io)
+js&gt; File
+[JavaClass java.io.File]
+</pre>
+
+<p>这里importPackage(java.io)使得java.io包中的所有类(例如File)可以在顶层被访问。这和Java中的java.io.*;等价。</p>
+
+<p>要注意Java会暗中导入java.lang.*,但是Rhino不会。因为JavaScript的顶层对象Boolean、Math、Number、Object和String和java.lang包中同名的类并不相同。因为这种冲突,建议不要用importPackage来导入java.lang包。</p>
+
+<p>有一点要注意的,就是Rhino对于指定包名或类名时是如何处理错误的。如果java.Myclass是可访问的,Rhino会试图加载名为java.MyClass的类,如果加载失败,它会假设java.MyClass是一个包名,不会报错:</p>
+
+<pre class="code">js&gt; java.MyClass
+[JavaPackage java.MyClass]
+</pre>
+
+<p>只有在你试图将这个对象当作类使用时,才会报错。</p>
+
+<h4 id="额外的包和类">额外的包和类</h4>
+
+<p>额外的包和类也可以在Rhino中使用。确认你的.jar或.class文件在你的classpath里,你就可以在你的JavaScript应用中导入它们。这些包基本不会在java包中,所以你在使用时,需要在包前加上前缀"Packages"。 比如你想导入 <code>org.mozilla.javascript</code> 包,你应该像下面这样去使用importPackage():</p>
+
+<pre class="code">$ java org.mozilla.javascript.tools.shell.Main
+js&gt; importPackage(Packages.org.mozilla.javascript);
+js&gt; Context.currentContext;
+org.mozilla.javascript.Context@bb6ab6
+</pre>
+
+<p>偶尔,我们也会见到在一些例子中使用包的完整名称,而没有使用importPackage()。这也是可以的,只是会让你多打一些字。如果使用完整的名称,上面的例子就会变成下面这样:</p>
+
+<pre class="code">$ java org.mozilla.javascript.tools.shell.Main
+js&gt; jsPackage = Packages.org.mozilla.javascript;
+[JavaPackage org.mozilla.javascript]
+js&gt; jsPackage.Context.currentContext;
+org.mozilla.javascript.Context@bb6ab6
+</pre>
+
+<p>同样,你可以通过importClass()来导入一个类,上面的例子也可以像这样写:</p>
+
+<pre>$ java org.mozilla.javascript.tools.shell.Main
+js&gt; importClass(Packages.org.mozilla.javascript.Context);
+js&gt; Context.currentContext;
+org.mozilla.javascript.Context@bb6ab6</pre>
+
+<h3 id="和Java一起工作">和Java一起工作</h3>
+
+<p>现在我们可以访问Java类,下一步就是要创建一个对象。方法就和在Java中一样, 用new来创建对象:</p>
+
+<pre class="code">js&gt; new java.util.Date()
+Thu Jan 24 16:18:17 EST 2002
+</pre>
+
+<p>如果我们将创建的对象存放在JavaScript变量中,我们可以调用它的方法:</p>
+
+<pre class="code">js&gt; f = new java.io.File("test.txt")
+test.txt
+js&gt; f.exists()
+true
+js&gt; f.getName()
+test.txt
+</pre>
+
+<p>静态方法和属性可以直接通过类对象来访问:</p>
+
+<pre class="code">js&gt; java.lang.Math.PI
+3.141592653589793
+js&gt; java.lang.Math.cos(0)
+1
+</pre>
+
+<p>不像Java,在JavaScript里,方法就是一个对象。它可以被评估,也可以被调用。如果我们去查看这个方法,我们可以看到这个方法所有重载的形式:</p>
+
+<pre class="code">js&gt; f.listFiles
+function listFiles() {/*
+java.io.File[] listFiles()
+java.io.File[] listFiles(java.io.FilenameFilter)
+java.io.File[] listFiles(java.io.FileFilter)
+*/}
+</pre>
+
+<p>输出告诉我们,File类有listFiles方法的三种重载:一种不包含参数的,另一种包含一个FilenameFilter类型的参数,第三个包含一个FileFilter类型的参数。所有的方法都返回一个File对象数组。可以观察到Java方法的参数和返回类型在探索式编程中是非常有用的,尤其是在对一个方法的参数和返回对象不确定的时候。</p>
+
+<p>另一个有助于探索式编程的特性,是可以看到对象中定义的所有方法和属性。用JavaScript的<code>for..in</code> , 我们可以打印这些值:</p>
+
+<pre class="code">js&gt; for (i in f) { print(i) }
+exists
+parentFile
+mkdir
+toString
+wait
+<em>[44 others]</em>
+</pre>
+
+<p>注意这里不仅列出了File类中的所有方法,也列出了从基类java.lang.Object中继承的方法,例如wait。这使得我们可以更好地处理那些有复杂继承关系的对象,因为我们可以看到对象中所有可用的方法。</p>
+
+<p>Rhino可以通过属性名来方便地访问JavaBean的属性。一个JavaBean的属性foo被方法getFoo和setFoo定义,另外,一个也叫foo的boolean类型的属性,可以被isFoo来定义。比如, 下面的代码实际上调用了File对象的getName和isDirectory方法。</p>
+
+<pre class="code">js&gt; f.name
+test.txt
+js&gt; f.directory
+false
+</pre>
+
+<h3 id="调用重载方法"><font><font>调用重载方法</font></font></h3>
+
+<p> <span id="noHighlight_0.8335956993210636">根据参数类型选择调用方法的过程称为重载决议。在 Java 中, 重载决议在编译时执行, 而在rhino中则在运行时发生。这种差异是不可避免的, 因为 JavaScript 使用动态类型, 在2章中: 由于变量的类型直到运行时才知道, 才会发生重载决议。</span></p>
+
+<div class="textArea" id="destText" style="direction: ltr;">
+<div><span id="noHighlight_0.37802431709856343">例如, 请查看下面的 Java 类, 它定义了许多重载方法并调用它们。</span> </div>
+</div>
+
+
+
+<pre class="code">public class Overload {
+
+ public String f(Object o) { return "f(Object)"; }
+ public String f(String s) { return "f(String)"; }
+ public String f(int i) { return "f(int)"; }
+
+ public String g(String s, int i) { return "g(String,int)"; }
+ public String g(int i, String s) { return "g(int,String)"; }
+
+ public static void main(String[] args) {
+ Overload o = new Overload();
+ Object[] a = new Object[] { new Integer(3), "hi", Overload.class };
+ for (int i = 0; i != a.length; ++i)
+ System.out.println(o.f(a[i]));
+ }
+}
+</pre>
+
+<p><span id="noHighlight_0.42609135329922554">当我们编译和执行程序, 它产生输出</span></p>
+
+<pre class="code">f(Object)
+f(Object)
+f(Object)
+</pre>
+
+<p><span id="noHighlight_0.9335258512242988">但是, 如果我们编写一个类似的脚本</span></p>
+
+<pre class="code">var o = new Packages.Overload();
+var a = [ 3, "hi", Packages.Overload ];
+for (var i = 0; i != a.length; ++i)
+ print(o.f(a[i]));
+</pre>
+
+<p>并且运行它,将会输出</p>
+
+<pre class="code">f(int)
+f(String)
+f(Object)
+</pre>
+
+<p>因为Rhino在运行时选择重载方法, <span id="noHighlight_0.45030814581159195">所以它会调用与该参数匹配的更具体的类型。</span> <span id="noHighlight_0.45030814581159195">同时, 在编译时, Java 只在参数的类型上选择重载方法。</span></p>
+
+<p>尽管这有利于选择一种方法,这种方法可能是每个调用的更好匹配,但它确实对性能有影响,因为每次调用时都要做更多的工作。事实上,这种性能代价在实际应用中并不明显。</p>
+
+<p>因为重载决议发生在运行时,它可能在运行时失败。例如,如果我们用两个整数调用重载方法g,我们就会得到一个错误,因为方法的两个形式都比另一个更接近参数类型:</p>
+
+<pre class="code">js&gt; o.g(3,4)
+js:"&lt;stdin&gt;", line 2: The choice of Java method Overload.g
+matching JavaScript argument types (number,number) is ambiguous;
+candidate methods are:
+class java.lang.String g(java.lang.String,int)
+class java.lang.String g(int,java.lang.String)
+</pre>
+
+<p><a href="http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html">http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html</a> 提供了<font><font>一个更精确的重载语义定义</font><font>。</font></font></p>
+
+<h3 id="实现Java接口">  实现Java接口</h3>
+
+
+
+<p>现在我们可以访问Java类,创建Java对象,并访问这些对象的字段、方法和属性,我们就可以轻松掌握大量的功能。但是,在少数情况下是不够用的:Java中的很多API通过提供客户端必须实现的接口来工作。其中一个例子就是<font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.498039);">Thread</span></font>类:其构造函数Runnable包含一个<font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.498039);">run</span></font>方法,这个方法在新线程启动时被调用。</p>
+
+<p>为了满足这种需求,Rhino提供了创建新的Java对象实现的接口的能力。首先,我们必须定义一个JavaScript对象,其中的函数属性的名称与Java接口所需的方法名称相匹配。要实现一个<code>Runnable</code> ,我们只需要定义一个不带参数的<font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.498039);">run</span></font>单方法。如果你还记得第3章,可以用{ propertyName: value}符号定义一个JavaScript对象。我们可以在这里结合函数表达式使用这个语法来用一个 <font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.498039);">run</span></font>方法定义一个JavaScript对象:</p>
+
+<pre class="code">js&gt; obj = { run: function () { print("\nrunning"); } }
+[object Object]
+js&gt; obj.run()
+
+running
+</pre>
+
+
+
+<p>现在我们可以通过构建一个 <code>Runnable</code> 来实现 <code>Runnable</code> 接口的对象:</p>
+
+<pre><code>js&gt; r = new java.lang.Runnable(obj);</code></pre>
+
+
+
+<pre class="code">js&gt; r = new java.lang.Runnable(obj);
+[object JavaObject]
+</pre>
+
+<p><font><font>在Java中,不可能</font></font><font><font>在接口上</font><font>使用</font></font><code>new</code><font><font>运算符,因为没有可用的实现。</font><font>Rhino从JavaScript对象中获取实现</font></font><code>obj</code><font><font>。</font><font>现在我们有一个对象实现</font></font><code>Runnable</code><font><font>,我们可以创建</font></font><code>Thread</code><font><font>并运行它。</font><font>我们定义的函数</font></font><code>run </code><font><font>将在新线程上调用。</font></font></p>
+
+<pre class="code">js&gt; t = new java.lang.Thread(r)
+Thread[Thread-2,5,main]
+js&gt; t.start()
+js&gt;
+
+running
+</pre>
+
+
+
+<p><font><font>最终</font></font><code>js</code><font><font>提示和新线程的输出可能以任意顺序显示,具体取决于线程调度。</font></font></p>
+
+<p>在后台,Rhino为一个新的Java类生成字节码,该类实现 <code>Runnable</code> 并转发对其 <font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.498039);">run</span></font>方法的所有调用,并转发给关联的JavaScript对象。实现此类的对象称为Java适配器。因为转发到JavaScript是在运行时发生的,所以可能会延迟定义实现接口的方法直到它们被调用。虽然省略必要的方法对大编程来说是一种糟糕的做法,但它对小脚本和探索性编程很有用。</p>
+
+
+
+<h3 id="JavaAdapter构造函数"><font><font>JavaAdapter构造函数</font></font></h3>
+
+<p>在前面的章节中,我们使用 <code>new</code> 运算符与Java接口创建Java适配器。这种方法有其局限性:不可能实现多个接口,也不能扩展非抽象类。因为这些<font><font>原因,有一个</font></font> <code>JavaAdapter</code> 构造函数。</p>
+
+<p><code>JavaAdapter</code><font><font>构造函数</font><font>的语法</font><font>是:</font></font></p>
+
+<pre class="code">new JavaAdapter(javaIntfOrClass, [javaIntf, ..., javaIntf,] javascriptObject)
+</pre>
+
+<p><code><font face="Open Sans, arial, x-locale-body, sans-serif"><span style="background-color: #ffffff;">这里</span></font>javaIntfOrClass</code>是一个实现的接口或一个扩展的类,并且<code>javaIntf</code>是实现接口的接口。而<code>javascriptObject</code> 则包含从Java适配器调用的方法的JavaScript对象。</p>
+
+<p>在实践中,几乎不需要<code>JavaAdapter</code> 直接调用构造函数。大多数情况下,使用<code>new</code>运算符之前的语法就足够了。</p>
+
+<h3 id="作为Java接口的JavaScript函数"><font><font>作为Java接口的JavaScript函数</font></font></h3>
+
+<p>通常我们只需要使用一种方法实现一个接口,<font><font>就像前面的</font></font> <code>Runnable</code> <font><font>例子或者提供各种事件监听器实现一样。</font>为了方便这个,Rhino允许在这种接口传递JavaScript函数。</font><font>该函数被称为接口方法的实现。</font></p>
+
+<p>这里是简化的 <code>Runnable</code> 实例:</p>
+
+<pre class="code">js&gt; t = java.lang.Thread(function () { print("\nrunning"); });
+Thread[Thread-0,5,main]
+js&gt; t.start()
+js&gt;
+running
+</pre>
+
+<p><font>如果所有的方法都具有相同的签名,Rhino还允许使用JavaScript函数作为Java接口的实现方法。当调用函数时,Rhino将方法的名称作为附加参数传递。函数可以使用它</font>来代表被调用<font>的方法:</font></p>
+
+<pre class="code">js&gt; var frame = new Packages.javax.swing.JFrame();
+js&gt; frame.addWindowListener(function(event, methodName) {
+ if (methodName == "windowClosing") {
+ print("Calling System.exit()..."); java.lang.System.exit(0);
+ }
+ });
+js&gt; frame.setSize(100, 100);
+js&gt; frame.visible = true;
+true
+js&gt; Calling System.exit()...
+</pre>
+
+<h3 id="创建Java数组"><font><font>创建Java数组</font></font></h3>
+
+<p>Rhino不提供创建Java数组的特殊语法。你必须使用这个 <code>java.lang.reflect.Array</code> 类来达到这个目的。要创建一个由五个Java字符串组成的数组,可以进行以下调用:</p>
+
+<pre class="code">js&gt; a = java.lang.reflect.Array.newInstance(java.lang.String, 5);
+[Ljava.lang.String;@7ffe01
+</pre>
+
+<p>要创建一个基本类型数组,我们必须使用 <code>java.lang</code> 包中相关对象类中定义的特殊TYPE字段。例如,要创建一个字节数组,我们必须使用特殊字段 <code>java.lang.Byte.TYPE</code>:</p>
+
+<pre class="code">js&gt; a = java.lang.reflect.Array.newInstance(java.lang.Character.TYPE, 2);
+[C@7a84e4
+</pre>
+
+<p>而且结果值是允许被使用在该类型的Java数组的任何地方。</p>
+
+<pre class="code">js&gt; a[0] = 104
+104
+js&gt; a[1] = 105
+105
+js&gt; new java.lang.String(a)
+hi
+</pre>
+
+<h3 id="Java字符串和JavaScript字符串"><font><font>Java字符串和JavaScript字符串</font></font></h3>
+
+<p><font><font>请记住,Java字符串和JavaScript字符串是</font></font><strong><font><font>不</font></font></strong><font><font>一样的。</font><font>Java字符串类型的实例,</font></font><code>java.lang.String</code> ,<font><font>并具有由该类定义的所有方法。</font><font>JavaScript字符串具有由...定义的方法,</font></font><code>String.prototype</code>. <font><font>最常见的绊脚石是</font></font> <code>length</code>, <font><font><font face="consolas, Liberation Mono, courier, monospace">这是Java</font>字符串方法和JavaScript字符串的动态属性:</font></font></p>
+
+<pre class="code">js&gt; javaString = new java.lang.String("Java")
+Java
+js&gt; jsString = "JavaScript"
+JavaScript
+js&gt; javaString.length()
+4
+js&gt; jsString.length
+10
+</pre>
+
+<p>Rhino <font>在减少这两种类型之间的差异方面提供了一些帮助。</font><font>首先,您可以将JavaScript字符串传递给需要Java字符串的Java方法,Rhino将执行转换。</font><font>实际上,我们在前面</font><code>java.lang.String</code> <font>例子中</font><font>的</font><font>构造函数</font><font>调用中看到了这个特性</font><font>。</font></p>
+
+<p><font>如果</font><code>java.lang.String</code> <font>类尚未定义它们,Rhino还会使JavaScript方法可用于Java字符串。例如:</font></p>
+
+<pre class="code">js&gt; javaString.match(/a.*/)
+ava
+</pre>
+
+<h3 id="JavaImporter_构造函数">JavaImporter 构造函数</h3>
+
+<p><code>JavaImporter</code>是一个新的全局构造函数,它允许在脚本化Java时省略显式的包名称:</p>
+
+<pre>var SwingGui = JavaImporter(Packages.javax.swing,
+ Packages.javax.swing.event,
+ Packages.javax.swing.border,
+ java.awt.event,
+ java.awt.Point,
+ java.awt.Rectangle,
+ java.awt.Dimension);
+...
+
+with (SwingGui) {
+ var mybutton = new JButton(test);
+ var mypoint = new Point(10, 10);
+ var myframe = new JFrame();
+...
+}
+</pre>
+
+<p>以前,这样的功能仅适用于将 <code>org.mozilla.javascript.ImporterTopLevel</code> 用作顶级作用域的嵌入。这个类提供额外的 <code>importPackage()</code> 和<code>importClass()</code> 全局函数的脚本,但其广泛的使用有污染Java类名的全局命名空间的趋势,还有防止垃圾收集加载类。</p>
+
+<p>详情请参阅 <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=245882">Bugzilla 245882</a>.</p>
+
+<h3 id="Java_异常">Java 异常</h3>
+
+
+
+<p><font><font>JavaScript代码使用</font></font> <code>try ... catch</code> 语句<font><font>可以捕获Java方法抛出的异常</font><font>。</font><font>Rhino将Java异常封装到具有以下属性的错误对象中:</font></font></p>
+
+<ul>
+ <li><code>javaException</code><font><font>:Java方法抛出的原始异常</font></font></li>
+ <li><code>rhinoException</code><font><font>:由Rhino运行时包装的异常</font></font></li>
+</ul>
+
+<p><code>instanceof</code><font><font>运算符可用于查询异常的类型:</font></font></p>
+
+
+
+<pre>try {
+ java.lang.Class.forName("NonExistingClass");
+} catch (e) {
+ if (e.javaException instanceof java.lang.ClassNotFoundException) {
+ print("Class not found");
+ }
+}
+</pre>
+
+<p>Rhino 还支持对 <code>try... catch</code> 语句的扩展,允许定义条件捕获异常:</p>
+
+<pre>function classForName(name) {
+ try {
+ return java.lang.Class.forName(name);
+ } catch (e if e.javaException instanceof java.lang.ClassNotFoundException) {
+ print("Class " + name + " not found");
+ } catch (e if e.javaException instanceof java.lang.NullPointerException) {
+ print("Class name is null");
+ }
+}
+
+classForName("NonExistingClass");
+classForName(null);
+</pre>
diff --git a/files/zh-cn/mozilla/projects/rhino/shell/index.html b/files/zh-cn/mozilla/projects/rhino/shell/index.html
new file mode 100644
index 0000000000..d5a4b779a9
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/rhino/shell/index.html
@@ -0,0 +1,179 @@
+---
+title: Shell
+slug: Mozilla/Projects/Rhino/Shell
+translation_of: Mozilla/Projects/Rhino/Shell
+---
+<p>JavaScript的外壳提供了一个简单的方法来在批处理模式下或编程的一个探索性的互动环境运行脚本.</p>
+<h3 id="Invoking_the_Shell" name="Invoking_the_Shell">调用Shell</h3>
+<p>&lt;big&gt;<code>java org.mozilla.javascript.tools.shell.Main {{ mediawiki.external('<var>options</var>') }} <var>script-filename-or-url</var> {{ mediawiki.external('<var>script-arguments</var>') }} </code>&lt;/big&gt;</p>
+<p>这里是一些选项 <code><var>options</var></code></p>
+<h4 id="-e_script-source" name="-e_script-source"><code>-e <var>script-source</var></code></h4>
+<p>把 <var>script-source</var>  作为 JavaScript 执行.</p>
+<h4 id="-f_script-filename-or-url" name="-f_script-filename-or-url"><code>-f <var>script-filename-or-url</var></code></h4>
+<p>读取<var>script-filename-or-url</var> 的内容并作为JavaScript执行.</p>
+<h4 id="-opt_optLevel_.2F_-O_optLevel" name="-opt_optLevel_.2F_-O_optLevel"><code>-opt <var>optLevel</var></code> / <code>-O <var>optLevel</var></code></h4>
+<p>优化等级 <var>optLevel</var>, 必须是 <code>-1</code> 或 [0-9]之间的整数. 参考<a href="/en/Rhino/Optimization" title="en/Rhino_Optimization">Rhino Optimization</a> 或许详情.</p>
+<h4 id="-version_versionNumber" name="-version_versionNumber"><code>-version <var>versionNumber</var></code></h4>
+<p>制定语言编译版本. 字符串 <var>versionNumber</var> 必须是 <code>100</code>, <code>110</code>, <code>120</code>, <code>130</code>, <code>140</code>, <a class="external" href="/en/JavaScript/New_in_JavaScript/1.5" title="https://developer.mozilla.org/editor/fckeditor/core/editor/en/New_in_JavaScript_1.5"><code>150</code></a>, <code><a class="external" href="/en/JavaScript/New_in_JavaScript/1.6" title="https://developer.mozilla.org/editor/fckeditor/core/editor/en/New_in_JavaScript_1.6">160</a> 或 <a class="external" href="/en/JavaScript/New_in_JavaScript/1.7" title="https://developer.mozilla.org/editor/fckeditor/core/editor/en/New_in_JavaScript_1.7">170</a></code>. 参考<a href="/en/Rhino/Overview#JavaScript_Language_Versions" title="en/Rhino_Overview#JavaScript_Language_Versions">JavaScript Language Versions</a>获取更多的语言版本信息.</p>
+<h4 id="-strict" name="-strict"><code>-strict</code></h4>
+<p>开启strict 模式.</p>
+<h4 id="-continuations" name="-continuations"><code>-continuations</code></h4>
+<p>启用continuation的实验支持,建立优化级别为-1强制解释模式. 从Rhino 1.7 开始这个选项不再可用.</p>
+<h4 id="Note" name="Note">注意</h4>
+<p>如果shell被使用设置为<code>true</code>的系统属性<code>rhino.use_java_policy_security调用,一个安全管理将被安装</code>, shell限制脚本通过基于根据URL访问Java安全选项的权限.如果JVM实现Java2的安全模型才可以用.</p>
+<h3 id="Predefined_Properties" name="Predefined_Properties">预定义的属性</h3>
+<p>在shell中呗执行的脚本访问顶层定义的一些属性.</p>
+<h4 id="arguments" name="arguments"><code>arguments</code></h4>
+<p><code>当shell被调用时,arguments</code> 对象是一个包含所有通过命令行输入的字符串的数组</p>
+<h4 id="environment" name="environment"><code>environment</code></h4>
+<p>返回当前环境对象.</p>
+<h4 id="history" name="history"><code>history</code></h4>
+<p>显示命令行中执行命令的历史.</p>
+<h4 id="help.28.29" name="help.28.29"><code>help()</code></h4>
+<p>获取帮助信息.</p>
+<h4 id="defineClass.28className.29" name="defineClass.28className.29"><code>defineClass(<var>className</var>)</code></h4>
+<p>定义一个使用Java类命名的扩展,参数 <var>className</var>是个类名的字符串. 使用 <code>ScriptableObject.defineClass()</code> 定义扩展.</p>
+<h4 id="deserialize.28filename.29" name="deserialize.28filename.29"><code>deserialize(<var>filename</var>)</code></h4>
+<p>从指定的文件恢复以前通过调用一个被<code>serialize</code>的对象.</p>
+<h4 id="gc" name="gc"><code>gc()</code></h4>
+<p>运行垃圾回收器.</p>
+<h4 id="load.28.5Bfilename.2C_....5D.29" name="load.28.5Bfilename.2C_....5D.29"><code>load([<var>filename</var>, ...])</code></h4>
+<p>载入字符串命名的参数JavaScript源码文件. 如果有多个参数被传递,那么每一个参数都会被读取并执行.</p>
+<h4 id="loadClass.28className.29" name="loadClass.28className.29"><code>loadClass(<var>className</var>)</code></h4>
+<p>载入并执行字符串<var>className</var>.表示的类.这个类必须是已实现的脚本接口, 就像任何被编译的脚本 <a href="/en/Rhino/JavaScript_Compiler" title="en/Rhino_JavaScript_Compiler">Rhino JavaScript Compiler</a>.</p>
+<h4 id="print.28.5Bexpr_....5D.29" name="print.28.5Bexpr_....5D.29"><code>print([<var>expr</var> ...])</code></h4>
+<p>评估并打印表达式. 评估每一个表达式, 把结果转化为字符串并打印.</p>
+<h4 id="readFile.28path_.5B.2C_characterCoding.29" name="readFile.28path_.5B.2C_characterCoding.29"><code>readFile(<var>path</var> [, <var>characterCoding]</var>)</code></h4>
+<p>读取给定的文件并使用指定的编码把字节转换为字符串,如果没有制定编码就用默认编码.</p>
+<h4 id="readUrl.28url_.5B.2C_characterCoding.29" name="readUrl.28url_.5B.2C_characterCoding.29"><code>readUrl(<var>url</var> [, <var>characterCoding</var>])</code></h4>
+<p>打开指定的url,读取所有的字节并用指定的编码转化为数组,如果没有指定编码就是用默认的.</p>
+<h4 id="runCommand.28commandName.2C_.5Barg.2C_....5D_.5Boptions.5D.29" name="runCommand.28commandName.2C_.5Barg.2C_....5D_.5Boptions.5D.29"><code>runCommand(<var>commandName</var>, [<var>arg</var>, ...] [<var>options</var>])</code></h4>
+<p>执行参数中给定的命令,作为一个独立的进程选项并返回该进程的退出状态.</p>
+<p>Usage:</p>
+<pre>runCommand(command)
+runCommand(command, arg1, ..., argN)
+runCommand(command, arg1, ..., argN, options)
+</pre>
+<p>All except the last arguments to <code>runCommand</code> are converted to strings and denote command name and its arguments. If the last argument is a JavaScript object, it is an option object. Otherwise it is converted to string denoting the last argument and options objects assumed to be empty.</p>
+<p>The following properties of the option object are processed:</p>
+<ul>
+ <li><code>args</code> - provides an array of additional command arguments</li>
+ <li><code>env</code> - explicit environment object. All its enumeratable properties define the corresponding environment variable names.</li>
+ <li><code>input</code> - the process input. If it is not <code>java.io.InputStream</code>, it is converted to string and sent to the process as its input. If not specified, no input is provided to the process.</li>
+ <li><code>output</code> - the process output instead of <code>java.lang.System.out</code>. If it is not instance of <code>java.io.OutputStream</code>, the process output is read, converted to a string, appended to the output property value converted to string and put as the new value of the output property.</li>
+ <li><code>err</code> - the process error output instead of <code>java.lang.System.err</code>. If it is not instance of <code>java.io.OutputStream</code>, the process error output is read, converted to a string, appended to the err property value converted to string and put as the new value of the err property.</li>
+</ul>
+<h4 id="seal.28object.29" name="seal.28object.29"><code>seal(<var>object</var>)</code></h4>
+<p>Seal the specified object so any attempt to add, delete or modify its properties would throw an exception.</p>
+<h4 id="serialize.28object.2C_filename.29" name="serialize.28object.2C_filename.29"><code>serialize(<var>object</var>, <var>filename</var>)</code></h4>
+<p>Serialize the given object to the specified file.</p>
+<h4 id="spawn.28functionOrScript.29" name="spawn.28functionOrScript.29"><code>spawn(<var>functionOrScript</var>)</code></h4>
+<p>Run the given function or script in a different thread.</p>
+<h4 id="sync.28function.29" name="sync.28function.29"><code>sync(<var>function</var>)</code></h4>
+<p>creates a synchronized function (in the sense of a Java <code>synchronized</code> method) from an existing function. The new function synchronizes on the <code>this</code> object of its invocation.</p>
+<h4 id="quit.28.29" name="quit.28.29"><code>quit()</code></h4>
+<p>退出shell. 如果文件字符是在提示符下键入,shell将也退出在交互模式下.</p>
+<h4 id="version.28.5Bnumber.5D.29" name="version.28.5Bnumber.5D.29"><code>version([<var>number</var>])</code></h4>
+<p>设置或获取JavaScript的版本号. 如果没有参数,就返回当前的版本. 如果有参数,参数要在 <code>100</code>, <code>110</code>, <code>120</code>, <code>130</code>, <code>140</code>, <code>150</code>, <code>160 或 170范围内,它们分别对应</code> JavaScript1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6 or 1.7.</p>
+<h3 id="Examples" name="Examples">例子</h3>
+<h4 id="Invocation" name="Invocation">调用</h4>
+<p>Here the shell is invoked three times from the command line. (The system command prompt is shown as <code>$</code>.) The first invocation executes a script specified on the command line itself. The next invocation has no arguments, so the shell goes into interactive mode, reading and evaluating each line as it is typed in. Finally, the last invocation executes a script from a file and accesses arguments to the script itself.</p>
+<pre>$ java org.mozilla.javascript.tools.shell.Main -e print('hi')
+hi
+$ java org.mozilla.javascript.tools.shell.Main
+js&gt; print('hi')
+hi
+js&gt; 6*7
+42
+js&gt; function f() {
+ return a;
+}
+js&gt; var a = 34;
+js&gt; f()
+34
+js&gt; quit()
+$ cat echo.js
+for (i in arguments) {
+ print(arguments[i])
+}
+$ java org.mozilla.javascript.tools.shell.Main echo.js foo bar
+foo
+bar
+$
+</pre>
+<h4 id="spawn_and_sync" name="spawn_and_sync"><code>spawn</code> 和 sync </h4>
+<p>下面的例子创建了2个线程 via <code>spawn</code> 和 uses <code>sync</code> 去创建同步的函数test <code>test版本.</code></p>
+<pre>js&gt; function test(x) {
+ print("entry");
+ java.lang.Thread.sleep(x*1000);
+ print("exit");
+}
+js&gt; var o = { f : sync(test) };
+js&gt; spawn(function() {o.f(5);});
+Thread[Thread-0,5,main]
+entry
+js&gt; spawn(function() {o.f(5);});
+Thread[Thread-1,5,main]
+js&gt;
+exit
+entry
+exit
+</pre>
+<h4 id="runCommand" name="runCommand"><code>运行命令</code></h4>
+<p>这是在Linux下调用 <code>runCommand</code> 的例子.</p>
+<pre>js&gt; runCommand('date')
+Thu Jan 23 16:49:36 CET 2003
+0
+// Using input option to provide process input
+js&gt; runCommand("sort", {input: "c\na\nb"})
+a
+b
+c
+0
+js&gt; // Demo of output and err options
+js&gt; var opt={input: "c\na\nb", output: 'Sort Output:\n'}
+js&gt; runCommand("sort", opt)
+0
+js&gt; print(opt.output)
+Sort Output:
+a
+b
+c
+js&gt; var opt={input: "c\na\nb", output: 'Sort Output:\n', err: ''}
+js&gt; runCommand("sort", "--bad-arg", opt)
+2
+js&gt; print(opt.err)
+/bin/sort: unrecognized option `--bad-arg'
+Try `/bin/sort --help' for more information.
+
+js&gt; runCommand("bad_command", "--bad-arg", opt)
+js: "&lt;stdin&gt;", line 18: uncaught JavaScript exception: java.io.IOException: bad_command: not found
+js&gt; // Passing explicit environment to the system shell
+js&gt; runCommand("sh", "-c", "echo $env1 $env2", { env: {env1: 100, env2: 200}})
+100 200
+0
+js&gt; // Use args option to provide additional command arguments
+js&gt; var arg_array = [1, 2, 3, 4];
+js&gt; runCommand("echo", { args: arg_array})
+1 2 3 4
+0
+</pre>
+<p>Windows下的例子也差不多:</p>
+<pre>js&gt; // Invoke shell command
+js&gt; runCommand("cmd", "/C", "date /T")
+27.08.2005
+0
+js&gt; // Run sort collectiong the output
+js&gt; var opt={input: "c\na\nb", output: 'Sort Output:\n'}
+js&gt; runCommand("sort", opt)
+0
+js&gt; print(opt.output)
+Sort Output:
+a
+b
+c
+js&gt; // Invoke notepad and wait until it exits
+js&gt; runCommand("notepad")
+0
+</pre>
+<p>{{ languages( { "zh-cn": "zh-cn/Shell" } ) }}</p>
diff --git a/files/zh-cn/mozilla/projects/social_api/index.html b/files/zh-cn/mozilla/projects/social_api/index.html
new file mode 100644
index 0000000000..55d8b5525e
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/social_api/index.html
@@ -0,0 +1,97 @@
+---
+title: Social API
+slug: Mozilla/Projects/Social_API
+tags:
+ - API
+ - Landing
+ - Mozilla
+ - NeedsTranslation
+ - Social
+ - TopicStub
+translation_of: Archive/Social_API
+---
+<p><span class="seoSummary">The Social API is an architecture that makes it easier for web browsers to integrate with social media services, using standard web technologies as the API. Once a social service provider is implemented for Firefox, it becomes possible for the browser to integrate web resources from a service, in-chrome user controls and information related to that service.</span> The following articles explain how to implement a social service provider.<br>
+ <br>
+ The Social API supports specific vertical use cases centered around social interactions, but does not tightly constrain those use cases, allowing flexibility and creativity for 3rd parties. Specific features supported are notifications, share, bookmarking (or save-for-later), sidebars and communications (e.g. chat and video).</p>
+
+<div class="row topic-page">
+<div class="section">
+<h2 class="Documentation" id="Social_API_documentation">Social API documentation</h2>
+
+<dl>
+ <dt><a href="/en-US/docs/Social_API/Glossary" title="/en-US/docs/Social_API/Glossary">Social API glossary</a></dt>
+ <dd>Provides definitions of key terms you'll need to understand when using the Social API.</dd>
+ <dt><a href="/en-US/docs/Social_API/Manifest" title="/en-US/docs/Social_API/Manifest">Social service manifest</a></dt>
+ <dd>A description of—(TBD: and guide to building)—the manifest required.</dd>
+ <dt><a href="/en-US/docs/Social_API/Service_worker_API_reference" title="/en-US/docs/Social_API/Service_worker_reference">Social service worker API reference</a> {{obsolete_inline(48)}}</dt>
+ <dd>A reference to the social service worker API.</dd>
+ <dt><a href="/en-US/docs/DOM/navigator.mozSocial" title="/en-US/docs/DOM/navigator.mozSocial">Social service content API: MozSocial</a> {{obsolete_inline(51)}}</dt>
+ <dd>A reference to the social service content API, which is provided by the {{domxref("navigator.MozSocial")}} object.</dd>
+ <dt><a href="/en-US/docs/Social_API/Share" title="/en-US/docs/Social_API/Share">Social share API</a></dt>
+ <dd>A reference to the Share API.</dd>
+ <dt><a href="/en-US/docs/Social_API/Bookmarks" title="/en-US/docs/Social_API/Share">Social bookmarks API</a> {{obsolete_inline(51)}}</dt>
+ <dd>A reference to the Social Bookmarks API.</dd>
+ <dt><a href="/en-US/docs/Social_API/Status" title="/en-US/docs/Social_API/Share">Social status API</a> {{obsolete_inline(51)}}</dt>
+ <dd>A reference to the Status API.</dd>
+ <dt><a href="/en-US/docs/Social_API/Widgets" title="/en-US/docs/Social_API/Widgets">Social service widgets</a></dt>
+ <dd>A guide to the widgets provided by the social service.</dd>
+</dl>
+
+<h2 id="How_to_create_a_SocialAPI_Provider">How to create a SocialAPI Provider</h2>
+
+<p>A step-by-step guide to create a simple Social API provider.</p>
+
+<dl>
+ <dt><a href="/en-US/docs/Social_API/Guide/FirstSteps" title="/en-US/docs/Social_API/FirstSteps">First Steps</a></dt>
+ <dd>The basics of getting an installable social provider running.</dd>
+ <dt><a href="/en-US/docs/Social_API/Guide/AmbientNotifications" title="/en-US/docs/Social_API/Implementing_chat_functionality">Adding ambient notifications</a> {{obsolete_inline(51)}}</dt>
+ <dd>A short guide to implementing ambient notifications using the Social API.</dd>
+ <dt><a href="/en-US/docs/Social_API/Guide/Status" title="/en-US/docs/Social_API/Implementing_chat_functionality">Implementing status and notifications</a> {{obsolete_inline(51)}}</dt>
+ <dd>A guide to implementing a status panel with notifications using the Social API.</dd>
+ <dt><a href="/en-US/docs/Social_API/Guide/Bookmarks" title="/en-US/docs/Social_API/Implementing_chat_functionality">Adding bookmark support</a> {{obsolete_inline(51)}}</dt>
+ <dd>A short guide to implementing social bookmarks using the Social API.</dd>
+ <dt><a href="/en-US/docs/Social_API/Guide/Share" title="/en-US/docs/Social_API/Implementing_chat_functionality">Implementing share</a></dt>
+ <dd>A guide to implementing a share panel using the Social API.</dd>
+ <dt><a href="/en-US/docs/Social_API/Guide/Chat" title="/en-US/docs/Social_API/Implementing_chat_functionality">Supporting chat</a> {{obsolete_inline(51)}}</dt>
+ <dd>A guide to implementing chat features using the Social API.</dd>
+</dl>
+
+<p><span class="alllinks"><a href="/en-US/docs/tag/Social" title="/en-US/docs/tag/CSS">View All...</a></span></p>
+</div>
+
+<div class="section">
+<h2 class="Community" id="Community" name="Community">Getting help from the community</h2>
+
+<p>Need help on a Social API related problem and can't find the solution in the documentation?</p>
+
+<ul>
+ <li>Ask your question on the Mozilla IRC channel: <a href="irc://irc.mozilla.org/socialdev" title="irc://irc.mozilla.org/socialdev">#socialdev</a></li>
+</ul>
+
+<p><span class="alllinks"><a class="external" href="http://www.catb.org/~esr/faqs/smart-questions.html" title="http://www.catb.org/~esr/faqs/smart-questions.html">Don't forget about the <em>netiquette</em>...</a></span></p>
+
+<h2 class="Tools" id="Tools" name="Tools">Tools and demos</h2>
+
+<ul>
+ <li><a href="https://github.com/mixedpuppy/socialapi-demo" title="https://github.com/mixedpuppy/socialapi-demo">A complete sample social service provider on github</a>.</li>
+ <li><a href="https://github.com/mixedpuppy/socialapi-toolbarbutton">A sample using only a toolbarbutton</a>.</li>
+ <li><a href="https://github.com/mixedpuppy/socialapi-sidebar">A sample sidebar project</a>. {{obsolete_inline(51)}}</li>
+ <li><a href="/en-US/docs/Social_API_Devtools" title="/en-US/docs/Social_API_Devtools">How to use the Firefox Developer Tools with the Social API</a>.</li>
+</ul>
+
+<p><span class="alllinks"><a href="/en-US/docs/tag/Social" title="/en-US/docs/tag/CSS:Tools">View All...</a></span></p>
+
+<h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">Available Social Providers</h2>
+
+<p>Try out any of several providers on the <a href="https://activations.cdn.mozilla.net/">SocialAPI Directory</a> site (Firefox 29 or later required)</p>
+
+
+<h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">Related Topics</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Apps" title="/en-US/docs/Apps">Open web apps</a></li>
+</ul>
+</div>
+</div>
+
+<p> </p>
diff --git a/files/zh-cn/mozilla/projects/social_api/share/index.html b/files/zh-cn/mozilla/projects/social_api/share/index.html
new file mode 100644
index 0000000000..844ac9d693
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/social_api/share/index.html
@@ -0,0 +1,86 @@
+---
+title: Share
+slug: Mozilla/Projects/Social_API/Share
+translation_of: Archive/Social_API/Share
+---
+<p id="Share">这一篇只是初步草案,可能会被改变。分享从 [TBD: Firefox 23] 开始可用。</p>
+
+<p>A service provider may choose to provide a Share panel that users can use to share content from the current browser tab with their friends.  The Share panel is slightly different from other Social UI in the browser.  The Share panel itself contains a list of providers that support the share functionality.  When a user shares a page, they can choose which provider they want to share with.  Each provider may have differing functionality, such as simply providing a comment box to extensive functionlality allowing for image selection and more.</p>
+
+<p>Share is initiated by the user either through the share button in the toolbar or a context menu.  The user can select an image or text in a page to be shared, or share the page itself.  Links within a page may also be shared without visiting the link.</p>
+
+<p>A provider implementing support for share may choose to use a URL template that is compatible with OExchange, however the browser also sends a DOM event to the page after load containing details of the share.  In some circumstances, such as sharing a link on the page, the browser will not have detailed information.  Using the DOM event allows the provider to display information about the page being shared without needing to fetch it themselves and parse the page for information.  The browser includes certain META tags, including OpenGraph tags in the event data.</p>
+
+<h2 id="A_User_Experience_Flow_for_Share">A User Experience Flow for Share</h2>
+
+<p>SocialAPI content works different than typical web pages.  The are presented as primary UI in the browser, and may be confined in size, live longer than a browser tab, and more.  How your user will interact with your share panel is unique and you will need to take into account how a user should experience your share panel.</p>
+
+<p>[TODO: describe the expected flow here]</p>
+
+<h2 id="OpenGraphData_DOM_Event">OpenGraphData DOM Event</h2>
+
+<p>The share page can listen for the <code>OpenGraphData</code> DOM Event.</p>
+
+<pre>addEventListener("OpenGraphData", function(e) {
+  var shareData = JSON.parse(e.detail);
+  $("#shared").text(shareData.url);
+})
+</pre>
+
+<h4 id="Attributes">Attributes</h4>
+
+<p>The event detail can contain the following attributes which are retreived from META tags and other tags within HEAD, such as the TITLE tag:</p>
+
+<ul>
+ <li>url: The URL to the page, link, image or video being shared</li>
+ <li>medium: The media type being shared</li>
+ <li>source: The media url being shared if a video is being shared</li>
+ <li>sitename: The site name</li>
+ <li>title: The title of the page</li>
+ <li>description: The description of the page</li>
+ <li>text: The selected text that the user is sharing</li>
+ <li>previews: A list of images available as page previews</li>
+</ul>
+
+<h2 id="Share_URL_Template">Share URL Template</h2>
+
+<p>While we prefer the use of the DOM event, many sites have existing endpoints that allow users to share to that site.  SocialAPI supports using a URL template to make implementation easy for sites that already have this functionality.  In your manifest, you can define your shareURL in this format:</p>
+
+<pre>"shareURL": "https://yoursite.com/share?u=%{url}&amp;t=%{title}</pre>
+
+<p>The %{name} values will be replaced with the following attributes if available.  Otherwise that parameter is removed from the final url used to load your share endpoint.</p>
+
+<ul>
+ <li>url: The URL to the page, link, image or video being shared</li>
+ <li>medium: The media type being shared</li>
+ <li>source: The media url being shared if a video is being shared</li>
+ <li>sitename: The site name</li>
+ <li>title: The title of the page</li>
+ <li>description: The description of the page</li>
+ <li>text: The selected text that the user is sharing</li>
+ <li>image: A URL to an image to use as a preview, or the image shared by the user.</li>
+</ul>
+
+<h2 id="How_to_properly_size_your_share_panel">How to properly size your share panel</h2>
+
+<p>Your share panel is presented in a door hanger from the browser toolbar.  While it can be flexible in size, there is a minimum and a maximum size that the panel will allow.  You also need to implement a couple items to help the browser identify the size you need for your panel.  There are a few ways you can define the proper size for your panel, here are some examples:</p>
+
+<h3 id="Styling_the_BODY_element">Styling the BODY element</h3>
+
+<p>By default the browser will look at the <code>body.style.width</code> and <code>body.style.height</code>, also taking into account the margin.  It will try to size the panel to show your full page.</p>
+
+<pre>&lt;html&gt;
+&lt;body style="width: 300px; height: 400px"&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<h3 id="Identifying_a_content_element">Identifying a content element</h3>
+
+<p>The browser will also look to see if you have defined a primary content element.  If you have, then it will use the width and height styles from that element to size the panel.  You will need to make sure that your content element is properly placed.</p>
+
+<pre>&lt;html&gt;
+&lt;body contentid="content"&gt;
+&lt;div id="content" style="width: 300px; height: 400px; top: 0; left: 0;"/&gt;
+&lt;/body&gt;
+&lt;/html&gt;</pre>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/build_documentation/index.html b/files/zh-cn/mozilla/projects/spidermonkey/build_documentation/index.html
new file mode 100644
index 0000000000..ecb793016e
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/build_documentation/index.html
@@ -0,0 +1,294 @@
+---
+title: SpiderMonkey Build Documentation
+slug: Mozilla/Projects/SpiderMonkey/Build_Documentation
+translation_of: Mozilla/Projects/SpiderMonkey/Build_Documentation
+---
+<div>{{SpiderMonkeySidebar("General")}}</div>
+
+<h2 id="构建_SpiderMonkey">构建 SpiderMonkey</h2>
+
+<p>使用本说明来构建最新的 SpiderMonkey 源码.</p>
+
+<p><strong>在构建前, 确保有适合你计算机的构建工具:</strong> <a href="/en-US/Developer_Guide/Build_Instructions/Linux_Prerequisites" title="en/Linux_Build_Prerequisites">Linux</a>, <a href="/en/Developer_Guide/Build_Instructions/Windows_Prerequisites" title="en/Windows_Build_Prerequisites">Windows</a>, <a href="/en/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites" title="en/Mac_OS_X_Build_Prerequisites">Mac</a>, <a href="/en/Developer_Guide/Build_Instructions" title="en/Build_Documentation">others</a>. 当构建的版本低于28, 你还需要外加 <a href="/en/NSPR" title="en/NSPR">NSPR</a>.</p>
+
+<p style="margin: 0px 0px 1.7em; padding: 0px;">以及理所当然地, 你需要 <a class="internal" href="Getting_SpiderMonkey_source_code" title="En/SpiderMonkey/Getting SpiderMonkey source code#Getting the latest SpiderMonkey source code">获取 SpiderMonkey 源代码。</a></p>
+
+<h3 id="非开发者_(优化)_模式构建">非开发者 (优化) 模式构建</h3>
+
+<p>如果你想在生产环境中安装使用SpiderMonkey或运行标准性能测试,可以使用此步骤。 (如果你想在你的C++应用中把 SpiderMonkey 作为库使用, 或从事改进 SpiderMonkey 本身的工作, 按之后的描述,使用 开发者/调试 模式构建.)</p>
+
+<pre class="eval">cd js/src
+autoconf2.13
+
+# This name should end with "_OPT.OBJ" to make the version control system ignore it.
+mkdir build_OPT.OBJ
+cd build_OPT.OBJ
+../configure
+# Use "mozmake" on Windows
+make
+</pre>
+
+<p>一些注意事项:</p>
+
+<ul>
+ <li>
+ <p>The most common build problems are dependency problems. See the <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions#Getting_started">build prerequisites page for your platform</a>.</p>
+ </li>
+ <li>
+ <p>SpiderMonkey does not support building in your source directory. You must configure and build in a separate build directory, as shown above.</p>
+ </li>
+ <li>
+ <p>Yes, autoconf version 2.13 really is required. Later versions won't work. (However, don't install it as your system <code>autoconf</code>. That also won't work, and it's a bad idea because that version is so old.)</p>
+ </li>
+</ul>
+
+<div class="note">
+<p><strong>Note</strong>: If you are on Mac and getting an error similar to</p>
+
+<p>"<code>checking whether the C compiler (gcc-4.2  ) works... no<br>
+ configure: error: installation or configuration problem: C compiler cannot create executables.</code>"</p>
+
+<p>You can try configuring like so:</p>
+
+<pre><code>CC=clang CXX=clang++ ../configure</code></pre>
+
+<p>It is also possible that baldrdash  may fail to compile with</p>
+
+<pre>/usr/local/Cellar/llvm/7.0.1/lib/clang/7.0.1/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found
+
+/usr/local/Cellar/llvm/7.0.1/lib/clang/7.0.1/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found, err: true</pre>
+
+<p>This is because, starting from Mohave, headers are no longer installed in /usr/include. Refer the <a href="https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes">release notes</a>  under Command Line Tools -&gt; New Features</p>
+
+<p>The release notes also states that this compatibility package will no longer be provided in the near future, so the build system on macOS will have to be adapted to look for headers in the SDK<br>
+ <br>
+ Until then, the following should help,</p>
+
+<pre><code>open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pk
+</code></pre>
+</div>
+
+<p>This builds an executable named <code>js</code> in the directory <code>build-release/dist/bin</code>. You can test it with <code>dist/bin/js --help</code>, which displays a help page. At this point, you're ready to <a href="/en/SpiderMonkey/Introduction_to_the_JavaScript_shell" title="en/Introduction_to_the_JavaScript_shell">run and try out the shell</a>.</p>
+
+<p>On Mac, Linux, or UNIX, you can install SpiderMonkey on your system with the additional command <code>make install</code>. This installs the shared library to <code>/usr/local/lib</code>, the C header files to <code>/usr/local/include</code>, and the <code>js</code> executable to<code>/usr/local/bin</code>.</p>
+
+<h3 id="开发者_(调试)_模式构建">开发者 (调试) 模式构建</h3>
+
+<p>For developing and debugging SpiderMonkey itself, it is best to have both a debug build (for everyday debugging) and an optimized build (for performance testing), in separate build directories. Thus, in addition to following the steps above, you should also create a debug build using these steps:</p>
+
+<pre class="eval">cd js/src
+autoconf2.13
+
+# This name should end with "_DBG.OBJ" to make the version control system ignore it.
+mkdir build_DBG.OBJ
+cd build_DBG.OBJ
+../configure --enable-debug --disable-optimize
+# Use "mozmake" on Windows
+make
+</pre>
+
+<p>You can also build debug builds of SpiderMonkey with the <code>JS_GC_ZEAL</code> option, which adds a new built-in function to SpiderMonkey that lets you configure zealous garbage collection.  This can help debug memory leaks and other memory-related problems. See <a class="internal" href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCZeal" title="En/SpiderMonkey/JSAPI Reference/JS SetGCZeal"><code>JS_SetGCZeal()</code></a> for details.</p>
+
+<p>For a list of other available build options, type (assuming the current working directory is one of the above-created build directories):</p>
+
+<pre class="eval">../configure --help
+</pre>
+
+<h4 id="生成编译数据库">生成编译数据库</h4>
+
+<p>Some tools (like IDEs, static analyzers and refactoring tools) consume a file called <code><a href="https://clang.llvm.org/docs/JSONCompilationDatabase.html">compile_commands.json</a></code> which contains a description of all the pieces required to build a piece of software so that tools don't have to also understand a build system.</p>
+
+<p>To generate a <code>compile_commands.json</code> with the SpiderMonkey <code>configure</code> script, enable the CompileDB backend, like this:</p>
+
+<pre class="syntaxbox"> ../configure &lt;options&gt; --enable-build-backends=CompileDB,RecursiveMake
+</pre>
+
+<p>(RecursiveMake is there as you'd likely also want to be able to build!)</p>
+
+<h3 id="Building" name="Building">Windows Builds</h3>
+
+<div class="note">
+<p>Since version 28, <strong>threadsafe builds are the default</strong>, and should work out of the box on all POSIX platforms. Hence, the following instructions should only be relevant if you're on Windows or compiling an older version of SpiderMonkey.</p>
+</div>
+
+<p>The <a href="https://wiki.mozilla.org/MozillaBuild">MozillaBuild</a> batch file you used to open your shell (e.g. <code>start-shell-msvc2013.bat</code> or <code>start-shell-msvc2013-x64.bat</code>) determines whether the compiler toolchain will target 32-bit or 64-bit builds. To create a 64-bit build, note that you must configure with <code>--target=x86_64-pc-mingw32 --host=x86_64-pc-mingw32</code>.</p>
+
+<p>Since the POSIX NSPR emulation is not available for Windows, a working version of NSPR must be available to your build. <strong>The easiest option is to configure with <code>--enable-nspr-build.</code></strong><code> </code>This configure option builds the in-tree version of NSPR which is probably what you want; <span style="line-height: normal;"><span style="line-height: normal;">because SpiderMonkey uses newer NSPR symbols, the NSPR that ships with your operating system probably does not work.</span></span></p>
+
+<p>If <code>--enable-nspr-build</code> does not work, explicitly tell <code>configure</code> where to find NSPR using the <code>--with-nspr-cflags</code> and <code>--with-nspr-libs</code> configure options. For example, assuming your local NSPR has been installed to <code>C:/mozilla-build/msys/local</code>:</p>
+
+<pre><span style="line-height: normal;"><code><span style="line-height: normal;"><code><code>./configure<code> --with-nspr-cflags="-IC:/mozilla-build/msys/local/include" \
+     --with-nspr-libs="<span style="line-height: normal;"><code><span style="line-height: normal;"><code><code><code>C:/mozilla-build/msys/local</code></code></code></span></code></span>/lib/libnspr4.a \
+ <span style="line-height: normal;"><code><span style="line-height: normal;"><code><code><code>C:/mozilla-build/msys/local</code></code></code></span></code></span>/lib/libplds4.a \
+ <span style="line-height: normal;"><code><span style="line-height: normal;"><code><code><code>C:/mozilla-build/msys/local</code></code></code></span></code></span>/lib/libplc4.a"</code>
+</code></code></span></code></span></pre>
+
+<p>If you get symbol loading or dynamic library errors, you can force the correct NSPR to load with:</p>
+
+<pre><span style="line-height: normal;">PATH="$PATH;<span style="line-height: normal;">C:/mozilla-build/msys/local/lib/</span><span style="line-height: normal;">" ./js</span></span></pre>
+
+<h2 id="指定安装目录">指定安装目录</h2>
+
+<p><code>make install</code> puts files in the following directories by default. You can override this by passing options to the <code>configure</code> script:</p>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th>What it is</th>
+ <th>Where it gets put</th>
+ <th><code>configure</code> option</th>
+ </tr>
+ <tr>
+ <td>executables, shell scripts</td>
+ <td><code>/usr/local/bin</code></td>
+ <td><code>--bindir</code></td>
+ </tr>
+ <tr>
+ <td>libraries, data</td>
+ <td><code>/usr/local/lib</code></td>
+ <td><code>--libdir</code></td>
+ </tr>
+ <tr>
+ <td>architecture-independent data</td>
+ <td><code>/usr/local/share</code></td>
+ <td><code>--sharedir</code></td>
+ </tr>
+ <tr>
+ <td>C header files</td>
+ <td><code>/usr/local/include</code></td>
+ <td><code>--includedir</code></td>
+ </tr>
+ </tbody>
+</table>
+
+<p>For convenience, you can pass the <code>configure</code> script an option of the form <code>--prefix=&lt;PREFIXDIR&gt;</code>, which substitutes <code>&lt;PREFIXDIR&gt;</code> for <code>/usr/local</code> in all the settings above, in one step. This is usually the least troublesome thing to do, as it preserves the typical arrangement of <code>lib</code>, <code>bin</code>, and the rest.</p>
+
+<div class="note"><strong>Note:</strong> All directories you pass to <code>configure</code> are recorded in the generated makefile, so you don't need to specify them again until you re-run <code>configure</code>.</div>
+
+<h2 id="构建_SpiderMonkey_作为静态库">构建 SpiderMonkey 作为静态库</h2>
+
+<p>默认情况下, SpiderMonkey 会构建为共享库. However, you can build SpiderMonkey as a static library by specifying the <code>--disable-shared-js</code> flag when you run <code>configure</code>.</p>
+
+<h2 id="指定编译器及编译标签">指定编译器及编译标签</h2>
+
+<p>If you want to use a compiler other than the one the <code>configure</code> script chooses for you by default, you can set the <code>CXX</code> variable in the environment when you run <code>configure</code>. This will save the values you specify in the generated makefile, so once you've set it, you don't need to do so again until you re-run <code>configure</code>.</p>
+
+<p>If you'd like to pass certain flags to the compiler, you can set the <code>CXXFLAGS</code> environment variable when you run <code>configure</code>. For example, if you're using the GNU toolchain, the following will pass the <code>-g3</code> flag to the compiler, causing it to emit debug information about macros. Then you can use those macros in <code>gdb</code> commands:</p>
+
+<pre class="eval">$ <strong>CXXFLAGS=-g3 $SRC/configure</strong>
+<em>...</em>
+checking whether the C++ compiler (c++ -g3 ) works... yes
+<em>...</em>
+$
+</pre>
+
+<h2 id="交叉编译选项">交叉编译选项</h2>
+
+<p>For cross-compiling you will need a cross-compiling compiler. That tends to be easier with clang as clang has cross-compiling support built in. You may need other libraries though.  For example on debian linux you'll need the following to cross compile from x86_64 to x86.</p>
+
+<pre class="syntaxbox">apt install clang libstdc++-8-dev-i386-cross binutils-i686-gnu zlib1g-dev:i386</pre>
+
+<p>You'll also need rust, in addition to having normal rust set up you'll need to add another target to your existing rust toolchain (don't add a new toolchain spidermonkey will use only one toolchain and use it for both host and target code:</p>
+
+<pre class="syntaxbox">rustup target add i686-unknown-linux-gnu</pre>
+
+<p>To build a 32-bit version on a 64-bit Linux system, you can use the following:</p>
+
+<pre class="eval">PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig CC="gcc -m32 -mfpmath=sse -msse -msse2" CXX="g++ -m32 -mfpmath=sse -msse -msse2" AR=ar \
+$SRC/configure --target=i686-pc-linux
+</pre>
+
+<p>Or for clang.</p>
+
+<pre class="syntaxbox">$SRC/configure --target=i686-pc-linux-gnu</pre>
+
+<p>To build a 32-bit arm version on a 64-bit Linux system, that runs in the arm simulator, you can use the following:</p>
+
+<pre>   AR=ar CC="gcc -m32 -mfpmath=sse -msse -msse2" CXX="g++ -m32 -mfpmath=sse -msse -msse2" \
+    $SRC/configure --target=i686-pc-linux --enable-simulator=arm
+</pre>
+
+<p>To build a 32-bit version on a 64-bit Mac system (the target version is specific to your OS/X SDK), you can use the following:</p>
+
+<pre class="syntaxbox">$SRC/configure --target=i386-apple-darwin16.7.0 # Choose the appropriate SDK version for your version of OS/X</pre>
+
+<p>To build a 64-bit version on a 32-bit Mac system (e.g. Mac OS X 10.5), you can use the following:</p>
+
+<pre class="eval">AR=ar CC="gcc -m64" CXX="g++ -m64" ../configure --target=x86_64-apple-darwin10.0.0
+</pre>
+
+<p>To build a 64-bit Windows version, you can use the following:</p>
+
+<pre class="eval">$SRC/configure --host=x86_64-pc-mingw32 --target=x86_64-pc-mingw32
+</pre>
+
+<div class="note"><strong>Note:</strong> You must have started your MozillaBuild shell with the proper -x64.bat script in order for the 64-bit compilers to be in your PATH.</div>
+
+<p>Whatever compiler and flags you pass to <code>configure</code> are recorded in the generated makefile, so you don't need to specify them again until you re-run <code>configure</code>.</p>
+
+<h2 id="Building_your_application">Building your application</h2>
+
+<p>While "How to build your complete application" is clearly out of scope for this document, here are some tips that will help get you on your way:</p>
+
+<ul>
+ <li>The SpiderMonkey developers frequently and deliberately change the JSAPI ABI. You cannot use headers built for one version/configuration of JSAPI to create object files which will be linked against another.</li>
+ <li>Support for JS_THREADSAFE was recently removed, and threadsafe builds are now enabled by default.</li>
+ <li>The <code>js-config</code> script, described below, is the recommended way to determine correct include paths, required libraries, etc. for your embedding to use during compilation. We highly recommend calling the <code>js-config</code> script from your embedding's makefile to set your CFLAGS, LDFLAGS, and so forth.</li>
+ <li>To install SpiderMonkey somewhere other than the default, you must use the <code>configure</code> <code>--prefix</code> option, as described above. Failure to do so may break your <code>js-config.h</code> header or <code>js-config</code> script.</li>
+ <li>Some features detected by the <code>configure</code> script do not work for cross-compilation.</li>
+</ul>
+
+<h3 id="Using_the_js-config_script">Using the js-config script</h3>
+
+<p>In addition to the SpiderMonkey libraries, header files, and shell, the SpiderMonkey build also produces a shell script named <code>js-config</code> which other build systems can use to find out how to compile code using the SpiderMonkey APIs, and how to link with the SpiderMonkey libraries.</p>
+
+<div class="note"><strong>Note:</strong> In SpiderMonkey 1.8.5, the js-config script is not generated properly on many platforms. If the instructions below do not work, you can try this <a href="/en/SpiderMonkey/1.8.5#js-config" title="https://developer.mozilla.org/en/SpiderMonkey/1.8.5#js-config">workaround</a>.</div>
+
+<p>When invoked with the <code>--cflags</code> option, <code>js-config</code> prints the flags that you should pass to the C compiler when compiling files that use the SpiderMonkey API. These flags ensure the compiler will find the SpiderMonkey header files.</p>
+
+<pre class="eval">$ ./js-config --cflags # Example output: -I/usr/local/include/js -I/usr/include/nspr
+</pre>
+
+<p>When invoked with the <code>--libs</code> option, <code>js-config</code> prints the flags that you should pass to the C compiler when linking an executable or shared library that uses SpiderMonkey. These flags ensure the compiler will find the SpiderMonkey libraries, along with any libraries that SpiderMonkey itself depends upon (like NSPR).</p>
+
+<pre class="eval">$ ./js-config --libs # Example output: -L/usr/local/lib -lmozjs -L/usr/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -ldl -lm -lm -ldl</pre>
+
+<h2 id="Test" name="Test">Testing SpiderMonkey</h2>
+
+<ul>
+ <li>
+ <p>Run <code>${BUILDDIR}/dist/bin/js </code><code>Y.js</code> and check if appropriate output is printed. (It should say: <code>5! is 120</code>.)</p>
+ </li>
+ <li>
+ <p>Run the main test suite by running <code>./tests/jstests.py ${BUILDDIR}/dist/bin/js</code></p>
+ </li>
+ <li>
+ <p>Run JIT-specific tests by running: <code>./jit-test/jit_test.py ${BUILDDIR}/dist/bin/js</code></p>
+ </li>
+</ul>
+
+<h2 id="Building_SpiderMonkey_1.8_or_earlier">Building SpiderMonkey 1.8 or earlier</h2>
+
+<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">Use these instructions to build SpiderMonkey from an official source release or from the old CVS repository. To build the latest SpiderMonkey sources from Mercurial, see <a href="#Building_SpiderMonkey_tip" style="text-decoration: none; color: rgb(51, 102, 153) !important; cursor: default;">Building SpiderMonkey </a>above.</p>
+
+<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"><a href="/en/SpiderMonkey" style="text-decoration: none; color: rgb(51, 102, 153) !important; cursor: default;" title="en/SpiderMonkey">SpiderMonkey</a> is easy to build from source if you have the usual Mozilla build prerequisites installed. Before you begin, make sure you have right build tools for your computer: <a href="/en/Developer_Guide/Build_Instructions/Linux_Prerequisites" style="text-decoration: none; color: rgb(51, 102, 153) !important; cursor: default;" title="en/Linux_Build_Prerequisites">Linux</a>, <a href="/en/Developer_Guide/Build_Instructions/Windows_Prerequisites" style="text-decoration: none; color: rgb(51, 102, 153) !important; cursor: default;" title="en/Windows_Build_Prerequisites">Windows</a>, <a href="/en/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites" style="text-decoration: none; color: rgb(51, 102, 153) !important; cursor: default;" title="en/Mac_OS_X_Build_Prerequisites">Mac</a>, <a href="/en/Developer_Guide/Build_Instructions" style="text-decoration: none; color: rgb(51, 102, 153) !important; cursor: default;" title="en/Build_Documentation">others</a>.</p>
+
+<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">First, download a SpiderMonkey source distribution, such as <a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/js/js-1.8.0-rc1.tar.gz" style="text-decoration: none; color: rgb(51, 102, 153) !important; cursor: default;">SpiderMonkey 1.8 Release Candidate 1</a>.</p>
+
+<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">To build, use these commands:</p>
+
+<pre class="eval" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 15px; padding-right: 15px; padding-bottom: 15px; padding-left: 15px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; background-clip: initial; background-color: rgb(246, 246, 242); font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace;">tar xvzf js-1.8.0-rc1.tar.gz
+cd js/src
+make -f Makefile.ref
+</pre>
+
+<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">This builds a debug version of SpiderMonkey. All build files are created in a subdirectory named depending on your system (for example,<code style="font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace; color: inherit; font-weight: inherit;">Linux_All_DBG.OBJ</code> if you are on Linux). To install this build on your system, see <a class="external" href="http://ebixio.com/blog/2010/07/31/how-to-install-libjs-spidermonkey/" style="text-decoration: none; color: rgb(51, 102, 153) !important; cursor: default;" title="http://ebixio.com/blog/2010/07/31/how-to-install-libjs-spidermonkey/">SpiderMonkey installation instructions</a>.</p>
+
+<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">To build an optimized (non-debug) version of SpiderMonkey:</p>
+
+<pre class="eval" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 15px; padding-right: 15px; padding-bottom: 15px; padding-left: 15px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; background-clip: initial; background-color: rgb(246, 246, 242); font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace;">make BUILD_OPT=1 -f Makefile.ref</pre>
+
+<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">To build a <a href="/en/SpiderMonkey/JSAPI_Reference/JS_THREADSAFE" style="text-decoration: none; color: rgb(51, 102, 153) !important; cursor: default;" title="JS_THREADSAFE">thread-safe</a> version of SpiderMonkey:</p>
+
+<pre class="eval" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 15px; padding-right: 15px; padding-bottom: 15px; padding-left: 15px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; background-clip: initial; background-color: rgb(246, 246, 242); font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace;">make JS_DIST=/full/path/to/directory/containing/nspr JS_THREADSAFE=1 -f Makefile.ref
+</pre>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/comparision_of_js_engines/index.html b/files/zh-cn/mozilla/projects/spidermonkey/comparision_of_js_engines/index.html
new file mode 100644
index 0000000000..934e38ad7a
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/comparision_of_js_engines/index.html
@@ -0,0 +1,105 @@
+---
+title: JS 引擎比较
+slug: Mozilla/Projects/SpiderMonkey/Comparision_of_JS_engines
+---
+<h2 id="概述">概述</h2>
+<p>本页用来纪录各个开源 JS 引擎(SpiderMonkey、V8、JavaScriptCore)在算法、未来趋势上的比较。除非额外说明,内存相关的数据<strong>假设系统为 32 位</strong>。</p>
+<h2 id="类、函数、词汇比较表">类、函数、词汇比较表</h2>
+<p>为了让懂得其中一个 JS 引擎的程序员迅速了解另外一个引擎,以下整理这些引擎共同概念的实现比较(把鼠标放在类/函数上面可以找到定义该类/函数的文件):</p>
+<h3 id="常见">常见</h3>
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">SpiderMonkey</th>
+ <th scope="col">V8</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><a href="http://hg.mozilla.org/mozilla-central/file/73eefb421e2a/js/public/Value.h#l872" title="public/Value.h:JS::Value"><code>Value</code></a></td>
+ <td><a href="http://code.google.com/p/v8/source/browse/branches/bleeding_edge/src/objects.h?r=19048#930" title="src/objects.h:v8::internal::MaybeObject *"><code style="white-space: nowrap;">MaybeObject *</code></a></td>
+ <td>代表一个 JS 值(数值、字符串、对象……)的类。SpiderMonkey 是用 <a href="http://wingolog.org/archives/2011/05/18/value-representation-in-javascript-implementations">nun-boxing</a>,总是一个 <code>double</code> 的大小(因此在 32 位的系统下,传值需要<a href="http://hg.mozilla.org/mozilla-central/file/73eefb421e2a/js/src/jit/RegisterSets.h#l88">两个 cycle</a>)。V8 是用 <a href="https://github.com/oupengsoftware/v8/wiki/Memory-Layout#wiki-tagged-pointer">tagged pointer</a>,总是一个指针的大小,浮点数存在堆上。<code>MaybeObject</code> 还是很多非 JS 语言对象(代码块等等)的<a href="http://sphinx.oupeng.com/wp-content/uploads/2013/07/v8-class-hierarchy.html">父类</a>。</td>
+ </tr>
+ <tr>
+ <td> <a href="http://hg.mozilla.org/mozilla-central/file/f550b112a19b/js/src/vm/ObjectImpl.h#l685" title="src/vm/ObjectImpl.h:js::ObjectImpl"><code>ObjectImpl</code></a></td>
+ <td><a href="http://code.google.com/p/v8/source/browse/branches/bleeding_edge/src/objects.h?r=19048#2089" title="src/objects.h:v8::internal::JSObject"><code>JSObject</code></a></td>
+ <td>JS 对象(<code>obj instanceof Object</code>)的实现类。SpiderMonkey 与 V8 皆是把部分属性存放在对象行内,部分用外链的一个数组储存的模式。SpiderMonkey 也将小数组的数据存在行内(但是<a href="http://hg.mozilla.org/mozilla-central/file/f550b112a19b/js/src/jsgc.h#l258">不会分两半</a>),而 V8 的 JS 数组对象(貌似)都是将数据存在外链的数组上。在 SpiderMonkey 中,只有在 new space 的 JS 对象的外链数组的空间由虚拟机分配,其他情况的外链数组的空间<a href="http://hg.mozilla.org/mozilla-central/file/f550b112a19b/js/src/gc/Nursery.cpp#l582">由 <code>malloc</code> 分配</a>(因此内存会比较分裂?)。<code>ObjectImpl</code> 除了有连接到 <code>Shape</code> 的指针之外,还有一个链到 <code>TypeObject</code> 的指针:16 B(<code>ObjectImpl</code>)vs. 12 B(<code>JSObject</code>)。在 SpiderMonkey 中,数据用 <code>Value</code> 存,也就是说,对于一个有 <em>k</em> 个行内属性的 JS 对象来说,内存占用是:16 B + <em>k</em> * 8 B(<code>ObjectImpl</code>)vs. 12 B + <em>k</em> * 4 B(<code>JSObject</code>),行外的情形 V8 则会再多用 8 B(<code>FixedArray</code> 的标头)。</td>
+ </tr>
+ <tr>
+ <td><span style="white-space: nowrap;"><a href="http://hg.mozilla.org/mozilla-central/file/f550b112a19b/js/src/vm/Shape.h#l37" title="src/vm/Shape.h:js::Shape"><code>Shape</code></a>、<code><a href="http://hg.mozilla.org/mozilla-central/file/f550b112a19b/js/src/jsinfer.h#l868" title="src/jsinfer.h:js::types::TypeObject">TypeObject</a>、</code><a href="http://hg.mozilla.org/mozilla-central/file/73eefb421e2a/js/public/Class.h#l590" title="public/Class.h::js::Class"><code>Class</code></a></span></td>
+ <td><a href="http://code.google.com/p/v8/source/browse/branches/bleeding_edge/src/objects.h?r=19048#5769" title="src/objects.h:v8::internal::Map"><code>Map</code></a></td>
+ <td>隐藏类的实现类。在 SpiderMonkey 中,属性名存在 <code>Shape</code> 上(因此带有 V8 的 <code>DescriptorArray</code> 的作用),JS 对象的原型存在 <code>TypeObject</code> 上,特殊属性的处理方法存在 <code>Class</code> 上(<code>Class</code> 对象不是 JS 堆里的对象,大部分都共用:<code>JSObject::class_</code>、<code>JSFunction::class_……</code>)。由于 V8 的 <code>Map</code> 有 SM 三个类的作用,因此占用内存也比较多:24 B(<code>Shape</code>)vs. 40 B(<code>Map</code>)。</td>
+ </tr>
+ </tbody>
+</table>
+<h3 id="内存布局与对象创建">内存布局与对象创建</h3>
+<h3 id="运行时">运行时</h3>
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">SpiderMonkey</th>
+ <th scope="col">V8</th>
+ <th scope="col">备注</th>
+ </tr>
+ <tr>
+ <td><code>Interpret</code></td>
+ <td><code style="white-space: nowrap;">(无)</code></td>
+ <td>解释器的主回圈。V8 没有字节码与解释器。</td>
+ </tr>
+ </tbody>
+</table>
+<h3 id="堆与_GC">堆与 GC</h3>
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">SpiderMonkey</th>
+ <th scope="col">V8</th>
+ <th scope="col">备注</th>
+ </tr>
+ <tr>
+ <td><code>Nursery</code></td>
+ <td><code style="white-space: nowrap;">NewSpace</code></td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+<h2 id="调优">调优</h2>
+<p>一个容易调优的 JS 引擎应该具备有以下条件(从重要的到不重要的):</p>
+<ul>
+ <li>能透过 profiler 够找到应用的热点函数(当前内联过的函数是怎么处理的?)。</li>
+ <li>调整各个常量方便。</li>
+ <li>能(透过内置函数扩展等等)得到以下影响性能的数据:
+ <ul>
+ <li>内联缓存(inline cache)中缓存的隐藏类个数。</li>
+ <li>函数运行状态(哪个阶段的 JIT?)与机械码。</li>
+ <li>一个 JS 函数已内联的函数。</li>
+ <li>一个 JS 函数调用运行时 C++ 函数的个数。</li>
+ <li>一段时间中 CPU 运行的指令个数与种类(SpiderMonkey 里有个 <code>PerfMeasurement</code>,这个好用么?)。</li>
+ </ul>
+ </li>
+ <li>能得到 bailout 的原因。</li>
+ <li>代码易读,容易调试。</li>
+</ul>
+<h2 id="参见">参见</h2>
+<ul>
+ <li><a href="http://arewefastyet.com/">ARE WE FAST YET</a> — 每天更新的 JS 引擎性能比较(使用 kraken、sunspider、octane 三个 benchmark)。</li>
+ <li><a href="http://openaphid.github.io/blog/2013/01/17/part-i-how-to-choose-a-javascript-engine-for-ios-and-android-apps/">How to Choose a JavaScript Engine for iOS and Android Development</a> — 不太具有技术分析的文章,不过有一个各类似 Phonegap 的产品用什么 JS 引擎的列表。</li>
+ <li><a href="http://hllvm.group.iteye.com/group/topic/37596">各JavaScript引擎的简介,及相关资料/博客收集帖</a> — R 大经典的整理帖,下面有一个比较高层级的各引擎比较表。</li>
+</ul>
+<p>跟 “JS 引擎” 比较无关,但是中文的 JS 引擎相关的博文也比较少,这里搜集一下:</p>
+<ul>
+ <li><a href="http://hellocompiler.com/">编译路慢慢</a> — SpiderMonkey 相关的比较多。</li>
+</ul>
+<h2 id="代码美观">代码美观</h2>
+<p><em>这件事实在</em><em>不应该是决定使用哪个 JS 引擎的因素,不过……</em></p>
+<p>如果(不幸的)需要以 SpiderMonkey 作为基础调优则会碰到以下问题:</p>
+<ol>
+ <li>C 与 C++ 代码混用。SpiderMonkey 原先是 C 写成的,后来大规模的以 C++ 改进,但是留下了很多残骸:宏、不是宏但是名称是大写的函数。(参见 <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_Reference/JS::Value"><code>JS::Value</code></a> 的说明。)</li>
+ <li>成员变量、方法命名缺乏规则<code>。ObjectImpl::slots</code> 与 <code>ObjectImpl::shape_</code> 同时存在(前面那个应该加底线)。这个或许是可以修复的 bug。</li>
+ <li>混入 JavaScriptCore、V8 代码。SpiderMonkey 的组译器是 JavaScriptCore 的,那些类的成员变量是 <code>m_buffer</code> 等等,又增加了成员变量命名的。另外还有 <code>WTF_*</code> 宏,真是 WTF。再批。妈的,<a href="http://hg.mozilla.org/mozilla-central/file/262e73a6b7cd/js/src/assembler/wtf/Platform.h#l344"><code>WTF_CPU_ARM_THUMB2</code> 跟本不可能为真</a>,这里有大量的死代码(所有代码完全没有用到 <code>JSC::</code><code>MacroAssembler</code>,用到的是 <code>js::jit::</code><code><code>MacroAssembler</code></code>)。另外,</li>
+ <li>混乱的名称空间。</li>
+ <li><code>struct</code>、<code>class</code> 混用。</li>
+ <li>文档命名缺少规则。C 时代的档名是 <code>jsobj.h</code>,C++ 时代的档名是 <code>Value.h</code> 。请自重。</li>
+ <li>过渡滥用宏。</li>
+</ol>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/index.html b/files/zh-cn/mozilla/projects/spidermonkey/index.html
new file mode 100644
index 0000000000..468fafa0cb
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/index.html
@@ -0,0 +1,132 @@
+---
+title: SpiderMonkey
+slug: Mozilla/Projects/SpiderMonkey
+tags:
+ - SpiderMonkey
+ - Update
+translation_of: Mozilla/Projects/SpiderMonkey
+---
+<p><strong>SpiderMonkey</strong> 是Mozilla使用C/C++编写的<a href="/zh-cn/JavaScript" title="zh-cn/JavaScript">JavaScript</a> 引擎。它被用于包括Firefox在内的多个Mozilla产品中,使用的<span class="st">是MPL 2授权协议.</span></p>
+
+<p>独立的源代码版本可以在<a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Projects/SpiderMonkey/Releases">发布页</a>上找到</p>
+
+<table class="topicpage-table">
+ <tbody>
+ <tr>
+ <td>
+ <h3 id="Documentation" name="Documentation">文档</h3>
+
+ <table>
+ <tbody>
+ <tr>
+ <td colspan="2">
+ <h4 id="General">General</h4>
+ </td>
+ </tr>
+ <tr>
+ <td><a href="/zh-CN/docs/Mozilla/Projects/SpiderMonkey/Build_Documentation" title="zh-CN/docs/Mozilla/Projects/SpiderMonkey/Build_Documentation">SpiderMonkey Build Documentation</a></td>
+ <td>如何获取到SpiderMonkey源代码,编译,并运行测试套.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/Introduction_to_the_JavaScript_shell" title="zh-cn/Introduction_to_the_JavaScript_shell">Introduction to the JavaScript shell</a></td>
+ <td>如何获取,构建,并使用JavaScript shell.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/Running_Automated_JavaScript_Tests" title="zh-cn/SpiderMonkey/Running Automated JavaScript Tests">Running Automated JavaScript Tests</a></td>
+ <td>如何运行JavaScript测试套件.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/Creating_JavaScript_tests" title="zh-cn/SpiderMonkey/Creating JavaScript tests">Creating JavaScript tests</a></td>
+ <td>如何为JavaScript测试套件添加测试.</td>
+ </tr>
+ <tr>
+ <td><a class="link-https" href="https://wiki.mozilla.org/JavaScript:New_to_SpiderMonkey" title="https://wiki.mozilla.org/JavaScript:New_to_SpiderMonkey">New to SpiderMonkey</a></td>
+ <td>SpiderMonkey的hacking指南.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/Setting_up_CDT_to_work_on_SpiderMonkey" title="zh-cn/SpiderMonkey/Setting up CDT to work on SpiderMonkey">Setting up CDT to work on SpiderMonkey</a></td>
+ <td>如何配置CDT,使之在SpiderMonkey代码上工作.</td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <h4 id="JSAPI">JSAPI</h4>
+ </td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/JSAPI_User_Guide" title="zh-cn/JSAPI_User_Guide">JSAPI User Guide</a></td>
+ <td>本指南简要介绍了SpiderMonkey,还介绍了如何可以将SpiderMonkey嵌入到你的应用程序中.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/JSAPI_Cookbook" title="zh-cn/SpiderMonkey/JSAPI_Phrasebook">JSAPI Phrasebook</a></td>
+ <td>一些常用的JavaScript表达式和语句的JSAPI翻译.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/JSAPI_Reference" title="zh-cn/SpiderMonkey/JSAPI_Reference">JSAPI Reference</a></td>
+ <td>SpiderMonkey API 参考.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/Bytecodes" title="zh-cn/SpiderMonkey/Bytecodes">Bytecode Reference</a></td>
+ <td>SpiderMonkey 字节码参考.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/JS_Debugger_API_Guide" title="zh-cn/SpiderMonkey/JS Debugger API Guide">JS Debugger API Guide</a></td>
+ <td>在Gecko 8.0中引入的新的JavaScript调试器API{{ geckoRelease("8.0") }}.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/JS_Debugger_API_Reference" title="zh-cn/SpiderMonkey/JS Debugger API Reference">JS Debugger API Reference</a></td>
+ <td>SpiderMonkey 1.8.6(Gecko 8.0 )中引入的<code>Debugger</code>对象的API参考, {{ geckoRelease("8.0") }}.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/JSDBGAPI_Reference" title="zh-cn/JSDBGAPI_Reference">JSDBGAPI Reference</a></td>
+ <td>
+ <p>SpiderMonkey调试API参考;SpiderMonkey 1.8.5之前版本的调试API,<small> </small>虽然它并没有被删除.</p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <h4 id="提示技巧和理念">提示,技巧和理念</h4>
+ </td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/How_to_embed_the_JavaScript_engine" title="zh-cn/How_to_embed_the_JavaScript_engine">How to embed the JavaScript engine</a></td>
+ <td>如何嵌入SpiderMonkey的基础教程</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey_Garbage_Collection_Tips" title="zh-cn/SpiderMonkey_Garbage_Collection_Tips">SpiderMonkey Garbage Collection Tips</a></td>
+ <td>如何避免垃圾回收时出现的问题.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/Internals" title="zh-cn/SpiderMonkey_Internals">SpiderMonkey Internals</a></td>
+ <td><span class="short_text" id="result_box" lang="zh-CN"><span>设计</span><span>概况</span></span>和实现版本介绍</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/Internals/Garbage_collection" title="zh-cn/SpiderMonkey/Internals/GC">SpiderMonkey Internals: GC</a></td>
+ <td>关于垃圾回收的独立的内部文章.</td>
+ </tr>
+ <tr>
+ <td><a href="/zh-cn/SpiderMonkey/Internals/Thread_Safety" title="zh-cn/SpiderMonkey_Internals/Thread_Safety">SpiderMonkey Internals: Thread Safety</a></td>
+ <td>SpiderMonkey的请求模型的内部工作原理.</td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ <td>
+ <h3 id="Related_Topics" name="Related_Topics">相关链接</h3>
+
+ <ul>
+ <li><a href="/zh-cn/JavaScript" title="zh-cn/JavaScript">JavaScript</a></li>
+ <li><a href="/zh-cn/SpiderMonkey/FOSS" title="zh-cn/SpiderMonkey/FOSS">FOSS projects using / based on Spidermonkey</a></li>
+ </ul>
+
+
+ <h3 id="Community" name="Community">社区</h3>
+
+ <p>有问题? <a class="link-irc" href="irc://irc.mozilla.org/jsapi">在IRC上提问!</a></p>
+
+ <p>查看 <a class="external" href="http://infomonkey.cdleary.com/" title="http://infomonkey.cdleary.com/">Infomonkey</a>.</p>
+
+ <p>有bug? <a class="link-https" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&amp;component=JavaScript%20Engine" title="https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&amp;component=JavaScript Engine">提交bug</a> 到 <a class="link-https" href="https://bugzilla.mozilla.org/buglist.cgi?product=Core&amp;component=JavaScript%20Engine&amp;resolution=---&amp;list_id=92318" title="https://bugzilla.mozilla.org/buglist.cgi?product=Core&amp;component=JavaScript Engine&amp;resolution=---&amp;list_id=92318">Core -&gt; JavaScript Engine</a></p>
+ </td>
+ </tr>
+ </tbody>
+</table>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/internals/bytecodes/index.html b/files/zh-cn/mozilla/projects/spidermonkey/internals/bytecodes/index.html
new file mode 100644
index 0000000000..7c47ffb7ae
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/internals/bytecodes/index.html
@@ -0,0 +1,30 @@
+---
+title: 字节码
+slug: Mozilla/Projects/SpiderMonkey/Internals/Bytecodes
+tags:
+ - SpiderMonkey
+translation_of: Mozilla/Projects/SpiderMonkey/Internals/Bytecodes
+---
+<div>{{SpiderMonkeySidebar("Internals")}}</div>
+
+<h2 id="背景知识">背景知识</h2>
+
+<p>SpiderMonkey字节码是JavaScript引擎使用的标准代码表示形式。JavaScript前端根据源文本构建AST,然后根据JSScript数据结构的一部分从AST生成基于堆栈的字节码。字节码可以引用原子和对象(通常通过数组索引),这些原子和对象也包含在JSScript数据结构中。</p>
+
+<p>在引擎内,所有字节码都在堆栈帧内执行。堆栈帧与全局(顶级)代码和<code>eval</code>代码相关联。堆栈上的框架为几个不同类别的JavaScript值(标记值格式)留出空间。单个JavaScript值空间称为“插槽”,类别为:</p>
+
+<ul>
+ <li>参数槽:保存传递给当前框架的实际参数。</li>
+ <li>本地插槽:保存当前代码中使用的本地变量。</li>
+ <li>表达式槽:保存在堆栈上计算表达式所需的临时空间。例如,<code>(a + b) + c</code>会压入a,然后压入b,再压入+,然后压入c,再压入+,依此类推。这需要最多两个表达槽的深度。</li>
+</ul>
+
+<p>还有一些保留给专用功能的插槽,用于处理<code>this</code>和<code>callee</code>返回值。.</p>
+
+<p>总有一个“堆栈顶部”(TOS),它对应于推入表达式堆栈的最新值。所有字节码都根据该位置隐式运行。</p>
+
+<h2 id="字节码列表">字节码列表</h2>
+
+<p>所有操作码都用<code> [-popcount, +pushcount] </code>标注,以表示整个执行的堆栈效果。</p>
+
+<p>字节码列表已移至 <a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/Bytecode" title="SpiderMonkey Internals: Bytecode Descriptions">SpiderMonkey Internals: Bytecode Descriptions</a> 页面。</p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/internals/functions/index.html b/files/zh-cn/mozilla/projects/spidermonkey/internals/functions/index.html
new file mode 100644
index 0000000000..91d96b22eb
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/internals/functions/index.html
@@ -0,0 +1,73 @@
+---
+title: Functions
+slug: Mozilla/Projects/SpiderMonkey/Internals/Functions
+translation_of: Mozilla/Projects/SpiderMonkey/Internals/Functions
+---
+<div>{{SpiderMonkeySidebar("Internals")}}</div>
+
+<p>There are several flavors of JavaScript function. All are <code>JSObject</code>s of the same class, <code>js_FunctionClass</code>.</p>
+
+<p>这里有些Javscript函数,它们属于JSObjects</p>
+
+<p>(But note that objects of other classes can be callable and can even have <code>typeof obj == "function"</code>.)</p>
+
+<p>(也存在其他可被Call的对象)</p>
+
+<h2 id="Script_functions">Script functions</h2>
+
+<p>Functions written in JavaScript and compiled to bytecode. There are four variations that affect how NameExpressions are evaluated. (NameExpressions are basic expressions like <code>String</code> and <code>x</code> that would eat up a huge amount of run time if the engine weren't smart enough to avoid symbol table lookups.)</p>
+
+<p><strong>General closures</strong> are the base case. When the function object is created, its parent is set to the first object on the scope chain. When a name is evaluated that doesn't refer to a local variable, the interpreter consults the scope chain to find the variable. When <code>with</code> or <code>eval</code> are used, we have to do this for correctness.</p>
+
+<p>This is slow, not only because walking the scope chain is a drag, but also because we'd rather avoid actually creating the scope chain at all, if possible. General closures force the interpreter to verify the whole scope chain. So we optimize this when we can.</p>
+
+<p>These optimizations depend on being <em>sure</em> that we will never have to walk the scope chain, so <code>with</code> and <code>eval</code> inhibit them all.</p>
+
+<p><strong>Null closures.</strong> If we can prove at compile time that a function does not refer to any locals or arguments of enclosing functions, it is a null closure. Since it will never need to walk the scope chain, its parent is the global object. This is the best case. Barring <code>with</code> and <code>eval</code>, all outermost functions are null closures.</p>
+
+<p><strong>Null closures with upvars.</strong> A nested function is <em>algol-like</em> if it is only ever defined and called, and it isn't accessed in any other way (and it is not a generator-function). Such a function is guaranteed never to be called again after the enclosing function exits. An algol-like function may read the local variables and arguments of its immediate enclosing function from the stack, as if by magic. (<code>JSContext::display</code> caches the enclosing function's stack frame.) If that function is also algol-like, its child can read locals and variables from the next enclosing function, and so on. The compiler detects these cases and makes such functions null closures too.</p>
+
+<p><strong>Flat closures.</strong> Suppose a function reads some variables from enclosing functions but is not algol-like. If the function does not assign to any closed-on vars/args, and it only reads closed-on local variables and arguments that never change value after the function is created, then the function can be implemented as a flat closure. When a flat closure is created, all the closed-on values are copied from the stack into reserved slots of the function object. To evaluate a name, instead of walking the scope chain, we just take the value from the reserved slot. The function object's parent is the global object.</p>
+
+<p><strong>Flat closures </strong><strong>and Null closures have been <span id="summary_alias_container"><span id="short_desc_nonedit_display">removed</span></span></strong>:</p>
+
+<p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=730497">https://bugzilla.mozilla.org/show_bug.cgi?id=730497</a></p>
+
+<p><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=739808">https://bugzilla.mozilla.org/show_bug.cgi?id=739808</a></p>
+
+<h2 id="Name_lookups">Name lookups</h2>
+
+<p>In order of speed, fastest to slowest.</p>
+
+<ol>
+ <li>
+ <p><code><strong>ARG</strong></code><strong> and <code>LOCAL</code> instructions.</strong> If a name definitely refers to an argument or local variable of the immediately enclosing function, it can be accessed using <code>JSOP_{GET,SET,CALL}</code><code>{ARG,LOCAL}</code> instructions. Some of these can even be fused with other operations into combo instructions like <code>JSOP_GETARGPROP</code>, <code>JSOP_FORLOCAL</code>, and <code>JSOP_INCLOCAL</code>. Because arguments and locals can't be deleted, this optimization is available to all functions, and <code>eval</code> does not interfere with it. But a <code>with</code> block can:</p>
+
+ <pre>function f(s) {
+ eval(s);
+ print(s); // s can be loaded with GETARG
+ with (obj) {
+ print(s); // no GETARG here; s might refer to obj.s
+ }
+}
+</pre>
+ </li>
+ <li>
+ <p><code><strong>UPVAR</strong></code><strong> instructions.</strong> JSOP_{GET,CALL}UPVAR (in algol-like functions only, I think?) TODO</p>
+ </li>
+ <li>
+ <p><code><strong>DSLOT</strong></code><strong> instructions.</strong> JSOP_{GET,CALL}DSLOT (in flat closures only) TODO</p>
+ </li>
+ <li>
+ <p><code><strong>GVAR</strong></code><strong> instructions.</strong> Outside all functions, if a name definitely refers to a global for which we have seen a var, <code>const</code>, or <code>function</code> declaration, then we emit a JS_DEFVAR instruction in the script prelude and access the global using <code>JSOP_{GET,SET,CALL}GVAR</code>. This is fast if the global either doesn't exist before the script runs (the script creates it) or it's a non-configurable data property (which amounts to the same thing). Otherwise the <code>GVAR</code> instructions are as slow as <code>NAME</code> instructions.</p>
+
+ <p>There are also combo instructions <code>JSOP_{INC,DEC}GVAR</code> and <code>JSOP_GVAR{INC,DEC}</code>.</p>
+ </li>
+ <li>
+ <p><code><strong>NAME</strong></code><strong> instructions.</strong> In the worst case we emit <code>JSOP_{,SET,CALL}NAME</code>. These are totally general. They can still be optimized via the property cache; in the worst case we walk the scope chain.</p>
+
+ <p>In some cases, the JIT can optimize a <code>JSOP_NAME</code> instruction that refers to a variable in an enclosing scope to pull the value directly out of the <code>Call</code> object's <code>dslots</code>.</p>
+
+ <p>For the expression <code>delete name</code> we always emit <code>JSOP_DELNAME</code>. It's not worth optimizing.</p>
+ </li>
+</ol>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/internals/index.html b/files/zh-cn/mozilla/projects/spidermonkey/internals/index.html
new file mode 100644
index 0000000000..03228c312f
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/internals/index.html
@@ -0,0 +1,292 @@
+---
+title: SpiderMonkey Internals
+slug: Mozilla/Projects/SpiderMonkey/Internals
+tags:
+ - Guide
+ - JavaScript
+ - NeedsMarkupWork
+ - NeedsTranslation
+ - SpiderMonkey
+ - TopicStub
+translation_of: Mozilla/Projects/SpiderMonkey/Internals
+---
+<h2 id="Design_walk-through" name="Design_walk-through">Design walk-through</h2>
+
+<p>At heart, SpiderMonkey is a fast interpreter that runs an untyped bytecode and operates on values of type <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/Jsval" title="SpiderMonkey/JSAPI_Reference/Jsval">jsval</a></code>—type-tagged double-sized values that represent the full range of JavaScript values. In addition to the interpreter, SpiderMonkey contains a Just-In-Time (JIT) compiler, a garbage collector, code implementing the basic behavior of JavaScript values, a standard library implementing <span class="pl-s1"><span class="pl-s">ECMA 262-3 §</span></span>15 with various extensions, and a few public APIs.</p>
+
+<h3 id="Interpreter">Interpreter</h3>
+
+<p>Like many portable interpreters, SpiderMonkey's interpreter is mainly a single, tremendously long function that steps through the bytecode one instruction at a time, using a <code>switch</code> statement (or faster alternative, depending on the compiler) to jump to the appropriate chunk of code for the current instruction. A JS-to-JS function call pushes a JavaScript stack frame without growing the C stack. But since JS-to-C-to-JS call stacks are common, the interpreter is reentrant.</p>
+
+<p>Some SpiderMonkey bytecode operations have many special cases, depending on the type of their arguments. Common cases are inlined in the interpreter loop, breaking any abstractions that stand in the way. So optimizations such as dense arrays and the property cache are, alas, <em>not</em> transparently tucked away in the <code>jsarray.*</code> and <code>jsobj.*</code> files. Both guest-star in <code>jsinterp.cpp</code> (to thunderous applause from Firefox users).</p>
+
+<p>All state associated with an interpreter instance is passed through formal parameters to the interpreter entry point; most implicit state is collected in a type named <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JSRuntime" title="SpiderMonkey/JSAPI_Reference/JSRuntime">JSContext</a></code>. Therefore, almost all functions in SpiderMonkey, API or not, take a <code>JSContext</code> pointer as their first argument.</p>
+
+<h3 id="Compiler">Compiler</h3>
+
+<p>The compiler consumes JavaScript source code and produces a <em>script</em> which contains bytecode, source annotations, and a pool of string, number, and identifier literals. The script also contains objects, including any functions defined in the source code, each of which has its own, nested script.</p>
+
+<p>The compiler consists of: a random-logic rather than table-driven lexical scanner, a recursive-descent parser that produces an AST, and a tree-walking code generator. Semantic and lexical feedback are used to disambiguate hard cases such as missing semicolons, assignable expressions ("lvalues" in C parlance), and whether <code>/</code> is the division symbol or the start of a regular expression. The compiler attempts no error recovery; it bails out on the first error. The emitter does some constant folding and a few codegen optimizations; about the fanciest thing it does is to attach source notes to the script for the decompiler's benefit.</p>
+
+<p>The decompiler implements <code>Function.toSource()</code>, which reconstructs a function's source code. It translates postfix bytecode into infix source by consulting a separate byte-sized code, called <em>source notes</em>, to disambiguate bytecodes that result from more than one grammatical production.</p>
+
+<h3 id="Garbage_collector">Garbage collector</h3>
+
+<p>The GC is a mark-and-sweep, non-conservative (exact) collector. It is used to hold JS objects and string descriptors (but not property lists or string bytes), and double-precision floating point numbers. It runs automatically only when maxbytes (as passed to <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_NewRuntime" title="SpiderMonkey/JSAPI_Reference/JS_NewRuntime">JS_NewRuntime</a></code>) bytes of GC things have been allocated and another thing-allocation request is made. JS API users should call <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_GC" title="SpiderMonkey/JSAPI_Reference/JS_GC">JS_GC</a></code> or <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_MaybeGC" title="SpiderMonkey/JSAPI_Reference/JS_MaybeGC">JS_MaybeGC</a></code> between script executions or from the <a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_SetBranchCallback" title="SpiderMonkey/JSAPI_Reference/JS_SetBranchCallback">branch callback</a>, as often as necessary.</p>
+
+<p>Because the GC is exact, C/C++ applications must ensure that all live objects, strings, and numbers are GC-reachable. Many techniques are available; see <a href="/en-US/docs/SpiderMonkey_Garbage_Collection_Tips" title="SpiderMonkey_Garbage_Collection_Tips">SpiderMonkey Garbage Collection Tips</a>.</p>
+
+<h3 id="JavaScript_values">JavaScript values</h3>
+
+<p>The type <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/Jsval" title="SpiderMonkey/JSAPI_Reference/Jsval">jsval</a></code> represents a JavaScript value.</p>
+
+<p>The representation is 64 bits and uses NaN-boxing on all platforms, although the exact NaN-boxing format depends on the platform. NaN-boxing is a technique based on the fact that in IEEE-754 there are 2**47 different bit patterns that all represent NaN. Hence, we can encode any floating-point value as a C++ <code>double </code>(noting that JavaScript NaN must be represented as one canonical NaN format). Other values are encoded as a value and a type tag:</p>
+
+<ul>
+ <li>On x86, ARM, and similar 32-bit platforms, we use what we call "nunboxing", in which non-<code>double </code>values are a 32-bit type tag and a 32-bit payload, which is normally either a pointer or a signed 32-bit integer. There are a few special values: <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JSVAL_NULL" title="SpiderMonkey/JSAPI_Reference/JSVAL_NULL">JSVAL_NULL</a></code>, <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JSVAL_VOID" title="SpiderMonkey/JSAPI_Reference/JSVAL_VOID">JSVAL_VOID</a></code> (<code>undefined</code>), <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JSVAL_TRUE" title="SpiderMonkey/JSAPI_Reference/JSVAL_TRUE">JSVAL_TRUE</a></code>, and <code><a href="/en-US/docs/JSVAL_FALSE" title="JSVAL_FALSE">JSVAL_FALSE</a></code>. Another special value, <code><a href="/en-US/docs/JSVAL_HOLE" title="JSVAL_HOLE">JSVAL_HOLE</a></code>, is used internally only (to represent deleted <code>Array</code> elements, for example). This value is never exposed to scripts or even via the JSAPI.</li>
+ <li>On x64 and similar 64-bit platforms, pointers are longer than 32 bits, so we can't use the nunboxing format. Instead, we use "punboxing", which has 17 bits of tag and 47 bits of payload.</li>
+</ul>
+
+<p>Only JIT code really depends on the layout--everything else in the engine interacts with values through functions like <code>JSVAL_IS_INT</code>. Most parts of the JIT also avoid depending directly on the layout: the files <code>PunboxAssembler.h</code> and <code>NunboxAssembler.h</code> are used to generate native code that depends on the value layout.</p>
+
+<p>Objects consist of a possibly shared structural description, called the map or scope; and unshared property values in a vector, called the slots. Each property has an <a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/jsid" title="SpiderMonkey/JSAPI_Reference/jsid">id</a>, either a nonnegative integer or an atom (unique string), with the same tagged-pointer encoding as a <code>jsval</code>.</p>
+
+<p>The atom manager consists of a hash table associating strings uniquely with scanner/parser information such as keyword type, index in script or function literal pool, etc. Atoms play three roles: as literals referred to by unaligned 16-bit immediate bytecode operands, as unique string descriptors for efficient property name hashing, and as members of the root GC set for exact GC.</p>
+
+<h3 id="Standard_library">Standard library</h3>
+
+<p>The methods for arrays, booleans, dates, functions, numbers, and strings are implemented using the JS API. Most are <code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSNative" title="SpiderMonkey/JSAPI_Reference/JSFastNative">JSNative</a></code>s. Most string methods are customized to accept a primitive string as the <code>this</code> argument. (Otherwise, SpiderMonkey converts primitive values to objects before invoking their methods, per <span class="pl-s1"><span class="pl-s">ECMA 262-3 §</span></span>11.2.1.)</p>
+
+<h3 id="Error_handling">Error handling</h3>
+
+<p>SpiderMonkey has two interdependent error-handling systems: JavaScript exceptions (which are <em>not</em> implemented with, or even compatible with, any kind of native C/C++ exception handling) and error reporting. In general, both functions inside SpiderMonkey and JSAPI callback functions signal errors by calling <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_ReportError" title="SpiderMonkey/JSAPI_Reference/JS_ReportError">JS_ReportError</a></code> or one of its variants, or <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_SetPendingException" title="SpiderMonkey/JSAPI_Reference/JS_SetPendingException">JS_SetPendingException</a></code>, and returning <code><a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/JSBool" title="SpiderMonkey/JSAPI_Reference/JSBool">JS_FALSE</a></code> or <code>NULL</code>.</p>
+
+<h3 id="Public_APIs">Public APIs</h3>
+
+<p>The public C/C++ interface, called the JSAPI, is in most places a thin (but source-compatible across versions) layer over the implementation. See the <a href="/en-US/docs/SpiderMonkey/JSAPI_User_Guide" title="JSAPI_User_Guide">JSAPI User Guide</a>. There is an additional public API for JavaScript debuggers, <a href="/en-US/docs/JSDBGAPI_Reference" title="JSDBGAPI_Reference">JSDBGAPI</a>, but {{Source("js/jsd/jsdebug.h")}} might be a better API for debuggers. Another API, <a href="/en-US/docs/JSXDRAPI" title="JSXDRAPI">JSXDRAPI</a>, provides serialization for JavaScript scripts. (XUL Fastload uses this.)</p>
+
+<h3 id="Just-In-Time_compiler">Just-In-Time compiler</h3>
+
+<p>{{jsapi_minversion_inline("1.8.5")}} SpiderMonkey contains a just-in-time compiler, code-named <em>JägerMonkey</em>, that converts bytecode to machine code for faster execution. The JIT works by detecting commonly executed functions or functions containing hot loops and then compiling these methods into machine code.</p>
+
+<p>A second JIT, code-named <em>IonMonkey</em> was enabled in <a href="https://blog.mozilla.org/javascript/2012/09/12/ionmonkey-in-firefox-18/" title="https://blog.mozilla.org/javascript/2012/09/12/ionmonkey-in-firefox-18/">Firefox 18</a>.</p>
+
+<h3 id="Self-hosting_of_builtin_functions_in_JS">Self-hosting of builtin functions in JS</h3>
+
+<p>Starting with Firefox 17, SpiderMonkey has the ability to implement builtin functions in self-hosted JS code. This code is compiled in a special compilation mode that gives it access to functionality that's not normally exposed to JS code, but that's required for safe and specification-conformant implementation of builtin functions.</p>
+
+<p>All self-hosted code lives in <code>.js</code> files under <code>builtin/</code>. For details on implementing self-hosted builtins, see <a href="/en-US/docs/SpiderMonkey/Internals/self-hosting" title="SpiderMonkey/self-hosting">self-hosting</a>.</p>
+
+<h2 id="File_walkthrough" name="File_walkthrough">File walkthrough</h2>
+
+<h4 id="jsapi.cpp.2C_jsapi.h" name="jsapi.cpp.2C_jsapi.h">jsapi.cpp, jsapi.h</h4>
+
+<p>The public API to be used by almost all client code.</p>
+
+<h4 id="jspubtd.h.2C_jsprvtd.h" name="jspubtd.h.2C_jsprvtd.h">jspubtd.h, jsprvtd.h</h4>
+
+<p>These files exist to group struct and scalar typedefs so they can be used everywhere without dragging in struct definitions from N different files. The <code>jspubtd.h</code> file contains public typedefs, and is included automatically when needed. The <code>jsprvtd.h</code> file contains private typedefs and is included by various .h files that need type names, but not type sizes or declarations.</p>
+
+<h4 id="jsdbgapi.cpp.2C_jsdbgapi.h" name="jsdbgapi.cpp.2C_jsdbgapi.h">jsdbgapi.cpp, jsdbgapi.h</h4>
+
+<p>The debugging API. Provided so far:</p>
+
+<p><strong>Traps</strong>, with which breakpoints, single-stepping, step over, step out, and so on can be implemented. The debugger will have to consult jsopcode.def on its own to figure out where to plant trap instructions to implement functions like step out, but a future jsdbgapi.h will provide convenience interfaces to do these things. At most one trap per bytecode can be set. When a script (<code><a href="/en-US/docs/JSScript" title="JSScript">JSScript</a></code>) is destroyed, all traps set in its bytecode are cleared.</p>
+
+<p><strong>Watchpoints</strong>, for intercepting set operations on properties and running a debugger-supplied function that receives the old value and a pointer to the new one, which it can use to modify the new value being set.</p>
+
+<p><strong>Line number</strong> to PC and back mapping functions. The line-to-PC direction "rounds" toward the next bytecode generated from a line greater than or equal to the input line, and may return the PC of a for-loop update part, if given the line number of the loop body's closing brace. Any line after the last one in a script or function maps to a PC one byte beyond the last bytecode in the script. An example, from perfect.js:</p>
+
+<pre class="brush:js;first-line:14">function perfect(n) {
+ print("The perfect numbers up to " + n + " are:");
+ // We build sumOfDivisors[i] to hold a string expression for
+ // the sum of the divisors of i, excluding i itself.
+ var sumOfDivisors = new ExprArray(n+1,1);
+ for (var divisor = 2; divisor &lt;= n; divisor++) {
+ for (var j = divisor + divisor; j &lt;= n; j += divisor) {
+ sumOfDivisors[j] += " + " + divisor;
+ }
+ // At this point everything up to 'divisor' has its sumOfDivisors
+ // expression calculated, so we can determine whether it's perfect
+ // already by evaluating.
+ if (eval(sumOfDivisors[divisor]) == divisor) {
+ print("" + divisor + " = " + sumOfDivisors[divisor]);
+ }
+ }
+ delete sumOfDivisors;
+ print("That's all.");
+}</pre>
+
+<p>The line number to PC and back mappings can be tested using the js program with the following script:</p>
+
+<pre class="brush:js">load("perfect.js");
+print(perfect);
+dis(perfect);
+print();
+for (var ln = 0; ln &lt;= 40; ln++) {
+ var pc = line2pc(perfect, ln);
+ var ln2 = pc2line(perfect, pc);
+ print("\tline " + ln + " =&gt; pc " + pc + " =&gt; line " + ln2);
+}
+</pre>
+
+<p>The result of the for loop over lines 0 to 40 inclusive is:</p>
+
+<pre>line 0 =&gt; pc 0 =&gt; line 16
+line 1 =&gt; pc 0 =&gt; line 16
+line 2 =&gt; pc 0 =&gt; line 16
+line 3 =&gt; pc 0 =&gt; line 16
+line 4 =&gt; pc 0 =&gt; line 16
+line 5 =&gt; pc 0 =&gt; line 16
+line 6 =&gt; pc 0 =&gt; line 16
+line 7 =&gt; pc 0 =&gt; line 16
+line 8 =&gt; pc 0 =&gt; line 16
+line 9 =&gt; pc 0 =&gt; line 16
+line 10 =&gt; pc 0 =&gt; line 16
+line 11 =&gt; pc 0 =&gt; line 16
+line 12 =&gt; pc 0 =&gt; line 16
+line 13 =&gt; pc 0 =&gt; line 16
+line 14 =&gt; pc 0 =&gt; line 16
+line 15 =&gt; pc 0 =&gt; line 16
+line 16 =&gt; pc 0 =&gt; line 16
+line 17 =&gt; pc 19 =&gt; line 20
+line 18 =&gt; pc 19 =&gt; line 20
+line 19 =&gt; pc 19 =&gt; line 20
+line 20 =&gt; pc 19 =&gt; line 20
+line 21 =&gt; pc 36 =&gt; line 21
+line 22 =&gt; pc 53 =&gt; line 22
+line 23 =&gt; pc 74 =&gt; line 23
+line 24 =&gt; pc 92 =&gt; line 22
+line 25 =&gt; pc 106 =&gt; line 28
+line 26 =&gt; pc 106 =&gt; line 28
+line 27 =&gt; pc 106 =&gt; line 28
+line 28 =&gt; pc 106 =&gt; line 28
+line 29 =&gt; pc 127 =&gt; line 29
+line 30 =&gt; pc 154 =&gt; line 21
+line 31 =&gt; pc 154 =&gt; line 21
+line 32 =&gt; pc 161 =&gt; line 32
+line 33 =&gt; pc 172 =&gt; line 33
+line 34 =&gt; pc 172 =&gt; line 33
+line 35 =&gt; pc 172 =&gt; line 33
+line 36 =&gt; pc 172 =&gt; line 33
+line 37 =&gt; pc 172 =&gt; line 33
+line 38 =&gt; pc 172 =&gt; line 33
+line 39 =&gt; pc 172 =&gt; line 33
+line 40 =&gt; pc 172 =&gt; line 33
+</pre>
+
+<h4 id="jsconfig.h" name="jsconfig.h">jsconfig.h</h4>
+
+<p>Various configuration macros defined as 0 or 1 depending on how <code><a href="/en-US/docs/JS_VERSION" title="JS_VERSION">JS_VERSION</a></code> is defined (as 10 for JavaScript 1.0, 11 for JavaScript 1.1, etc.). Not all macros are tested around related code yet. In particular, JS 1.0 support is missing from SpiderMonkey.</p>
+
+<h4 id="js.cpp.2C_jsshell.msg" name="js.cpp.2C_jsshell.msg">js.cpp, jsshell.msg</h4>
+
+<p>The "JS shell", a simple interpreter program that uses the JS API and more than a few internal interfaces (some of these internal interfaces could be replaced by <code>jsapi.h</code> calls). The js program built from this source provides a test vehicle for evaluating scripts and calling functions, trying out new debugger primitives, etc.</p>
+
+<p>A look at the places where <code>jsshell.msg</code> is used in <code>js.cpp</code> shows how error messages can be handled in JSAPI applications. These messages can be localized at compile time by replacing the <code>.msg</code> file; or, with a little modification to the source, at run time.</p>
+
+<p><a href="/en-US/docs/SpiderMonkey/Introduction_to_the_JavaScript_shell" title="https://developer.mozilla.org/en/introduction_to_the_javascript_shell">More information on the JavaScript shell</a>.</p>
+
+<h4 id="js.msg" name="js.msg">js.msg</h4>
+
+<p>SpiderMonkey error messages.</p>
+
+<h4 id="jsarray..2A.2C_jsbool..2A.2C_jdsdate..2A.2C_jsfun..2A.2C_jsmath..2A.2C_jsnum..2A.2C_jsstr..2A" name="jsarray..2A.2C_jsbool..2A.2C_jdsdate..2A.2C_jsfun..2A.2C_jsmath..2A.2C_jsnum..2A.2C_jsstr..2A">jsarray.*, jsbool.*, jsdate.*, jsfun.*, jsmath.*, jsnum.*, jsstr.*</h4>
+
+<p>These file pairs implement the standard classes and (where they exist) their underlying primitive types. They have similar structure, generally starting with class definitions and continuing with internal constructors, finalizers, and helper functions.</p>
+
+<h4 id="jsobj..2A.2C_jsscope..2A" name="jsobj..2A.2C_jsscope..2A">jsobj.*, jsscope.*</h4>
+
+<p>These two pairs declare and implement the JS object system. All of the following happen here:</p>
+
+<ul>
+ <li>creating objects by class and prototype, and finalizing objects;</li>
+ <li>defining, looking up, getting, setting, and deleting properties;</li>
+ <li>creating and destroying properties and binding names to them.</li>
+</ul>
+
+<p>The details of a native object's map (scope) are mostly hidden in <code>jsscope.{{mediawiki.external('ch')}}</code>.</p>
+
+<h4 id="jsatom.cpp.2C_jsatom.h" name="jsatom.cpp.2C_jsatom.h">jsatom.cpp, jsatom.h</h4>
+
+<p>The atom manager. Contains well-known string constants, their atoms, the global atom hash table and related state, the js_Atomize() function that turns a counted string of bytes into an atom, and literal pool (<code>JSAtomMap</code>) methods.</p>
+
+<h4 id="jsarena.cpp.2C_jsarena.h" name="jsarena.cpp.2C_jsarena.h">jsarena.cpp, jsarena.h</h4>
+
+<p>Last-In-First-Out allocation macros that amortize malloc costs and allow for en-masse freeing. See the paper mentioned in <code>jsarena.h</code>'s major comment.</p>
+
+<h4 id="jsgc.cpp.2C_jsgc.h" name="jsgc.cpp.2C_jsgc.h">jsgc.cpp, jsgc.h</h4>
+
+<p>The garbage collector and tracing routines.</p>
+
+<h4 id="jsinterp..2A.2C_jscntxt..2A.2C_jsinvoke.cpp" name="jsinterp..2A.2C_jscntxt..2A.2C_jsinvoke.cpp">jsinterp.*, jscntxt.*, jsinvoke.cpp</h4>
+
+<p>The bytecode interpreter, and related functions such as Call and AllocStack, live in <em>jsinterp.cpp</em>. The JSContext constructor and destructor are factored out into <em>jscntxt.cpp</em> for minimal linking when the compiler part of JS is split from the interpreter part into a separate program.</p>
+
+<p><code>jsinvoke.cpp</code> is a build hack used on some platforms to build <code>js_Interpret</code> under different compiler options from the rest of <code>jsinterp.cpp</code>.</p>
+
+<h4 id="jstracer.*_nanojit*">jstracer.*, nanojit/*</h4>
+
+<p><a href="/en-US/docs/SpiderMonkey/Internals/Tracing_JIT" title="SpiderMonkey/Internals/Tracing JIT">The tracing JIT</a>. The interface between the JIT and the rest of SpiderMonkey is conceptually small—the interpreter calls into the trace recorder—but as with everything else, there are tendrils everywhere.</p>
+
+<h4 id="jsemit..2A.2C_jsopcode.tbl.2C_jsopcode..2A.2C_jsparse..2A.2C_jsscan..2A.2C_jsscript..2A" name="jsemit..2A.2C_jsopcode.tbl.2C_jsopcode..2A.2C_jsparse..2A.2C_jsscan..2A.2C_jsscript..2A">jsemit.*, jsopcode.tbl, jsopcode.*, jsparse.*, jsscan.*, jsscript.*</h4>
+
+<p>Compiler and decompiler modules. The <em>jsopcode.tbl</em> file is a C preprocessor source that defines almost everything there is to know about JS bytecodes. See its major comment for how to use it. For now, a debugger will use it and its dependents such as <em>jsopcode.h</em> directly, but over time we intend to extend <em>jsdbgapi.h</em> to hide uninteresting details and provide conveniences. The code generator is split across paragraphs of code in <em>jsparse.cpp</em>, and the utility methods called on <code>JSCodeGenerator</code> appear in <em>jsemit.cpp</em>. Source notes generated by <em>jsparse.cpp</em> and <em>jsemit.cpp</em> are used in <em>jsscript.cpp</em> to map line number to program counter and back.</p>
+
+<h4 id="jstypes.h" name="jstypes.h">jstypes.h</h4>
+
+<p>Fundamental representation types and utility macros. This file alone among all .h files in SpiderMonkey must be included first by .cpp files. It is not nested in .h files, as other prerequisite .h files generally are, since it is also a direct dependency of most .cpp files and would be over-included if nested in addition to being directly included.</p>
+
+<h4 id="jsbit.h.2C_jslog2.cpp" name="jsbit.h.2C_jslog2.cpp">jsbit.h, jslog2.cpp</h4>
+
+<p>Bit-twiddling routines. Most of the work here is selectively enabling compiler-specific intrinsics such as GCC's <code>__builtin_ctz</code>, which is useful in calculating base-2 logarithms of integers.</p>
+
+<h4 id="jsutil.cpp.2C_jsutil.h" name="jsutil.cpp.2C_jsutil.h">jsutil.cpp, jsutil.h</h4>
+
+<p>The <code>JS_ASSERT</code> macro is used throughout the source as a proof device to make invariants and preconditions clear to the reader, and to hold the line during maintenance and evolution against regressions or violations of assumptions that it would be too expensive to test unconditionally at run-time. Certain assertions are followed by run-time tests that cope with assertion failure, but only where I'm too smart or paranoid to believe the assertion will never fail...</p>
+
+<h4 id="jsclist.h" name="jsclist.h">jsclist.h</h4>
+
+<p>Doubly-linked circular list struct and macros.</p>
+
+<h4 id="jscpucfg.cpp" name="jscpucfg.cpp">jscpucfg.cpp</h4>
+
+<p>This standalone program generates <em>jscpucfg.h</em>, a header file containing bytes per word and other constants that depend on CPU architecture and C compiler type model. It tries to discover most of these constants by running its own experiments on the build host, so if you are cross-compiling, beware.</p>
+
+<h4 id="jsdtoa.cpp.2C_jsdtoa.h.2C_dtoa.c" name="jsdtoa.cpp.2C_jsdtoa.h.2C_dtoa.c">jsdtoa.cpp, jsdtoa.h, dtoa.c</h4>
+
+<p>dtoa.c contains David Gay's portable double-precision floating point to string conversion code, with Permission To Use notice included. jsdtoa.cpp <code>#include</code>s this file.</p>
+
+<h4 id="jshash.cpp.2C_jshash.h.2C_jsdhash.cpp.2C_jsdhash.h" name="jshash.cpp.2C_jshash.h.2C_jsdhash.cpp.2C_jsdhash.h">jshash.cpp, jshash.h, jsdhash.cpp, jsdhash.h</h4>
+
+<p>Portable, extensible hash tables. These use multiplicative hash for strength reduction over division hash, yet with very good key distribution over power of two table sizes. jshash resolves collisions via chaining, so each entry burns a malloc and can fragment the heap. jsdhash uses open addressing.</p>
+
+<h4 id="jslong.cpp.2C_jslong.h" name="jslong.cpp.2C_jslong.h">jslong.cpp, jslong.h</h4>
+
+<p>64-bit integer emulation, and compatible macros that use intrinsic C types, like <code>long long</code>, on platforms where they exist (most everywhere, these days).</p>
+
+<h4 id="jsprf..2A" name="jsprf..2A">jsprf.*</h4>
+
+<p>Portable, buffer-overrun-resistant sprintf and friends. For no good reason save lack of time, the %e, %f, and %g formats cause your system's native sprintf, rather than <code>JS_dtoa()</code>, to be used. This bug doesn't affect SpiderMonkey, because it uses its own <code>JS_dtoa()</code> call in <code>jsnum.cpp</code> to convert from double to string, but it's a bug that we'll fix later, and one you should be aware of if you intend to use a <code>JS_*printf()</code> function with your own floating type arguments - various vendor sprintf's mishandle NaN, +/-Inf, and some even print normal floating values inaccurately.</p>
+
+<h4 id="prmjtime.c.2C_prmjtime.h" name="prmjtime.c.2C_prmjtime.h">prmjtime.c, prmjtime.h</h4>
+
+<p>Time functions. These interfaces are named in a way that makes local vs. universal time confusion likely. Caveat emptor, and we're working on it. To make matters worse, Java (and therefore JavaScript) uses "local" time numbers (offsets from the epoch) in its Date class.</p>
+
+<h4 id="jsfile.cpp.2C_jsfile.h.2C_jsfile.msg" name="jsfile.cpp.2C_jsfile.h.2C_jsfile.msg">jsfile.cpp, jsfile.h, jsfile.msg</h4>
+
+<p>Obsolete. Do not use these files.</p>
+
+<h4 id="Makefile.in.2C_build.mk" name="Makefile.in.2C_build.mk">Makefile.in, build.mk</h4>
+
+<p>Mozilla makefiles. If you're building Gecko or Firefox, the larger build system will use these files. They are also used for current standalone builds.</p>
+
+<h4 id="Makefile.ref.2C_rules.mk.2C_config.mk.2C_config.2F.2A" name="Makefile.ref.2C_rules.mk.2C_config.mk.2C_config.2F.2A">Makefile.ref, rules.mk, config.mk, config/*</h4>
+
+<p>Obsolete SpiderMonkey standalone makefiles from 1.8 and earlier. See <a href="/en-US/docs/SpiderMonkey/Build_Documentation#Building_SpiderMonkey_1.8_or_earlier" title="SpiderMonkey/Build Documentation#Building SpiderMonkey 1.8 or earlier">SpiderMonkey Build Documentation</a>.</p>
+
+<h3 id="See_also">See also</h3>
+
+<ul>
+ <li><a href="/jsd" title="jsd">jsd</a></li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/introduction_to_the_javascript_shell/index.html b/files/zh-cn/mozilla/projects/spidermonkey/introduction_to_the_javascript_shell/index.html
new file mode 100644
index 0000000000..b570b78d56
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/introduction_to_the_javascript_shell/index.html
@@ -0,0 +1,382 @@
+---
+title: JavaScript shell 介绍
+slug: Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell
+tags:
+ - SpiderMonkey
+ - 蜘蛛猴
+translation_of: Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell
+---
+<div>{{SpiderMonkeySidebar("General")}}</div>
+
+<div class="summary">
+<p>JavaScript shell 是一个命令行程序,它被包含在<a href="/en-US/docs/Mozilla/Projects/SpiderMonkey" title="en/SpiderMonkey">SpiderMonkey</a>源代码中。它在 JavaScript 中类似于 Python 命令行、Lisp 读取执行循环和 Ruby 中的 <code>irb</code> 。这篇文章解释如何使用 shell 去测试 JavaScript 代码和执行 JavaScript 程序。</p>
+</div>
+
+<p>要获取 SpiderMonkey JavaScript shell, 请参见 <a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Build_Documentation">SpiderMonkey 构建文档</a> 或根据你的平台从 <a class="external" href="https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/" title="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/">Nightly Builds</a> 下载二进制文件。</p>
+
+<p>对于其他的 JavaScript shells, 参考 <a class="internal" href="/en-US/docs/Web/JavaScript/Shells" title="En/JavaScript shells">JavaScript shells</a>.</p>
+
+<div class="note">
+<p>注意: <span class="tlid-translation translation" lang="zh-CN"><span title="">从 SpiderMonkey 44 开始,默认情况下使用标准的、与 Web 兼容的 JavaScript 版本(不再使用JS1.7 +)。</span> <span title="">内置的</span></span> <code>version()</code> <span class="tlid-translation translation" lang="zh-CN"><span title=""> 内置函数仍然可以用来测试遗留功能。</span></span></p>
+</div>
+
+<h2 id="Using_the_JavaScript_shell" name="Using_the_JavaScript_shell">执行JavaScript shell</h2>
+
+<p>jsshell 提供两种操作模式。你既可以交互式操作 shell, 在此模式你可以输入JavaScript 代码并执行。便于实验和测试新特性。你也可以在命令行参数指定一个 JavaScript 代码文件,此文件会自动运行。</p>
+
+<p>在安装 jsshell 之后,你可以执行以下命令打开交互式终端:</p>
+
+<pre class="eval notranslate">js
+</pre>
+
+<div class="blockIndicator note">
+<p><strong>注意</strong>:如果你在预编译程序执行中遇到<br>
+ <code>"symbol lookup error: ./js: undefined symbol: PR_SetCurrentThreadName"</code><br>
+ 这样的错误, 请尝试用 run-mozilla.sh 文件执行它:<br>
+ <code>run-mozilla.sh ./js</code>  <br>
+ ——我测试过有效</p>
+</div>
+
+<p>如果运行 <code>foo.js</code> file中的JavaScript代码,你可以使用以下命令:</p>
+
+<pre class="eval notranslate">js foo.js
+</pre>
+
+<p>如果想运行 <code>foo.js</code> 然后进入交互模式:</p>
+
+<pre class="eval notranslate">js -f foo.js -i
+</pre>
+
+<h2 id="说明">说明</h2>
+
+<div class="note"><strong>注意:</strong> 因为JavaScript shell 用来给 JavaScript 引擎做测试环境, 可用的选项和内置函数可能改变。</div>
+
+<h3 id="Command_line_options" name="Command_line_options">命令行选项</h3>
+
+<p>有许多命令行选项可以控制shell,以下为总结。使用<strong>-h</strong>选项显示帮助</p>
+
+<dl>
+ <dt><code>-c, --compileonly</code></dt>
+ <dd>仅编译不执行代码,这是一种方便的检查语法错误的方式。</dd>
+ <dt><code>-e <em>script</em></code></dt>
+ <dd>运行指定脚本,<code><em>script</em></code> 是将要执行的代码字符串。</dd>
+ <dt><code>-f <em>filename</em></code></dt>
+ <dd>执行指定的代码文件。</dd>
+ <dt><code>-i</code></dt>
+ <dd>启用交互模式。(如果参数中没有文件名这个选项默认打开)</dd>
+ <dt><code>--no-ion</code></dt>
+ <dd>禁用优化的 JIT 编译器。</dd>
+ <dt><code>--no-baseline</code></dt>
+ <dd>禁用基准的 JIT 编译器。</dd>
+ <dt><code>-P</code></dt>
+ <dd>如果文件的第一行是 "/usr/bin/env js -P",文件内容将通过 JavaScript 引擎解释执行。</dd>
+ <dd>这将允许你在 unix 和 OS X 系统上执行 JavaScript 文件。</dd>
+ <dt><code>-s</code></dt>
+ <dd>启用严格警告模式.</dd>
+ <dt><code>-w, --warnings</code></dt>
+ <dd>显示警告消息.</dd>
+ <dt><code>-W</code>, --nowarnings</dt>
+ <dd>隐藏警告消息.</dd>
+</dl>
+
+<h3 id="Environment_options" name="Environment_options">环境选项</h3>
+
+<p>如果设置了这些环境变量,它们将会影响 js shell 的行为。</p>
+
+<dl>
+ <dt><code>JS_STDOUT=<em>file</em></code></dt>
+ <dd>将标准输出重定向到文件<code><em>file</em></code>。</dd>
+ <dt><code>JS_STDERR=<em>file</em></code></dt>
+ <dd>将标准输入重定向到文件<code><em>file</em></code>。</dd>
+</dl>
+
+<h3 id="Built-in_functions" name="Built-in_functions">内置函数</h3>
+
+<p>为了使 JavaScript shell 更加实用, 我们提供了一些内置的函数供 JavaScript 程序(包括交互模式下)使用。</p>
+
+<div class="warning">
+<p><strong>注意</strong>:这个列表是不完整的而且与 <a href="/en-US/docs/SpiderMonkey/Shell_global_objects">Shell 全局对象</a> 重复。请参见{{Source("js/src/shell/js.cpp")}} (在 <code>shell_functions</code> 附近) 以获取详细信息。</p>
+</div>
+
+<h4 id="build.28.29" name="build.28.29"><code>build()</code></h4>
+
+<p>返回 JavaScript shell 构建的日期和时间.</p>
+
+<div class="note"><strong>Note:</strong> <code>clear()</code> 函数如果不带任何参数,将清除包括所有内置方法在内的所有东西。</div>
+
+<h4 id="clone.28function.2C_.5Bscope.5D.29" name="clone.28function.2C_.5Bscope.5D.29"><code>clone(<em>function, [scope]</em>)</code></h4>
+
+<p>克隆指定函数对象。如果未指定具体域,新对象的父本和原始对象的相同。否则,新对象被放置于指定域。</p>
+
+<h4 id="countHeap" name="countHeap"><code>countHeap(<em>[start[, kind]]</em>)</code></h4>
+
+<p>{{ jsapi_minversion_inline("1.8") }}   <span class="tlid-translation translation" lang="zh-CN"><span title="">计算堆中活动的回收垃圾数量,或计算给定且不为 null 的可从 </span></span><code><em>start</em></code><span class="tlid-translation translation" lang="zh-CN"><span title=""> 到达的对象的数量。</span></span><code><em>kind</em></code><span class="tlid-translation translation" lang="zh-CN"><span title=""> 是“all”(默认)以计算所有事物,或者是“ object”,“ double”,“ string”,“ function”,“ qname”,“ namespace”,“ xml”之一以仅计算此类事物</span> <span title="">。</span></span></p>
+
+<h4 id="evalcx.28string.5B.2C_object.5D.29" name="evalcx.28string.5B.2C_object.5D.29"><code>dumpHeap(<em>[fileName[, start[, toFind[, maxDepth[, toIgnore]]]]]</em>)</code></h4>
+
+<p>{{ jsapi_minversion_inline("1.8") }} 转储所有现存对象的数据 (或有关联的子数据) 到文件。详情参见本函数的C/C++版本: <code>JS_DumpHeap</code>.</p>
+
+<h4 id="evalcx.28string.5B.2C_object.5D.29" name="evalcx.28string.5B.2C_object.5D.29"><code>evalcx(<em>string[, object]</em>)</code></h4>
+
+<p>执行 <code><em>string</em></code> 中的 JavaScript 代码。如果设置了参数 <code><em>object</em></code>,代码将在这个对象中执行,将其视为一个沙盒。</p>
+
+<p><code><em>string</em></code> 为空且没有设置 <code><em>object</em></code> 时,<code>evalcx()</code> 将会<span class="tlid-translation translation" lang="zh-CN"><span title="">返回一个具有“</span></span>eager”<span class="tlid-translation translation" lang="zh-CN"><span title=""> 标准类的新对象</span></span>。</p>
+
+<p><code><em>string</em></code> 为 "lazy" 且没有设置 <code><em>object</em></code> 时,<code>evalcx()</code> 将会<span class="tlid-translation translation" lang="zh-CN"><span title="">返回一个具有“</span></span>lazy”<span class="tlid-translation translation" lang="zh-CN"><span title=""> 标准类的新对象</span></span>。</p>
+
+<div class="note"><strong>注意:</strong> <code>evalcx()</code> 仅对进行 JavaScript 引擎极低层工作的开发者有用,用于在 shell 中测试类<code>evalInSandbox</code> 环境</div>
+
+<h4 id="gc.28.29" name="gc.28.29"><code>gc()</code></h4>
+
+<p>运行垃圾收集器释放内存。</p>
+
+<h4 id="gcparam.28.29" name="gcparam.28.29"><code>gcparam(<em>name[, value]</em>)</code></h4>
+
+<p>{{ jsapi_minversion_inline("1.8") }} 读取或配置垃圾收集器参数。</p>
+
+<p>名称必须是参数key之一 (例如 <code>'maxBytes'</code>, <code>'maxMallocBytes'</code> 或<code>'gcNumber</code>').</p>
+
+<p>如果value未指定,<code>gcparam()</code>返回与GC参数名name相关联的当前值</p>
+
+<p>如果value被指定,其必须可转换为uint32,<code>gcparam()</code>将GC参数名设置为value。</p>
+
+<p>For more information, see the C/C++ functions  <a class="internal" href="/En/SpiderMonkey/JSAPI_Reference/JS_GetGCParameter" title="en/SpiderMonkey/JSAPI Reference/JS GetGCParameter"><code>JS_SetGCParameter</code></a> and <a class="internal" href="/En/SpiderMonkey/JSAPI_Reference/JS_SetGCParameter" title="en/SpiderMonkey/JSAPI Reference/JS SetGCParameter"><code>JS_SetGCParameter</code></a>.</p>
+
+<h4 id="gczeal.28.29" name="gczeal.28.29"><code>gczeal(level)</code></h4>
+
+<p>{{ jsapi_minversion_inline("1.8") }} <code>DEBUG</code> only. 设置GC zeal级别, 这是一个调试特性。0 是正常的周期性垃圾收集,1是频繁的GC, 2是及其频繁的GC. 除了0以外的都将使JavaScript运行极其缓慢但是可能有助于发现GC相关的 bug. For more information, see the C/C++ version of this function, <a class="internal" href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCZeal" title="en/SpiderMonkey/JSAPI Reference/JS SetGCZeal"><code>JS_SetGCZeal</code></a>.</p>
+
+<h4 id="getpda.28object.29" name="getpda.28object.29"><code>getpda(<em>object</em>)</code></h4>
+
+<p>返回指定对象的属性描述</p>
+
+<h4 id="getslx.28object.29" name="getslx.28object.29"><code>getslx(<em>object</em>)</code></h4>
+
+<p>返回脚本行范围,这是包含指定对象的代码行数</p>
+
+<h4 id="help.28.5Bcommand_....5D.29" name="help.28.5Bcommand_....5D.29"><code>help(<em>[command ...]</em>)</code></h4>
+
+<p><span class="tlid-translation translation" lang="zh-CN"><span title="">显示有关指定命令或所有可用功能的简要帮助信息(如果未指定命令将显示所有帮助信息)。</span></span></p>
+
+<h4 id="intern.28string.29" name="intern.28string.29"><code>intern(<em>string</em>)</code></h4>
+
+<p>将指定的字符串 内化到atom表中。每个字符串都有一个唯一的标识符,称为atom。这个系统使得对字符串进行比较变得更加容易。</p>
+
+<div class="note"><strong>Note:</strong> This function is intended only for use when testing the JavaScript engine.</div>
+
+<h4 id="line2pc.28.5Bfunction.2C_.5D_line.29" name="line2pc.28.5Bfunction.2C_.5D_line.29"><code>line2pc(<em>[function, ] line</em>)</code></h4>
+
+<p>返回对应于指定行的代码行的程序计数器值。如果指定了函数,那么行就是指定函数的偏移量.</p>
+
+<h4 id="load.28filename1_.5Bfilename.5D.29" name="load.28filename1_.5Bfilename.5D.29"><code>load(<em>filename1</em> <em>[filename]</em>)</code></h4>
+
+<p>加载带有指定名称的JavaScript文件.</p>
+
+<div class="note"><strong>Note:</strong> For loading non-JavaScript files, use <code>read()</code>.</div>
+
+<h4 id="options.28.5Boption_....5D.29" name="options.28.5Boption_....5D.29"><code>options(<em>[option ...]</em>)</code></h4>
+
+<p>让你设置或获取选项。如果您在命令行上指定选项,那么调用<code>options的</code>结果将指示您所请求的选项。您还可以传递新的选项来设置.</p>
+
+<p>The available options are:</p>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <td class="header">Option Name</td>
+ <td class="header">Description</td>
+ </tr>
+ <tr>
+ <td><code>strict</code></td>
+ <td>严格模式 is enabled.</td>
+ </tr>
+ <tr>
+ <td><code>werror</code></td>
+ <td>Warnings should be treated as errors.</td>
+ </tr>
+ <tr>
+ <td><code>atline</code></td>
+ <td>When <code>atline</code> is enabled, 表单的注释 <code>//@line <em>num</em></code> set the number of the following line to <code><em>num</em></code>.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h4 id="pc2line.28function.2C_.5Bpc.5D.29" name="pc2line.28function.2C_.5Bpc.5D.29"><code>pc2line(<em>function, [pc]</em>)</code></h4>
+
+<p>返回对应于指定函数的第一行的JavaScript代码的行号. If you specify a program counter offset into the function, the line number of the line of code containing that offset is returned.</p>
+
+<h4 id="print.28.5Bexpression_....5D.29" name="print.28.5Bexpression_....5D.29"><code>print(<em>[expression ...]</em>)</code></h4>
+
+<p>Evaluates the <em>expression(s)</em> and displays the result(s) on <code>stdout</code>, 分隔 by spaces (" ") and 终止 by a newline ("\n").</p>
+
+<h4 id="print.28.5Bexpression_....5D.29" name="print.28.5Bexpression_....5D.29"><code>putstr(<em>expression</em>)</code></h4>
+
+<p>Evaluates the <em>expression</em> and displays the result on <code>stdout</code>.</p>
+
+<h4 id="quit.28.29" name="quit.28.29"><code>quit(<em>[status]</em>)</code></h4>
+
+<p>Exits the shell. 如果省略,状态默认为0。</p>
+
+<h4 id="load.28filename1_.5Bfilename.5D.29" name="load.28filename1_.5Bfilename.5D.29"><code>read(<em>filename[, type]</em>)</code></h4>
+
+<p>Reads and returns the contents of file. If type is "binary" returns an <code>Uint8Array</code>, otherwise returns an UTF-8 decoded string.</p>
+
+<h4 id="readline.28.29" name="readline.28.29"><code>readline()</code></h4>
+
+<p>Reads a single line of input from <code>stdin</code>, returning it to the caller. You can use this to create interactive shell programs in JavaScript.</p>
+
+<h4 id="scatter.28fnArray.29" name="scatter.28fnArray.29">Reflect.parse()</h4>
+
+<p>See <a href="/en/SpiderMonkey/Parser_API" title="en/SpiderMonkey/Parser_API">Parser API</a>.</p>
+
+<div class="note"><strong>Note:</strong> This function is intended only for use when testing the JavaScript engine.</div>
+
+<h4 id="seal.28object.5B.2C_deep.5D.29" name="seal.28object.5B.2C_deep.5D.29"><code>seal(<em>object[, deep]</em>)</code></h4>
+
+<p>密封指定的对象, or an object graph if <em>deep</em> is <code>true</code>. 通过封住对象或对象图,可以禁用这些对象的修改.</p>
+
+<h4 id="sleep.28dt.29" name="sleep.28dt.29"><code>sleep(dt)</code></h4>
+
+<p>{{ jsapi_minversion_inline("1.8") }} Only in <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_THREADSAFE" title="en/SpiderMonkey/JSAPI_Reference/JS_THREADSAFE">JS_THREADSAFE</a></code> builds. Sleep for <em>dt</em> seconds. Fractions of a second are supported. Returns <code>true</code> on success, <code>false</code> if the sleep was interrupted.</p>
+
+<h4 id="stackQuota" name="stackQuota"><code>stackQuota(<em>[number]</em>)</code> {{obsolete_inline}}</h4>
+
+<p>{{ jsapi_minversion_inline("1.8") }} 获取或设置脚本堆栈配额.</p>
+
+<h4 id="throwError.28.29" name="throwError.28.29"><code>throwError()</code></h4>
+
+<p>Throws an error from the <code>JS_ReportError()</code> function.</p>
+
+<div class="note"><strong>Note:</strong> This function is intended only for use when testing the JavaScript engine.</div>
+
+<h4 id="trap.28.5Bfunction.2C_.5Bpc.2C.5D.5D_expression.29" name="trap.28.5Bfunction.2C_.5Bpc.2C.5D.5D_expression.29"><code>trap(<em>[function, [pc,]] expression</em>)</code></h4>
+
+<p>在JavaScript代码的特定点设置trap. 当由pc在函数函数中指定的偏移量即将被执行时,表达式将被求值。</p>
+
+<p>这是一种强大的调试机制,与<code>line2pc()</code>一起使用. 例如, 如果你想在函数的第6行中显示一条消息, <code>doSomething()</code> 被执行, you can enter the following:</p>
+
+<pre class="notranslate">trap(doSomething, line2pc(doSomething, 6), "print('line 6!\n')");
+</pre>
+
+<div class="note"><strong>Note:</strong> 当设置陷阱时,程序中的相应字节码将被<code>trap</code>字节码替换,直到您使用<code>untrap()</code> 来移除陷阱。</div>
+
+<h4 id="untrap.28function_.5B.2C_pc.5D.29" name="untrap.28function_.5B.2C_pc.5D.29"><code>untrap(<em>function [, pc]</em>)</code></h4>
+
+<p>Removes a trap from the specified <em>function</em> at the offset <em>pc</em>. If <em>pc</em> isn't specified, the trap is removed from the function's entry point.</p>
+
+<p>This function has no effect if there is no trap at the specified location.</p>
+
+<h4 id="version.28.5Bnumber.5D.29" name="version.28.5Bnumber.5D.29"><code>version(<em>[number]</em>)</code></h4>
+
+<p>The <code>version()</code> function lets you get or set the JavaScript version number. This may be useful for gaining access to syntax only available in certain versions of JavaScript (for example, see <a href="/en/JavaScript/New_in_JavaScript/1.7#Using_JavaScript_1.7" title="en/New_in_JavaScript_1.7#Using_JavaScript_1.7">Using JavaScript 1.7</a>).</p>
+
+<h3 id="Debug_functions" name="Debug_functions">调试方法</h3>
+
+<p>These built-in functions are only available in <code>DEBUG</code> builds.</p>
+
+<h4 id="dis.28.5Bfunction.5D.29" name="dis.28.5Bfunction.5D.29"><code>dis(<em>[function]</em>)</code></h4>
+
+<p>为整个程序或指定的函数分解JavaScript字节码</p>
+
+<p>For example, if you enter the JavaScript function below:</p>
+
+<pre class="eval notranslate">function test() {
+ var i = 3;
+ print(i+2);
+}
+</pre>
+
+<p>Then run the command <code>dis(test);</code>, you get this output:</p>
+
+<pre class="notranslate">main:
+00000: uint16 3
+00003: setvar 0
+00006: pop
+00007: name "print"
+00010: pushobj
+00011: getvar 0
+00014: uint16 2
+00017: add
+00018: call 1
+00021: pop
+00022: stop
+
+Source notes:
+ 0: 0 [ 0] newline
+ 1: 3 [ 3] decl offset 0
+ 2: 7 [ 4] newline
+ 3: 18 [ 11] xdelta
+ 4: 18 [ 0] pcbase offset 11
+</pre>
+
+<h4 id="dissrc.28.5Bfunction.5D.29" name="dissrc.28.5Bfunction.5D.29"><code>dissrc(<em>[function]</em>)</code></h4>
+
+<p>Disassembles the JavaScript bytecode for the entire program, or for the specified <em>function</em>, showing the source lines. This function only works with programs loaded from files, either using the <code>-f</code> flag on launching the shell, or by using the <code>load()</code> function.</p>
+
+<p>If your program includes a function, <code>doStuff()</code>, like this:</p>
+
+<pre class="notranslate">function doStuff(input) {
+ print("Enter a number: ");
+ var n1 = readline();
+ print("Enter another one: ");
+ var n2 = readline();
+
+ print("You entered " + n1 + " and " + n2 + "\n");
+}
+</pre>
+
+<p>Calling <code>dissrc(doStuff)</code> function would give this output:</p>
+
+<pre class="notranslate">;------------------------- 10: print("Enter a number: ");
+00000: 10 name "print"
+00003: 10 pushobj
+00004: 10 string "Enter a number: "
+00007: 10 call 1
+00010: 10 pop
+;------------------------- 11: var n1 = readline();
+00011: 11 name "readline"
+00014: 11 pushobj
+00015: 11 call 0
+00018: 11 setvar 0
+00021: 11 pop
+;------------------------- 12: print("Enter another one: ");
+00022: 12 name "print"
+00025: 12 pushobj
+00026: 12 string "Enter another one: "
+00029: 12 call 1
+00032: 12 pop
+;------------------------- 13: var n2 = readline();
+00033: 13 name "readline"
+00036: 13 pushobj
+00037: 13 call 0
+00040: 13 setvar 1
+00043: 13 pop
+;------------------------- 14:
+;------------------------- 15: print("You entered " + n1 + " and " + n2 + "\n");
+00044: 15 name "print"
+00047: 15 pushobj
+00048: 15 string "You entered "
+00051: 15 getvar 0
+00054: 15 add
+00055: 15 string " and "
+00058: 15 add
+00059: 15 getvar 1
+00062: 15 add
+00063: 15 string "\\n"
+00066: 15 add
+00067: 15 call 1
+00070: 15 pop
+00071: 15 stop
+</pre>
+
+<h4 id="dumpheap.28.28.5BfileName.5B.2C_start.5B.2C_toFind.5B.2C_maxDepth.5B.2C_toIgnore.5D.5D.5D.5D.5D.29" name="dumpheap.28.28.5BfileName.5B.2C_start.5B.2C_toFind.5B.2C_maxDepth.5B.2C_toIgnore.5D.5D.5D.5D.5D.29"><code>dumpheap((<em>[fileName[, start[, toFind[, maxDepth[, toIgnore]]]]]</em>)</code></h4>
+
+<p>Dump GC information. This is a thin wrapper for <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DumpHeap" title="en/SpiderMonkey/JSAPI_Reference/JS_DumpHeap">JS_DumpHeap</a></code>.</p>
+
+<h4 id="gczeal.28zeal.29" name="gczeal.28zeal.29"><code>gczeal(<em>zeal</em>)</code></h4>
+
+<p>Enable extra-frequent GC, to help find GC hazards. <em>zeal</em> is an integer. The meaning is the same as for the parameter to <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCZeal" title="en/SpiderMonkey/JSAPI_Reference/JS_SetGCZeal">JS_SetGCZeal</a></code>.</p>
+
+<h4 id="notes.28.5Bfunction.5D.29" name="notes.28.5Bfunction.5D.29"><code>notes(<em>[function]</em>)</code></h4>
+
+<p>Shows the source notes for the specified function. Source notes contain information that map the bytecode to the source code, which is used when decompiling the code, such as when using the <code>dissrc()</code> function.</p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/javascript-c引擎嵌入开发指南/index.html b/files/zh-cn/mozilla/projects/spidermonkey/javascript-c引擎嵌入开发指南/index.html
new file mode 100644
index 0000000000..4752df82f3
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/javascript-c引擎嵌入开发指南/index.html
@@ -0,0 +1,11 @@
+---
+title: JavaScript-C引擎嵌入开发指南
+slug: Mozilla/Projects/SpiderMonkey/JavaScript-C引擎嵌入开发指南
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_User_Guide
+---
+<p><a class="external" href="http://www.nirvanastudio.org/javascript/javascript-c-engine-embedders-guide.html">查看Nirvana Studio上的翻译</a>
+</p><p><br>
+</p>
+<div class="noinclude">
+</div>
+{{ languages( { "en": "en/JSAPI_User_Guide", "ja": "ja/Embedding_SpiderMonkey" } ) }}
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/boolean_to_jsval/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/boolean_to_jsval/index.html
new file mode 100644
index 0000000000..80747881fd
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/boolean_to_jsval/index.html
@@ -0,0 +1,53 @@
+---
+title: BOOLEAN_TO_JSVAL
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/BOOLEAN_TO_JSVAL
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/BOOLEAN_TO_JSVAL
+---
+<div>{{SpiderMonkeySidebar("JSAPI")}}</div>
+
+<div>{{ obsolete_header("jsapi42") }}</div>
+
+<div class="summary">
+<p>Cast a C integer to a boolean {{jsapixref("JS::Value")}} without any type checking or error handling.</p>
+</div>
+
+<div class="note">
+<p>Please use {{jsapixref("JS::BooleanValue")}}/{{jsapixref("JS::TrueValue")}}/{{jsapixref("JS::FalseValue")}} instead in SpiderMonkey 45 or later.</p>
+</div>
+
+<h2 id="Syntax" name="Syntax">Syntax</h2>
+
+<pre class="brush: cpp">jsval
+BOOLEAN_TO_JSVAL(bool b);
+</pre>
+
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>Name</th>
+ <th>Type</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>b</code></td>
+ <td><code>bool</code></td>
+ <td>C integer value to be converted to a boolean <code>jsval</code>.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Description" name="Description">Description</h2>
+
+<p><strong><code>BOOLEAN_TO_JSVAL</code></strong> converts a <code>bool</code> argument, <code>b</code>, to a boolean <code>jsval</code>.</p>
+
+<p>If <code>b</code> is <code>false</code>, the result is <code>JSVAL_FALSE</code>.</p>
+
+<p>If <code>b</code> is <code>true</code>, the result is <code>JSVAL_TRUE</code>.</p>
+
+<h2 id="See_Also" name="See_Also">See Also</h2>
+
+<ul>
+ <li>{{ LXRSearch("ident", "i", "BOOLEAN_TO_JSVAL") }}</li>
+ <li>{{jsapixref("JS::BooleanValue")}}</li>
+ <li>{{bug(1177892)}} -- removed</li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/index.html
new file mode 100644
index 0000000000..d076928fba
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/index.html
@@ -0,0 +1,646 @@
+---
+title: JSAPI 参考
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference
+---
+<p><strong>JSAPI</strong>是<strong> </strong><a href="/en/SpiderMonkey" title="en/SpiderMonkey">SpiderMonkey</a> JavaScript 引擎的C 语言应用程序接口(API)。要了解如何使用JSAPI ,请看 <a href="/En/SpiderMonkey/JSAPI_User_Guide" title="en/JSAPI_User_Guide">JSAPI User Guide</a> and the <a href="/En/SpiderMonkey/JSAPI_Phrasebook" title="en/JSAPI_Phrasebook">JSAPI Phrasebook</a>。</p>
+<p><br>
+ <a href="/En/SpiderMonkey/JSAPI_Reference/Alphabetical_List" title="en/JSAPI_Reference/Alphabetical_List">Alphabetical List</a></p>
+<h3 id="Runtimes_and_contexts" name="Runtimes_and_contexts">运行时和上下文</h3>
+<ul>
+ <li>typedef <a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSRuntime</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewRuntime" title="en/JS_NewRuntime">JS_NewRuntime</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DestroyRuntime" title="en/JS_DestroyRuntime">JS_DestroyRuntime</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ShutDown" title="en/JS_ShutDown">JS_ShutDown</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetRuntimePrivate" title="en/JS_GetRuntimePrivate">JS_GetRuntimePrivate</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetRuntimePrivate" title="en/JS_GetRuntimePrivate">JS_SetRuntimePrivate</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_Init" title="en/JS_Init">JS_Init</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_Finish" title="en/JS_Finish">JS_Finish</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ContextIterator" title="en/JS_ContextIterator">JS_ContextIterator</a></li>
+</ul>
+<ul>
+ <li>typedef <a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewContext" title="en/JS_NewContext">JS_NewContext</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DestroyContext" title="en/JS_DestroyContext">JS_DestroyContext</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DestroyContext" title="en/JS_DestroyContext">JS_DestroyContextMaybeGC</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DestroyContext" title="en/JS_DestroyContext">JS_DestroyContextNoGC</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetRuntime" title="en/JS_GetRuntime">JS_GetRuntime</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetContextPrivate" title="en/JS_GetContextPrivate">JS_GetContextPrivate</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetContextPrivate" title="en/JS_GetContextPrivate">JS_SetContextPrivate</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetOptions" title="en/JS_GetOptions">JS_GetOptions</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOptions" title="en/JS_SetOptions">JS_SetOptions</a> – <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOptions" title="en/JS_SetOptions">JSOPTION_ATLINE</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOptions" title="en/JS_SetOptions">JSOPTION_COMPILE_N_GO</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOptions" title="en/JS_SetOptions">JSOPTION_DONT_REPORT_UNCAUGHT</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOptions" title="en/JS_SetOptions">JSOPTION_NATIVE_BRANCH_CALLBACK</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOptions" title="en/JSOPTION_RELIMIT">JSOPTION_RELIMIT</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOptions" title="en/JS_SetOptions">JSOPTION_STRICT</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOptions" title="en/JS_SetOptions">JSOPTION_VAROBJFIX</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOptions" title="en/JS_SetOptions">JSOPTION_WERROR</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOptions" title="en/JS_SetOptions">JSOPTION_XML</a></li>
+ <li><a href="/En/SpiderMonkey/JSAPI_Reference/JS_ToggleOptions" title="en/JS_ToggleOptions">JS_ToggleOptions</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetBranchCallback" title="en/JS_SetBranchCallback">JS_SetBranchCallback</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOperationCallback" title="en/JS_SetOperationCallback">JS_SetOperationCallback</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOperationCallback" title="en/JS_SetOperationCallback">JS_ClearOperationCallback</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOperationCallback" title="en/JS_SetOperationCallback">JS_GetOperationCallback</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOperationCallback" title="en/JS_SetOperationCallback">JS_GetOperationLimit</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOperationCallback" title="en/JS_SetOperationCallback">JS_SetOperationLimit</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOperationCallback" title="en/JS_SetOperationCallback">JS_MAX_OPERATION_LIMIT</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetOperationCallback" title="en/JS_SetOperationCallback">JS_OPERATION_WEIGHT_BASE</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetThreadStackLimit" title="en/JS_SetThreadStackLimit">JS_SetThreadStackLimit</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetScriptStackQuota" title="en/JS_SetScriptStackQuota">JS_SetScriptStackQuota</a></li>
+</ul>
+<ul>
+ <li>enum <a href="/en/SpiderMonkey/JSAPI_Reference/JSVersion" title="en/JSVersion">JSVersion</a>, <a href="/en/JSVERSION_ECMA_3" title="en/JSVERSION_ECMA_3">JSVERSION_ECMA_3</a>, <a href="/en/JSVERSION_DEFAULT" title="en/JSVERSION_DEFAULT">JSVERSION_DEFAULT</a>, <a href="/en/JSVERSION_LATEST" title="en/JSVERSION_LATEST">JSVERSION_LATEST</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetImplementationVersion" title="en/JS_GetImplementationVersion">JS_GetImplementationVersion</a></li>
+ <li><a class="internal" href="/cn/SpiderMonkey/JSAPI%20%E5%8F%82%E8%80%83/JS%20GetVersion" title="cn/SpiderMonkey/JSAPI 参考/JS GetVersion">JS_GetVersion</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetVersion" title="en/JS_SetVersion">JS_SetVersion</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_StringToVersion" title="en/JS_StringToVersion">JS_StringToVersion</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_VersionToString" title="en/JS_VersionToString">JS_VersionToString</a></li>
+</ul>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetGlobalObject" title="en/JS_GetGlobalObject">JS_GetGlobalObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGlobalObject" title="en/JS_SetGlobalObject">JS_SetGlobalObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_InitClass" title="en/JS_InitClass">JS_InitClass</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_InitStandardClasses" title="en/JS_InitStandardClasses">JS_InitStandardClasses</a></li>
+ <li><a href="/en/JS_ResolveStandardClass" title="en/JS_ResolveStandardClass">JS_ResolveStandardClass</a></li>
+ <li><a href="/en/JS_EnumerateStandardClasses" title="en/JS_EnumerateStandardClasses">JS_EnumerateStandardClasses</a></li>
+ <li><a href="/en/JS_EnumerateResolvedStandardClasses" title="en/JS_EnumerateResolvedStandardClasses">JS_EnumerateResolvedStandardClasses</a></li>
+</ul>
+<ul>
+ <li><a href="/en/JS_IsAssigning" title="en/JS_IsAssigning">JS_IsAssigning</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_IsConstructing" title="en/JS_IsConstructing">JS_IsConstructing</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_IsRunning" title="en/JS_IsRunning">JS_IsRunning</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetScopeChain" title="en/JS_GetScopeChain">JS_GetScopeChain</a></li>
+ <li><a href="/en/JS_SaveFrameChain" title="en/JS_SaveFrameChain">JS_SaveFrameChain</a>, <a href="/en/JS_RestoreFrameChain" title="en/JS_RestoreFrameChain">JS_RestoreFrameChain</a></li>
+</ul>
+<p>Locale callbacks:</p>
+<ul>
+ <li>struct <a href="/en/JSLocaleCallbacks" title="en/JSLocaleCallbacks">JSLocaleCallbacks</a></li>
+ <li><a href="/en/JS_GetLocaleCallbacks" title="en/JS_GetLocaleCallbacks">JS_GetLocaleCallbacks</a></li>
+ <li><a href="/en/JS_SetLocaleCallbacks" title="en/JS_SetLocaleCallbacks">JS_SetLocaleCallbacks</a></li>
+</ul>
+<p>Locale callback types:</p>
+<ul>
+ <li><a href="/en/JSLocaleToUpperCase" title="en/JSLocaleToUpperCase">JSLocaleToUpperCase</a></li>
+ <li><a href="/en/JSLocaleToLowerCase" title="en/JSLocaleToLowerCase">JSLocaleToLowerCase</a></li>
+ <li><a href="/en/JSLocaleCompare" title="en/JSLocaleCompare">JSLocaleCompare</a></li>
+ <li><a href="/en/JSLocaleToUnicode" title="en/JSLocaleToUnicode">JSLocaleToUnicode</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ReportErrorNumber" title="en/JS_ReportErrorNumber">JSErrorCallback</a></li>
+</ul>
+<h3 id="Scripts" name="Scripts">脚本</h3>
+<p>Just running some JavaScript code is straightforward:</p>
+<p>只是运行一些JavaScript代码很简单:</p>
+<ul>
+ <li><a class="internal" href="/Cn/SpiderMonkey/JSAPI_%E5%8F%82%E8%80%83/JS_EvaluateScript" title="cn/SpiderMonkey/JSAPI 参考/JS EvaluateScript">JS_EvaluateScript</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_EvaluateScript" title="en/JS_EvaluateScript">JS_EvaluateUCScript</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_EvaluateScriptForPrincipals" title="en/JS_EvaluateScriptForPrincipals">JS_EvaluateScriptForPrincipals</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_EvaluateScriptForPrincipals" title="en/JS_EvaluateScriptForPrincipals">JS_EvaluateUCScriptForPrincipals</a></li>
+</ul>
+<p>You can instead compile JavaScript code into a <code>JSScript</code> which you can then execute multiple times.</p>
+<p>你可以将JavaScript代码编译后保存在<code>JSScript类型的变量中,这样就可以多次执行。</code></p>
+<p>typedef <a href="/en/JSScript" title="en/JSScript">JSScript</a></p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileFile" title="en/JS_CompileFile">JS_CompileFile</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileFileHandle" title="en/JS_CompileFileHandle">JS_CompileFileHandle</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileFileHandle" title="en/JS_CompileFileHandle">JS_CompileFileHandleForPrincipals</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileScript" title="en/JS_CompileScript">JS_CompileScript</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileScript" title="en/JS_CompileScript">JS_CompileUCScript</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileScriptForPrincipals" title="en/JS_CompileScriptForPrincipals">JS_CompileScriptForPrincipals</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileScriptForPrincipals" title="en/JS_CompileScriptForPrincipals">JS_CompileUCScriptForPrincipals</a></li>
+ <li><a href="/en/JS_BufferIsCompilableUnit" title="en/JS_BufferIsCompilableUnit">JS_BufferIsCompilableUnit</a></li>
+ <li><a href="/en/JS_GetScriptObject" title="en/JS_GetScriptObject">JS_GetScriptObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewScriptObject" title="en/JS_NewScriptObject">JS_NewScriptObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ExecuteScript" title="en/JS_ExecuteScript">JS_ExecuteScript</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ExecuteScriptPart" title="en/JS_ExecuteScriptPart">JS_ExecuteScriptPart</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DecompileScript" title="en/JS_DecompileScript">JS_DecompileScript</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DestroyScript" title="en/JS_DestroyScript">JS_DestroyScript</a></li>
+</ul>
+<p>You can also compile JavaScript code into a function:</p>
+<ul>
+ <li>typedef <a href="/en/JSFunction" title="en/JSFunction">JSFunction</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileFunction" title="en/JS_CompileFunction">JS_CompileFunction</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileFunctionForPrincipals" title="en/JS_CompileFunctionForPrincipals">JS_CompileFunctionForPrincipals</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileFunction" title="en/JS_CompileFunction">JS_CompileUCFunction</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileFunctionForPrincipals" title="en/JS_CompileFunctionForPrincipals">JS_CompileUCFunctionForPrincipals</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DecompileFunction" title="en/JS_DecompileFunction">JS_DecompileFunction</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DecompileFunctionBody" title="en/JS_DecompileFunctionBody">JS_DecompileFunctionBody</a></li>
+</ul>
+<p> </p>
+<h3 id="Error_handling" name="Error_handling">错误处理</h3>
+<ul>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSErrorReport" title="en/JSErrorReport">JSErrorReport</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ReportError" title="en/JS_ReportError">JS_ReportError</a></li>
+ <li><a href="/en/JS_ReportWarning" title="en/JS_ReportWarning">JS_ReportWarning</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ReportErrorNumber" title="en/JS_ReportErrorNumber">JS_ReportErrorNumber</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ReportErrorNumber" title="en/JS_ReportErrorNumber">JS_ReportErrorNumberUC</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ReportErrorNumber" title="en/JS_ReportErrorNumber">JS_ReportErrorFlagsAndNumber</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ReportErrorNumber" title="en/JS_ReportErrorNumber">JS_ReportErrorFlagsAndNumberUC</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ReportOutOfMemory" title="en/JS_ReportOutOfMemory">JS_ReportOutOfMemory</a></li>
+ <li><a class="internal" href="/cn/SpiderMonkey/JSAPI%20%E5%8F%82%E8%80%83/JS_%20SetErrorReporter" title="cn/SpiderMonkey/JSAPI 参考/JS SetErrorReporter">JS_SetErrorReporter</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSREPORT_IS_EXCEPTION" title="en/JSREPORT_IS_EXCEPTION">JSREPORT_IS_EXCEPTION</a></li>
+ <li><a href="/en/JSREPORT_IS_STRICT" title="en/JSREPORT_IS_STRICT">JSREPORT_IS_STRICT</a></li>
+ <li><a href="/en/JSREPORT_IS_WARNING" title="en/JSREPORT_IS_WARNING">JSREPORT_IS_WARNING</a></li>
+</ul>
+<p>The following functions allow C/C++ functions to throw and catch JavaScript exceptions:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_IsExceptionPending" title="en/JS_IsExceptionPending">JS_IsExceptionPending</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPendingException" title="en/JS_GetPendingException">JS_GetPendingException</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetPendingException" title="en/JS_SetPendingException">JS_SetPendingException</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ClearPendingException" title="en/JS_ClearPendingException">JS_ClearPendingException</a></li>
+ <li><a href="/en/JS_ThrowStopIteration" title="en/JS_ThrowStopIteration">JS_ThrowStopIteration</a></li>
+</ul>
+<ul>
+ <li>typedef <a href="/en/SpiderMonkey/JSAPI_Reference/JSExceptionState" title="en/JSExceptionState">JSExceptionState</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SaveExceptionState" title="en/JS_SaveExceptionState">JS_SaveExceptionState</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_RestoreExceptionState" title="en/JS_RestoreExceptionState">JS_RestoreExceptionState</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DropExceptionState" title="en/JS_DropExceptionState">JS_DropExceptionState</a></li>
+</ul>
+<p>These functions translate errors into exceptions and vice versa:</p>
+<ul>
+ <li><a href="/en/JS_ReportPendingException" title="en/JS_ReportPendingException">JS_ReportPendingException</a></li>
+ <li><a href="/en/JS_ErrorFromException" title="en/JS_ErrorFromException">JS_ErrorFromException</a></li>
+ <li><a href="/en/JS_ThrowReportedError" title="en/JS_ThrowReportedError">JS_ThrowReportedError</a></li>
+</ul>
+<h3 id="Values_and_types" name="Values_and_types">值和类型</h3>
+<ul>
+ <li>typedef <a href="/En/SpiderMonkey/JSAPI_Reference/Jsval" title="en/jsval">jsval</a></li>
+</ul>
+<p><code>jsval</code> constants:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_NULL" title="en/JSVAL_NULL">JSVAL_NULL</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_VOID" title="en/JSVAL_VOID">JSVAL_VOID</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_TRUE" title="en/JSVAL_TRUE">JSVAL_TRUE</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_TRUE" title="en/JSVAL_TRUE">JSVAL_FALSE</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_ZERO" title="en/JSVAL_ZERO">JSVAL_ZERO</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_ONE" title="en/JSVAL_ONE">JSVAL_ONE</a></li>
+</ul>
+<p>Function and macros for checking the type of a <code>jsval</code>:</p>
+<ul>
+ <li>enum <a href="/en/SpiderMonkey/JSAPI_Reference/JSType" title="en/JSType">JSType</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_TypeOfValue" title="en/JS_TypeOfValue">JS_TypeOfValue</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_IS_NULL" title="en/JSVAL_IS_NULL">JSVAL_IS_NULL</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_IS_VOID" title="en/JSVAL_IS_VOID">JSVAL_IS_VOID</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_IS_BOOLEAN" title="en/JSVAL_IS_BOOLEAN">JSVAL_IS_BOOLEAN</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_IS_NUMBER" title="en/JSVAL_IS_NUMBER">JSVAL_IS_NUMBER</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_IS_INT" title="en/JSVAL_IS_INT">JSVAL_IS_INT</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_IS_DOUBLE" title="en/JSVAL_IS_DOUBLE">JSVAL_IS_DOUBLE</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_IS_STRING" title="en/JSVAL_IS_STRING">JSVAL_IS_STRING</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_IS_OBJECT" title="en/JSVAL_IS_OBJECT">JSVAL_IS_OBJECT</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_IS_PRIMITIVE" title="en/JSVAL_IS_PRIMITIVE">JSVAL_IS_PRIMITIVE</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_IS_GCTHING" title="en/JSVAL_IS_GCTHING">JSVAL_IS_GCTHING</a></li>
+</ul>
+<p>High-level type-conversion routines for packing and unpacking function arguments.</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_PushArguments" title="en/JS_PushArguments">JS_PushArguments</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_PushArguments" title="en/JS_PushArguments">JS_PushArgumentsVA</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_PopArguments" title="en/JS_PopArguments">JS_PopArguments</a></li>
+</ul>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ConvertArguments" title="en/JS_ConvertArguments">JS_ConvertArguments</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ConvertArgumentsVA" title="en/JS_ConvertArgumentsVA">JS_ConvertArgumentsVA</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddArgumentFormatter" title="en/JS_AddArgumentFormatter">JS_AddArgumentFormatter</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddArgumentFormatter" title="en/JS_AddArgumentFormatter">JS_RemoveArgumentFormatter</a></li>
+</ul>
+<p>The following functions convert JS values to various types. They can be safely applied to <code>jsval</code>s of any type. They may return new objects. For example, <code>JS_ValueToObject(cx, s)</code> where <code>s</code> is a string creates a new <code>String</code> wrapper object. These functions may call JavaScript methods. For example, <code>JS_ValueToString(cx, obj)</code> may call <code>obj.toString()</code>.</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToBoolean" title="en/JS_ValueToBoolean">JS_ValueToBoolean</a></li>
+ <li><a href="/en/JS_ValueToConstructor" title="en/JS_ValueToConstructor">JS_ValueToConstructor</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToECMAInt32" title="en/JS_ValueToECMAInt32">JS_ValueToECMAInt32</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToECMAInt32" title="en/JS_ValueToECMAInt32">JS_ValueToECMAUint32</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToFunction" title="en/JS_ValueToFunction">JS_ValueToFunction</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToInt32" title="en/JS_ValueToInt32">JS_ValueToInt32</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToNumber" title="en/JS_ValueToNumber">JS_ValueToNumber</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToObject" title="en/JS_ValueToObject">JS_ValueToObject</a></li>
+ <li><a class="internal" href="/cn/SpiderMonkey/JSAPI%20%E5%8F%82%E8%80%83/JS%20ValueToString" title="cn/SpiderMonkey/JSAPI 参考/JS ValueToString">JS_ValueToString</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToECMAInt32" title="en/JS_ValueToECMAInt32">JS_ValueToUint16</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ConvertValue" title="en/JS_ConvertValue">JS_ConvertValue</a></li>
+</ul>
+<p>Fast, unchecked type-casting macros. These macros must not be applied to values that are not known to be the right type. Like C casts, they may cause crashes if applied to incorrect values. They never create new objects or call into JavaScript code.</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_TO_BOOLEAN" title="en/JSVAL_TO_BOOLEAN">JSVAL_TO_BOOLEAN</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/BOOLEAN_TO_JSVAL" title="en/BOOLEAN_TO_JSVAL">BOOLEAN_TO_JSVAL</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_TO_INT" title="en/JSVAL_TO_INT">JSVAL_TO_INT</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/INT_TO_JSVAL" title="en/INT_TO_JSVAL">INT_TO_JSVAL</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/INT_FITS_IN_JSVAL" title="en/INT_FITS_IN_JSVAL">INT_FITS_IN_JSVAL</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_TO_DOUBLE" title="en/JSVAL_TO_DOUBLE">JSVAL_TO_DOUBLE</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/DOUBLE_TO_JSVAL" title="en/DOUBLE_TO_JSVAL">DOUBLE_TO_JSVAL</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_TO_OBJECT" title="en/JSVAL_TO_OBJECT">JSVAL_TO_OBJECT</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/OBJECT_TO_JSVAL" title="en/OBJECT_TO_JSVAL">OBJECT_TO_JSVAL</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_TO_STRING" title="en/JSVAL_TO_STRING">JSVAL_TO_STRING</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/STRING_TO_JSVAL" title="en/STRING_TO_JSVAL">STRING_TO_JSVAL</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_TO_GCTHING" title="en/JSVAL_TO_GCTHING">JSVAL_TO_GCTHING</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/PRIVATE_TO_JSVAL" title="en/PRIVATE_TO_JSVAL">JSVAL_TO_PRIVATE</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/PRIVATE_TO_JSVAL" title="en/PRIVATE_TO_JSVAL">PRIVATE_TO_JSVAL</a></li>
+</ul>
+<p>And:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetTypeName" title="en/JS_GetTypeName">JS_GetTypeName</a></li>
+</ul>
+<h3 id="Memory_management" name="Memory_management">Memory management</h3>
+<p>These functions act like the Standard C <code>malloc</code> family of functions, except that errors are reported using the SpiderMonkey error APIs rather than <code>errno</code>. These functions also allow SpiderMonkey to account the number of bytes allocated:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_malloc" title="en/JS_malloc">JS_malloc</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_free" title="en/JS_free">JS_free</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_realloc" title="en/JS_realloc">JS_realloc</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_strdup" title="en/JS_strdup">JS_strdup</a></li>
+</ul>
+<p>JavaScript objects, strings, and floating-point numbers are garbage collected. These functions provide access to the garbage collector:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GC" title="en/JS_GC">JS_GC</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_MaybeGC" title="en/JS_MaybeGC">JS_MaybeGC</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCParameter" title="en/JS_SetGCParameter">JS_SetGCParameter</a>, enum <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCParameter" title="en/JS_SetGCParameter">JSGCParamKey</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCParameter" title="en/JS_SetGCParameter">JSGC_MAX_BYTES</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCParameter" title="en/JS_SetGCParameter">JSGC_MAX_MALLOC_BYTES</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCParameter" title="en/JS_SetGCParameter">JSGC_STACKPOOL_LIFESPAN</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCCallback" title="en/JS_SetGCCallback">JS_SetGCCallback</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCCallback" title="en/JS_SetGCCallback">JS_SetGCCallbackRT</a>, enum <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCCallback" title="en/JS_SetGCCallback">JSGCStatus</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCCallback" title="en/JS_SetGCCallback">JSGC_BEGIN</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCCallback" title="en/JS_SetGCCallback">JSGC_MARK_END</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCCallback" title="en/JS_SetGCCallback">JSGC_FINALIZE_END</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCCallback" title="en/JS_SetGCCallback">JSGC_END</a></li>
+ <li><a href="/en/JS_MarkGCThing" title="en/JS_MarkGCThing">JS_MarkGCThing</a></li>
+ <li><a href="/en/JS_IsAboutToBeFinalized" title="en/JS_IsAboutToBeFinalized">JS_IsAboutToBeFinalized</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ClearNewbornRoots" title="en/JS_ClearNewbornRoots">JS_ClearNewbornRoots</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCZeal" title="en/JS_SetGCZeal">JS_SetGCZeal</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DumpHeap" title="en/JS_DumpHeap">JS_DumpHeap</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+</ul>
+<p>The rest of these APIs help protect objects from being destroyed by the garbage collector before the application is done using them.</p>
+<p>If a variable is a <em>root</em>, then anything it points to will not be freed by the garbage collector. Failure to root objects is a very common cause of mysterious crashes.</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddRoot" title="en/JS_AddRoot">JS_AddRoot</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddRoot" title="en/JS_AddRoot">JS_AddNamedRoot</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddRoot" title="en/JS_AddRoot">JS_AddNamedRootRT</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_RemoveRoot" title="en/JS_RemoveRoot">JS_RemoveRoot</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_RemoveRootRT" title="en/JS_RemoveRootRT">JS_RemoveRootRT</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_MapGCRoots" title="en/JS_MapGCRoots">JS_MapGCRoots</a>, <a href="/en/JSGCMapRootFun" title="en/JSGCMapRootFun">JSGCMapRootFun</a> – <a href="/en/JS_MAP_GCROOT_NEXT" title="en/JS_MAP_GCROOT_NEXT">JS_MAP_GCROOT_NEXT</a>, <a href="/en/JS_MAP_GCROOT_REMOVE" title="en/JS_MAP_GCROOT_REMOVE">JS_MAP_GCROOT_REMOVE</a>, <a href="/en/JS_MAP_GCROOT_STOP" title="en/JS_MAP_GCROOT_STOP">JS_MAP_GCROOT_STOP</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DumpNamedRoots" title="en/JS_DumpNamedRoots">JS_DumpNamedRoots</a></li>
+</ul>
+<p>Local root scopes are another way of protecting objects from the garbage collector.</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_EnterLocalRootScope" title="en/JS_EnterLocalRootScope">JS_EnterLocalRootScope</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_LeaveLocalRootScope" title="en/JS_LeaveLocalRootScope">JS_LeaveLocalRootScope</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_LeaveLocalRootScopeWithResult" title="en/JS_LeaveLocalRootScopeWithResult">JS_LeaveLocalRootScopeWithResult</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ForgetLocalRoot" title="en/JS_ForgetLocalRoot">JS_ForgetLocalRoot</a></li>
+</ul>
+<p>{{ Jsapi_minversion_inline("1.8 (not yet released)") }} If an object contains references to other GC things that are not stored in SpiderMonkey data structures ("slots"), it must implement the <code><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.mark" title="en/JSClass.mark">JSTraceOp</a></code> hook to enable the garbage collector to traverse those references. Otherwise the garbage collector will not find all reachable objects and may collect objects that are still reachable, leading to a crash. (In SpiderMonkey 1.7 and earlier, the <code>JSMarkOp</code> hook is used instead. This will be deprecated when SpiderMonkey 1.8 is released.)</p>
+<p>The tracing APIs are used by the garbage collector and <code>JSTraceOp</code> hooks. JSAPI applications may also use them to examine the object graph. (For example, these APIs support very smooth integration between the JS garbage collector and other garbage collectors.)</p>
+<ul>
+ <li><a href="/en/JSVAL_IS_TRACEABLE" title="en/JSVAL_IS_TRACEABLE">JSVAL_IS_TRACEABLE</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JSVAL_TO_TRACEABLE" title="en/JSVAL_TO_TRACEABLE">JSVAL_TO_TRACEABLE</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JSVAL_TRACE_KIND" title="en/JSVAL_TRACE_KIND">JSVAL_TRACE_KIND</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li>struct <a href="/en/JSTracer" title="en/JSTracer">JSTracer</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_TRACER_INIT" title="en/JS_TRACER_INIT">JS_TRACER_INIT</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_CallTracer" title="en/JS_CallTracer">JS_CallTracer</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SET_TRACING_DETAILS" title="en/JS_SET_TRACING_DETAILS">JS_SET_TRACING_DETAILS</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_SET_TRACING_INDEX" title="en/JS_SET_TRACING_INDEX">JS_SET_TRACING_INDEX</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_SET_TRACING_NAME" title="en/JS_SET_TRACING_NAME">JS_SET_TRACING_NAME</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_CALL_TRACER" title="en/JS_CALL_TRACER">JS_CALL_TRACER</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_CALL_VALUE_TRACER" title="en/JS_CALL_VALUE_TRACER">JS_CALL_VALUE_TRACER</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_CALL_OBJECT_TRACER" title="en/JS_CALL_OBJECT_TRACER">JS_CALL_OBJECT_TRACER</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_CALL_STRING_TRACER" title="en/JS_CALL_STRING_TRACER">JS_CALL_STRING_TRACER</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_CALL_DOUBLE_TRACER" title="en/JS_CALL_DOUBLE_TRACER">JS_CALL_DOUBLE_TRACER</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_TraceChildren" title="en/JS_TraceChildren">JS_TraceChildren</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_TraceRuntime" title="en/JS_TraceRuntime">JS_TraceRuntime</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/JS_PrintTraceThingInfo" title="en/JS_PrintTraceThingInfo">JS_PrintTraceThingInfo</a> (DEBUG-only) {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+</ul>
+<p>Miscellaneous GC APIs:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_LOCK" title="en/JSVAL_LOCK">JSVAL_LOCK</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSVAL_UNLOCK" title="en/JSVAL_UNLOCK">JSVAL_UNLOCK</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_LockGCThing" title="en/JS_LockGCThing">JS_LockGCThing</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/JS_LockGCThingRT" title="en/JS_LockGCThingRT">JS_LockGCThingRT</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_LockGCThing" title="en/JS_LockGCThing">JS_UnlockGCThing</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/JS_UnlockGCThingRT" title="en/JS_UnlockGCThingRT">JS_UnlockGCThingRT</a></li>
+</ul>
+<h3 id="Numbers" name="Numbers">Numbers</h3>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewNumberValue" title="en/JS_NewNumberValue">JS_NewNumberValue</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewDoubleValue" title="en/JS_NewDoubleValue">JS_NewDoubleValue</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewDouble" title="en/JS_NewDouble">JS_NewDouble</a></li>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSConstDoubleSpec" title="en/JSConstDoubleSpec">JSConstDoubleSpec</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefineConstDoubles" title="en/JS_DefineConstDoubles">JS_DefineConstDoubles</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetNaNValue" title="en/JS_GetNaNValue">JS_GetNaNValue</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPositiveInfinityValue" title="en/JS_GetPositiveInfinityValue">JS_GetNegativeInfinityValue</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPositiveInfinityValue" title="en/JS_GetPositiveInfinityValue">JS_GetPositiveInfinityValue</a></li>
+</ul>
+<h3 id="Strings" name="Strings">字符串</h3>
+<ul>
+ <li>typedef <a href="/en/SpiderMonkey/JSAPI_Reference/JSString" title="en/JSString">JSString</a></li>
+ <li>typedef <a href="/en/SpiderMonkey/JSAPI_Reference/jschar" title="en/jschar">jschar</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewString" title="en/JS_NewString">JS_NewString</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewStringCopyN" title="en/JS_NewStringCopyN">JS_NewStringCopyN</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewStringCopyZ" title="en/JS_NewStringCopyZ">JS_NewStringCopyZ</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewString" title="en/JS_NewString">JS_NewUCString</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewStringCopyN" title="en/JS_NewStringCopyN">JS_NewUCStringCopyN</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewStringCopyZ" title="en/JS_NewStringCopyZ">JS_NewUCStringCopyZ</a></li>
+ <li><a href="/en/JS_NewGrowableString" title="en/JS_NewGrowableString">JS_NewGrowableString</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewDependentString" title="en/JS_NewDependentString">JS_NewDependentString</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetEmptyStringValue" title="en/JS_GetEmptyStringValue">JS_GetEmptyStringValue</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompareStrings" title="en/JS_CompareStrings">JS_CompareStrings</a></li>
+ <li><a href="/en/JS_ConcatStrings" title="en/JS_ConcatStrings">JS_ConcatStrings</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetStringBytes" title="en/JS_GetStringBytes">JS_GetStringBytes</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetStringChars" title="en/JS_GetStringChars">JS_GetStringChars</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetStringLength" title="en/JS_GetStringLength">JS_GetStringLength</a></li>
+ <li><a href="/en/JS_MakeStringImmutable" title="en/JS_MakeStringImmutable">JS_MakeStringImmutable</a></li>
+ <li><a href="/en/JS_UndependString" title="en/JS_UndependString">JS_UndependString</a></li>
+</ul>
+<ul>
+ <li><a href="/en/JS_CStringsAreUTF8" title="en/JS_CStringsAreUTF8">JS_CStringsAreUTF8</a></li>
+ <li><a href="/en/JS_SetCStringsAreUTF8" title="en/JS_SetCStringsAreUTF8">JS_SetCStringsAreUTF8</a></li>
+ <li><a href="/en/JS_DecodeBytes" title="en/JS_DecodeBytes">JS_DecodeBytes</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_EncodeCharacters" title="en/JS_EncodeCharacters">JS_EncodeCharacters</a></li>
+ <li><a href="/en/JS_EncodeString" title="en/JS_EncodeString">JS_EncodeString</a></li>
+</ul>
+<p><em>Interning</em> strings tells the SpiderMonkey engine to reuse existing string objects when possible.</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_InternString" title="en/JS_InternString">JS_InternString</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_InternString" title="en/JS_InternString">JS_InternUCString</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_InternString" title="en/JS_InternString">JS_InternUCStringN</a></li>
+</ul>
+<p>The character data for <em>external strings</em> is stored in memory provided by the application. Applications can use this to avoid copying data back and forth between SpiderMonkey's heap and application memory.</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddExternalStringFinalizer" title="en/JS_AddExternalStringFinalizer">JS_AddExternalStringFinalizer</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_RemoveExternalStringFinalizer" title="en/JS_RemoveExternalStringFinalizer">JS_RemoveExternalStringFinalizer</a></li>
+ <li><a href="/en/JS_GetExternalStringGCType" title="en/JS_GetExternalStringGCType">JS_GetExternalStringGCType</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewExternalString" title="en/JS_NewExternalString">JS_NewExternalString</a></li>
+</ul>
+<h3 id="Objects" name="Objects">对象</h3>
+<ul>
+ <li>typedef <a href="/en/SpiderMonkey/JSAPI_Reference/JSObject" title="en/JSObject">JSObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ConstructObject" title="en/JS_ConstructObject">JS_ConstructObject</a></li>
+ <li><a href="/en/JS_ConstructObjectWithArguments" title="en/JS_ConstructObjectWithArguments">JS_ConstructObjectWithArguments</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefineObject" title="en/JS_DefineObject">JS_DefineObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewObject" title="en/JS_NewObject">JS_NewObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewObject" title="en/JS_NewObject">JS_NewObjectWithGivenProto</a></li>
+</ul>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GET_CLASS" title="en/JS_GET_CLASS">JS_GET_CLASS</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GET_CLASS" title="en/JS_GET_CLASS">JS_GetClass</a></li>
+ <li><a href="/en/JS_GetClassObject" title="en/JS_GetClassObject">JS_GetClassObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetConstructor" title="en/JS_GetConstructor">JS_GetConstructor</a></li>
+ <li><a href="/en/JS_GetGlobalForObject" title="en/JS_GetGlobalForObject">JS_GetGlobalForObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetInstancePrivate" title="en/JS_GetInstancePrivate">JS_GetInstancePrivate</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetParent" title="en/JS_GetParent">JS_GetParent</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetParent" title="en/JS_SetParent">JS_SetParent</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPrivate" title="en/JS_GetPrivate">JS_GetPrivate</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetPrivate" title="en/JS_SetPrivate">JS_SetPrivate</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPrototype" title="en/JS_GetPrototype">JS_GetPrototype</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetPrototype" title="en/JS_SetPrototype">JS_SetPrototype</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetReservedSlot" title="en/JS_GetReservedSlot">JS_GetReservedSlot</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetReservedSlot" title="en/JS_GetReservedSlot">JS_SetReservedSlot</a></li>
+ <li><a href="/en/JS_HasInstance" title="en/JS_HasInstance">JS_HasInstance</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_InstanceOf" title="en/JS_InstanceOf">JS_InstanceOf</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SealObject" title="en/JS_SealObject">JS_SealObject</a></li>
+</ul>
+<h3 id="Properties" name="Properties">属性</h3>
+<p>These functions correspond directly to the ways scripts access object properties:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetProperty" title="en/JS_GetProperty">JS_GetProperty</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetProperty" title="en/JS_GetProperty">JS_GetUCProperty</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetProperty" title="en/JS_SetProperty">JS_SetProperty</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetProperty" title="en/JS_SetProperty">JS_SetUCProperty</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_HasProperty" title="en/JS_HasProperty">JS_HasProperty</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_HasProperty" title="en/JS_HasProperty">JS_HasUCProperty</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DeleteProperty" title="en/JS_DeleteProperty">JS_DeleteProperty</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_DeleteProperty2" title="en/JS_DeleteProperty2">JS_DeleteProperty2</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_DeleteProperty2" title="en/JS_DeleteProperty2">JS_DeleteUCProperty2</a></li>
+</ul>
+<p>The following functions are lower-level, allowing the JSAPI application more access to details of how properties are implemented. "Define" is a lower-level version of "set" that provides access to extra settings and does not call setters. Similarly, "lookup" is a lower-level version of "get" that offers extra options and does not call getters.</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AlreadyHasOwnProperty" title="en/JS_AlreadyHasOwnElement">JS_AlreadyHasOwnElement</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_AlreadyHasOwnProperty" title="en/JS_AlreadyHasOwnProperty">JS_AlreadyHasOwnProperty</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_AlreadyHasOwnProperty" title="en/JS_AlreadyHasOwnProperty">JS_AlreadyHasOwnUCProperty</a> {{ Jsapi_minversion_inline("1.8 (not yet released)") }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ClearScope" title="en/JS_ClearScope">JS_ClearScope</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefineProperties" title="en/JS_DefineProperties">JS_DefineProperties</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefineProperty" title="en/JS_DefineProperty">JS_DefineProperty</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefineProperty" title="en/JS_DefineProperty">JS_DefineUCProperty</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefinePropertyWithTinyId" title="en/JS_DefinePropertyWithTinyId">JS_DefinePropertyWithTinyId</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefinePropertyWithTinyId" title="en/JS_DefinePropertyWithTinyId">JS_DefineUCPropertyWithTinyId</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_Enumerate" title="en/JS_Enumerate">JS_Enumerate</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes" title="en/JS_GetPropertyAttributes">JS_GetPropertyAttributes</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes" title="en/JS_GetPropertyAttributes">JS_GetUCPropertyAttributes</a> – <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes" title="en/JS_GetPropertyAttributes">JSPROP_ENUMERATE</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes" title="en/JS_GetPropertyAttributes">JSPROP_EXPORTED</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes" title="en/JS_GetPropertyAttributes">JSPROP_GETTER</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes" title="en/JS_GetPropertyAttributes">JSPROP_INDEX</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes" title="en/JS_GetPropertyAttributes">JSPROP_PERMANENT</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes" title="en/JS_GetPropertyAttributes">JSPROP_READONLY</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes" title="en/JS_GetPropertyAttributes">JSPROP_SETTER</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes" title="en/JS_GetPropertyAttributes">JSPROP_SHARED</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttrsGetterAndSetter" title="en/JS_GetPropertyAttrsGetterAndSetter">JS_GetPropertyAttrsGetterAndSetter</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttrsGetterAndSetter" title="en/JS_GetPropertyAttrsGetterAndSetter">JS_GetUCPropertyAttrsGetterAndSetter</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_LookupProperty" title="en/JS_LookupProperty">JS_LookupProperty</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_LookupProperty" title="en/JS_LookupProperty">JS_LookupUCProperty</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_LookupProperty" title="en/JS_LookupProperty">JS_LookupPropertyWithFlags</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewPropertyIterator" title="en/JS_NewPropertyIterator">JS_NewPropertyIterator</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NextProperty" title="en/JS_NextProperty">JS_NextProperty</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetPropertyAttributes" title="en/JS_SetPropertyAttributes">JS_SetPropertyAttributes</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetPropertyAttributes" title="en/JS_SetPropertyAttributes">JS_SetUCPropertyAttributes</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AliasProperty" title="en/JS_AliasProperty">JS_AliasProperty</a> {{ Deprecated_inline() }}</li>
+</ul>
+<p>The following functions behave like <code>JS_GetProperty</code> except when operating on E4X XML objects.</p>
+<ul>
+ <li><a href="/en/JS_GetMethod" title="en/JS_GetMethod">JS_GetMethod</a>, <a href="/en/JS_GetMethodById" title="en/JS_GetMethodById">JS_GetMethodById</a></li>
+</ul>
+<p>A SpiderMonkey extension allows a native function to return an lvalue—that is, a reference to a property of an object:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetCallReturnValue2" title="en/JS_SetCallReturnValue2">JS_SetCallReturnValue2</a></li>
+</ul>
+<p>A <code><a href="/en/SpiderMonkey/JSAPI_Reference/jsid" title="en/jsid">jsid</a></code> is kind of like a <code>jsval</code>, only different. A handful of APIs use <code>jsid</code>s instead of <code>jsval</code>s for property names: <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CheckAccess" title="en/JS_CheckAccess">JS_CheckAccess</a></code>, <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_Enumerate" title="en/JS_Enumerate">JS_Enumerate</a></code>, <code><a href="/en/JS_GetMethodById" title="en/JS_GetMethodById">JS_GetMethodById</a></code>, and <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NextProperty" title="en/JS_NextProperty">JS_NextProperty</a></code>.</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_IdToValue" title="en/JS_IdToValue">JS_IdToValue</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToId" title="en/JS_ValueToId">JS_ValueToId</a></li>
+ <li><a href="/en/JS_GetObjectId" title="en/JS_GetObjectId">JS_GetObjectId</a></li>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSIdArray" title="en/JSIdArray">JSIdArray</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DestroyIdArray" title="en/JS_DestroyIdArray">JS_DestroyIdArray</a></li>
+</ul>
+<h3 id="Classes" name="Classes">Classes</h3>
+<p>These API features are used to define custom classes—object types that are implemented in C/C++ code but accessible from JavaScript.</p>
+<ul>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass" title="en/JSClass">JSClass</a></li>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSExtendedClass" title="en/JSExtendedClass">JSExtendedClass</a></li>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps" title="en/JSObjectOps">JSObjectOps</a></li>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSXMLObjectOps" title="en/JSXMLObjectOps">JSXMLObjectOps</a></li>
+ <li>struct <a href="/en/JSFunctionSpec" title="en/JSFunctionSpec">JSFunctionSpec</a></li>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSProperty" title="en/JSProperty">JSProperty</a></li>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSPropertySpec" title="en/JSPropertySpec">JSPropertySpec</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_InitClass" title="en/JS_InitClass">JS_InitClass</a></li>
+</ul>
+<p>Adding native properties and methods to classes:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSNative" title="en/JSNative">JSNative</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSFastNative" title="en/JSFastNative">JSFastNative</a></li>
+ <li>struct <a href="/en/JSFunctionSpec" title="en/JSFunctionSpec">JSFunctionSpec</a></li>
+ <li><a href="/en/JS_FS" title="en/JS_FS">JS_FS</a></li>
+ <li><a href="/en/JS_FN" title="en/JS_FN">JS_FN</a></li>
+ <li><a href="/en/JS_FS_END" title="en/JS_FS_END">JS_FS_END</a></li>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSPropertySpec" title="en/JSPropertySpec">JSPropertySpec</a></li>
+</ul>
+<p><code>JSFastNative</code> methods use these macros:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSFastNative" title="en/JSFastNative">JS_CALLEE</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSFastNative" title="en/JSFastNative">JS_THIS</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSFastNative" title="en/JSFastNative">JS_THIS_OBJECT</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSFastNative" title="en/JSFastNative">JS_ARGV</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSFastNative" title="en/JSFastNative">JS_RVAL</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSFastNative" title="en/JSFastNative">JS_SET_RVAL</a></li>
+</ul>
+<p>The behavior of a <code>JSClass</code> and its instances can be customized in many ways using callback functions.</p>
+<p><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass" title="en/JSClass">JSClass</a> method types:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.addProperty" title="en/JSClass.addProperty">JSPropertyOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSEnumerateOp" title="en/JSEnumerateOp">JSEnumerateOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.enumerate" title="en/JSClass.enumerate">JSNewEnumerateOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.resolve" title="en/JSClass.resolve">JSResolveOp</a></li>
+ <li><a href="/En/SpiderMonkey/JSAPI_Reference/JSNewResolveOp" title="en/JSNewResolveOp">JSNewResolveOp</a> – <a href="/En/SpiderMonkey/JSAPI_Reference/JSNewResolveOp" title="en/JSNewResolveOp">JSRESOLVE_ASSIGNING</a>, <a href="/En/SpiderMonkey/JSAPI_Reference/JSNewResolveOp" title="en/JSNewResolveOp">JSRESOLVE_CLASSNAME</a>, <a href="/En/SpiderMonkey/JSAPI_Reference/JSNewResolveOp" title="en/JSNewResolveOp">JSRESOLVE_DECLARING</a>, <a href="/En/SpiderMonkey/JSAPI_Reference/JSNewResolveOp" title="en/JSNewResolveOp">JSRESOLVE_DETECTING</a>, <a href="/En/SpiderMonkey/JSAPI_Reference/JSNewResolveOp" title="en/JSNewResolveOp">JSRESOLVE_QUALIFIED</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.defaultValue" title="en/JSObjectOps.defaultValue">JSConvertOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.finalize" title="en/JSClass.finalize">JSFinalizeOp</a></li>
+ <li><a href="/en/JSClass.getObjectOps" title="en/JSClass.getObjectOps">JSGetObjectOps</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.checkAccess" title="en/JSClass.checkAccess">JSCheckAccessOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.xdrObject" title="en/JSClass.xdrObject">JSXDRObjectOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.hasInstance" title="en/JSClass.hasInstance">JSHasInstanceOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.mark" title="en/JSClass.mark">JSMarkOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSTraceOp" title="en/JSTraceOp">JSTraceOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.reserveSlots" title="en/JSClass.reserveSlots">JSReserveSlotsOp</a></li>
+</ul>
+<p><a href="/en/SpiderMonkey/JSAPI_Reference/JSExtendedClass" title="en/JSExtendedClass">JSExtendedClass</a> method types:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSExtendedClass.iteratorObject" title="en/JSExtendedClass.iteratorObject">JSIteratorOp</a></li>
+ <li><a href="/en/JSEqualityOp" title="en/JSEqualityOp">JSEqualityOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOp" title="en/JSObjectOp">JSObjectOp</a></li>
+</ul>
+<p><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps" title="en/JSObjectOps">JSObjectOps</a> method types:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.newObjectMap" title="en/JSObjectOps.newObjectMap">JSNewObjectMapOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.destroyObjectMap" title="en/JSObjectOps.destroyObjectMap">JSObjectMapOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.lookupProperty" title="en/JSObjectOps.lookupProperty">JSLookupPropOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.defineProperty" title="en/JSObjectOps.defineProperty">JSDefinePropOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.getProperty" title="en/JSObjectOps.getProperty">JSPropertyIdOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.getAttributes" title="en/JSObjectOps.getAttributes">JSAttributesOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.defaultValue" title="en/JSObjectOps.defaultValue">JSConvertOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.enumerate" title="en/JSClass.enumerate">JSNewEnumerateOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.checkAccess" title="en/JSObjectOps.checkAccess">JSCheckAccessIdOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOp" title="en/JSObjectOp">JSObjectOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.dropProperty" title="en/JSObjectOps.dropProperty">JSPropertyRefOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.xdrObject" title="en/JSClass.xdrObject">JSXDRObjectOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.hasInstance" title="en/JSClass.hasInstance">JSHasInstanceOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.setProto" title="en/JSObjectOps.setProto">JSSetObjectSlotOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSTraceOp" title="en/JSTraceOp">JSTraceOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.finalize" title="en/JSClass.finalize">JSFinalizeOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.getRequiredSlot" title="en/JSObjectOps.getRequiredSlot">JSGetRequiredSlotOp</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.getRequiredSlot" title="en/JSObjectOps.getRequiredSlot">JSSetRequiredSlotOp</a></li>
+</ul>
+<p><a href="/en/SpiderMonkey/JSAPI_Reference/JSXMLObjectOps" title="en/JSXMLObjectOps">JSXMLObjectOps</a> method types:</p>
+<ul>
+ <li><a href="/en/JSGetMethodOp" title="en/JSGetMethodOp">JSGetMethodOp</a></li>
+ <li><a href="/en/JSSetMethodOp" title="en/JSSetMethodOp">JSSetMethodOp</a></li>
+ <li><a href="/en/JSEnumerateValuesOp" title="en/JSEnumerateValuesOp">JSEnumerateValuesOp</a></li>
+ <li><a href="/en/JSEqualityOp" title="en/JSEqualityOp">JSEqualityOp</a></li>
+ <li><a href="/en/JSConcatenateOp" title="en/JSConcatenateOp">JSConcatenateOp</a></li>
+</ul>
+<p>These stub functions can be used when creating a custom <code>JSClass</code>:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_PropertyStub" title="en/JS_PropertyStub">JS_ConvertStub</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_PropertyStub" title="en/JS_PropertyStub">JS_EnumerateStub</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_PropertyStub" title="en/JS_PropertyStub">JS_FinalizeStub</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_PropertyStub" title="en/JS_PropertyStub">JS_PropertyStub</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_PropertyStub" title="en/JS_PropertyStub">JS_ResolveStub</a></li>
+</ul>
+<p>The behavior of a <code>JSClass</code> can be customized using these flags:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSClass.flags</a> – <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_CONSTUCT_PROTOTYPE</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_GLOBAL_FLAGS</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_HAS_PRIVATE</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_HAS_RESERVED_SLOTS</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_IS_EXTENDED</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_MARK_IS_TRACE</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_NEW_ENUMERATE</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_NEW_RESOLVE</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_NEW_RESOLVE_GETS_START</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_PRIVATE_IS_NSISUPPORTS</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.flags" title="en/JSClass.flags">JSCLASS_SHARE_ALL_PROPERTIES</a></li>
+</ul>
+<h3 id="Arrays" name="Arrays">Arrays</h3>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewArrayObject" title="en/JS_NewArrayObject">JS_NewArrayObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_IsArrayObject" title="en/JS_IsArrayObject">JS_IsArrayObject</a></li>
+</ul>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_HasArrayLength" title="en/JS_HasArrayLength">JS_HasArrayLength</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetArrayLength" title="en/JS_GetArrayLength">JS_GetArrayLength</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetArrayLength" title="en/JS_SetArrayLength">JS_SetArrayLength</a></li>
+</ul>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AliasElement" title="en/JS_AliasElement">JS_AliasElement</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefineElement" title="en/JS_DefineElement">JS_DefineElement</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DeleteElement" title="en/JS_DeleteElement">JS_DeleteElement</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DeleteElement2" title="en/JS_DeleteElement2">JS_DeleteElement2</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetElement" title="en/JS_GetElement">JS_GetElement</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_LookupElement" title="en/JS_LookupElement">JS_LookupElement</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetElement" title="en/JS_SetElement">JS_SetElement</a></li>
+</ul>
+<h3 id="Functions" name="Functions">Functions</h3>
+<p>Calling a function or a method of an object:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CallFunction" title="en/JS_CallFunction">JS_CallFunction</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CallFunctionName" title="en/JS_CallFunctionName">JS_CallFunctionName</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CallFunctionValue" title="en/JS_CallFunctionValue">JS_CallFunctionValue</a></li>
+</ul>
+<p>Function accessors:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ObjectIsFunction" title="en/JS_ObjectIsFunction">JS_ObjectIsFunction</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetFunctionArity" title="en/JS_GetFunctionArity">JS_GetFunctionArity</a></li>
+ <li><a href="/en/JS_GetFunctionFlags" title="en/JS_GetFunctionFlags">JS_GetFunctionFlags</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetFunctionId" title="en/JS_GetFunctionId">JS_GetFunctionId</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetFunctionName" title="en/JS_GetFunctionName">JS_GetFunctionName</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetFunctionObject" title="en/JS_GetFunctionObject">JS_GetFunctionObject</a></li>
+</ul>
+<p>Creating functions:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CloneFunctionObject" title="en/JS_CloneFunctionObject">JS_CloneFunctionObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefineFunction" title="en/JS_DefineFunction">JS_DefineFunction</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefineFunction" title="en/JS_DefineFunction">JS_DefineUCFunction</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_DefineFunctions" title="en/JS_DefineFunctions">JS_DefineFunctions</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewFunction" title="en/JS_NewFunction">JS_NewFunction</a></li>
+</ul>
+<h3 id="RegExps" name="RegExps">RegExps</h3>
+<ul>
+ <li><a href="/En/SpiderMonkey/JSAPI_Reference/JS_NewRegExpObject" title="En/SpiderMonkey/JSAPI_Reference/JS_NewRegExpObject">JS_NewRegExpObject</a></li>
+ <li><a href="/En/SpiderMonkey/JSAPI_Reference/JS_NewRegExpObject" title="En/SpiderMonkey/JSAPI_Reference/JS_NewRegExpObject">JS_NewUCRegExpObject</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetRegExpInput" title="en/SpiderMonkey/JSAPI_Reference/JS_SetRegExpInput">JS_SetRegExpInput</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ClearRegExpRoots" title="en/SpiderMonkey/JSAPI_Reference/JS_ClearRegExpRoots">JS_ClearRegExpRoots</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ClearRegExpStatics" title="en/SpiderMonkey/JSAPI_Reference/JS_ClearRegExpStatics">JS_ClearRegExpStatics</a></li>
+</ul>
+<h3 id="Security" name="Security">Security</h3>
+<ul>
+ <li>struct <a href="/en/SpiderMonkey/JSAPI_Reference/JSPrincipals" title="en/JSPrincipals">JSPrincipals</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSPRINCIPALS_HOLD" title="en/JSPRINCIPALS_HOLD">JSPRINCIPALS_HOLD</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JSPRINCIPALS_HOLD" title="en/JSPRINCIPALS_HOLD">JSPRINCIPALS_DROP</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetObjectPrincipalsFinder" title="en/JS_SetObjectPrincipalsFinder">JS_SetObjectPrincipalsFinder</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetPrincipalsTranscoder" title="en/JS_SetPrincipalsTranscoder">JS_SetPrincipalsTranscoder</a></li>
+</ul>
+<ul>
+ <li>enum <a href="/en/SpiderMonkey/JSAPI_Reference/JS_CheckAccess" title="en/JS_CheckAccess">JSAccessMode</a> – <a href="/en/SpiderMonkey/JSAPI_Reference/JS_CheckAccess" title="en/JS_CheckAccess">JSACC_PROTO</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_CheckAccess" title="en/JS_CheckAccess">JSACC_PARENT</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_CheckAccess" title="en/JS_CheckAccess">JSACC_IMPORT</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_CheckAccess" title="en/JS_CheckAccess">JSACC_WATCH</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_CheckAccess" title="en/JS_CheckAccess">JSACC_READ</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_CheckAccess" title="en/JS_CheckAccess">JSACC_WRITE</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CheckAccess" title="en/JS_CheckAccess">JS_CheckAccess</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.checkAccess" title="en/JSObjectOps.checkAccess">JSObjectOps.checkAccess</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.checkAccess" title="en/JSClass.checkAccess">JSClass.checkAccess</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetCheckObjectAccessCallback" title="en/JS_SetCheckObjectAccessCallback">JS_SetCheckObjectAccessCallback</a></li>
+</ul>
+<h3 id="Threading" name="Threading">Threading</h3>
+<p>The following functions support the SpiderMonkey threading model. They are only available in <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_THREADSAFE" title="en/JS_THREADSAFE">JS_THREADSAFE</a></code> builds.</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_BeginRequest" title="en/JS_BeginRequest">JS_BeginRequest</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_BeginRequest" title="en/JS_BeginRequest">JS_EndRequest</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_YieldRequest" title="en/JS_YieldRequest">JS_YieldRequest</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SuspendRequest" title="en/JS_SuspendRequest">JS_SuspendRequest</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SuspendRequest" title="en/JS_SuspendRequest">JS_ResumeRequest</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetContextThread" title="en/JS_GetContextThread">JS_GetContextThread</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ClearContextThread" title="en/JS_ClearContextThread">JS_SetContextThread</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ClearContextThread" title="en/JS_ClearContextThread">JS_ClearContextThread</a></li>
+</ul>
+<p>The following functions exist in all builds, but in non-<code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_THREADSAFE" title="en/JS_THREADSAFE">JS_THREADSAFE</a></code> builds, they do nothing:</p>
+<ul>
+ <li><a href="/en/JS_LockRuntime" title="en/JS_LockRuntime">JS_LockRuntime</a></li>
+ <li><a href="/en/JS_UnlockRuntime" title="en/JS_UnlockRuntime">JS_UnlockRuntime</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_Lock" title="en/JS_Lock">JS_Lock</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_Unlock" title="en/JS_Unlock">JS_Unlock</a> {{ Deprecated_inline() }}</li>
+</ul>
+<h3 id="Time" name="Time">Time</h3>
+<ul>
+ <li><a href="/en/JS_Now" title="en/JS_Now">JS_Now</a></li>
+</ul>
+<h3 id="Callback_Types" name="Callback_Types">Callback Types</h3>
+<p>Native function types:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSNative" title="en/JSNative">JSNative</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSFastNative" title="en/JSFastNative">JSFastNative</a></li>
+</ul>
+<p>Other callback types:</p>
+<ul>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddExternalStringFinalizer" title="en/JS_AddExternalStringFinalizer">JSStringFinalizeOp</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddExternalStringFinalizer" title="en/JS_AddExternalStringFinalizer">JS_AddExternalStringFinalizer</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_TRACER_INIT" title="en/JS_TRACER_INIT">JSTraceCallback</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_TRACER_INIT" title="en/JS_TRACER_INIT">JS_TRACER_INIT</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SET_TRACING_DETAILS" title="en/JS_SET_TRACING_DETAILS">JSTraceNamePrinter</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SET_TRACING_DETAILS" title="en/JS_SET_TRACING_DETAILS">JS_SET_TRACING_DETAILS</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetContextCallback" title="en/JS_SetContextCallback">JSContextCallback</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetContextCallback" title="en/JS_SetContextCallback">JS_SetContextCallback</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCCallback" title="en/JS_SetGCCallback">JSGCCallback</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetGCCallback" title="en/JS_SetGCCallback">JS_SetGCCallback</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetExtraGCRoots" title="en/JS_SetExtraGCRoots">JSTraceDataOp</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetExtraGCRoots" title="en/JS_SetExtraGCRoots">JS_SetExtraGCRoots</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetBranchCallback" title="en/JS_SetBranchCallback">JSBranchCallback</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetBranchCallback" title="en/JS_SetBranchCallback">JS_SetBranchCallback</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetErrorReporter" title="en/JS_SetErrorReporter">JSErrorReporter</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetErrorReporter" title="en/JS_SetErrorReporter">JS_SetErrorReporter</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ReportErrorNumber" title="en/JS_ReportErrorNumber">JSErrorCallback</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ReportErrorNumber" title="en/JS_ReportErrorNumber">JS_ReportErrorNumber</a> and friends</li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddArgumentFormatter" title="en/JS_AddArgumentFormatter">JSArgumentFormatter</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddArgumentFormatter" title="en/JS_AddArgumentFormatter">JS_AddArgumentFormatter</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetPrincipalsTranscoder" title="en/JS_SetPrincipalsTranscoder">JSPrincipalsTranscoder</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetPrincipalsTranscoder" title="en/JS_SetPrincipalsTranscoder">JS_SetPrincipalsTranscoder</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetObjectPrincipalsFinder" title="en/JS_SetObjectPrincipalsFinder">JSObjectPrincipalsFinder</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetObjectPrincipalsFinder" title="en/JS_SetObjectPrincipalsFinder">JS_SetObjectPrincipalsFinder</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_MapGCRoots" title="en/JS_MapGCRoots">JSGCRootMapFun</a> - used by <a href="/en/SpiderMonkey/JSAPI_Reference/JS_MapGCRoots" title="en/JS_MapGCRoots">JS_MapGCRoots</a></li>
+</ul>
+<p>See also <a href="#Classes">Classes</a>, above.</p>
+<h3 id="Macros" name="Macros">Macros</h3>
+<ul>
+ <li><a href="/en/JS_DEFAULT_XML_NAMESPACE_ID" title="en/JS_DEFAULT_XML_NAMESPACE_ID">JS_DEFAULT_XML_NAMESPACE_ID</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSFUN_BOUND_METHOD" title="en/JSFUN_BOUND_METHOD">JSFUN_BOUND_METHOD</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/JSFUN_GETTER" title="en/JSFUN_GETTER">JSFUN_GETTER</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JSFUN_GLOBAL_PARENT" title="en/JSFUN_GLOBAL_PARENT">JSFUN_GLOBAL_PARENT</a> {{ Deprecated_inline() }}</li>
+ <li><a href="/en/JSFUN_HEAVYWEIGHT" title="en/JSFUN_HEAVYWEIGHT">JSFUN_HEAVYWEIGHT</a></li>
+ <li><a href="/en/JSFUN_LAMBDA" title="en/JSFUN_LAMBDA">JSFUN_LAMBDA</a></li>
+ <li><a href="/en/JSFUN_SETTER" title="en/JSFUN_SETTER">JSFUN_SETTER</a></li>
+ <li><a href="/en/JSREG_GLOB" title="en/JSREG_GLOB">JSREG_GLOB</a></li>
+ <li><a href="/en/JSREG_FOLD" title="en/JSREG_FOLD">JSREG_FOLD</a></li>
+ <li><a href="/en/JSREG_MULTILINE" title="en/JSREG_MULTILINE">JSREG_MULTILINE</a></li>
+</ul>
+<h3 id="Preprocessor_conditionals" name="Preprocessor_conditionals">Preprocessor conditionals</h3>
+<ul>
+ <li><a href="/en/BUILD_OPT" title="en/BUILD_OPT">BUILD_OPT</a></li>
+ <li><a href="/en/GC_MARK_DEBUG" title="en/GC_MARK_DEBUG">GC_MARK_DEBUG</a></li>
+ <li><a href="/en/SpiderMonkey/JSAPI_Reference/JS_THREADSAFE" title="en/JS_THREADSAFE">JS_THREADSAFE</a></li>
+</ul>
+<p>These defines are useful for tuning SpiderMonkey performance:</p>
+<ul>
+ <li><a href="/en/JS_ARENAMETER" title="en/JS_ARENAMETER">JS_ARENAMETER</a> - Arena package instrumentation.</li>
+ <li><a href="/en/JS_GCMETER" title="en/JS_GCMETER">JS_GCMETER</a> - GC instrumentation.</li>
+ <li><a href="/en/JS_HASHMETER" title="en/JS_HASHMETER">JS_HASHMETER</a> - Hash table package instrumentation.</li>
+</ul>
+<h3 id="C.2B.2B_features" name="C.2B.2B_features">C++ features</h3>
+<ul>
+ <li>class <a href="/en/JSAutoRequest" title="en/JSAutoRequest">JSAutoRequest</a></li>
+ <li>class <a href="/en/JSAutoLocalRootScope" title="en/JSAutoLocalRootScope">JSAutoLocalRootScope</a></li>
+</ul>
+<p>{{ languages( { "ja": "ja/JSAPI_Reference", "pl": "pl/Dokumentacja_JSAPI" } ) }}</p>
+<h1 id="JSAPI_参考">JSAPI 参考</h1>
+<p> </p>
+<h3 id=".E6.95.B0.E6.8D.AE.E7.BB.93.E6.9E.84" name=".E6.95.B0.E6.8D.AE.E7.BB.93.E6.9E.84">数据结构</h3>
+<ul>
+ <li><a href="/cn/JSClass" title="cn/JSClass">JS类</a></li>
+ <li><a href="/cn/JSConstDoubleSpec" title="cn/JSConstDoubleSpec">JSConstDoubleSpec</a></li>
+ <li><a href="/cn/JSErrorReport" title="cn/JSErrorReport">JS错误报告</a></li>
+ <li><a href="/cn/JSFunctionSpec" title="cn/JSFunctionSpec">JS函数规范</a></li>
+ <li><a href="/cn/JSIdArray" title="cn/JSIdArray">JSIdArray</a></li>
+ <li><a href="/cn/JSObjectOps" title="cn/JSObjectOps">JS对象操作</a></li>
+ <li><a href="/cn/JSPrincipals" title="cn/JSPrincipals">JSPrincipals</a></li>
+ <li><a href="/cn/JSProperty" title="cn/JSProperty">JS属性</a></li>
+ <li><a href="/cn/JSPropertySpec" title="cn/JSPropertySpec">JS属性规范</a></li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_defineconstdoubles/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_defineconstdoubles/index.html
new file mode 100644
index 0000000000..82835b714d
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_defineconstdoubles/index.html
@@ -0,0 +1,59 @@
+---
+title: JS DefineConstDoubles
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_DefineConstDoubles
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_DefineConstDoubles
+---
+<h3 id=".E6.91.98.E8.A6.81" name=".E6.91.98.E8.A6.81">摘要</h3>
+<p>为对象创建一个或多个包含双浮点值的属性。</p>
+<h3 id=".E8.AF.AD.E6.B3.95" name=".E8.AF.AD.E6.B3.95">语法</h3>
+<pre> JSBool JS_DefineConstDoubles(JSContext *cx, JSObject *obj,
+ JSConstDoubleSpec *cds);
+</pre>
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>名称</th>
+ <th>类型</th>
+ <th>描述</th>
+ </tr>
+ <tr>
+ <td>cx</td>
+ <td>JSContext *</td>
+ <td>指向JS运行时信息内容的指针。</td>
+ </tr>
+ <tr>
+ <td>obj</td>
+ <td>JSObject *</td>
+ <td>指向新建的属性的对象指针。</td>
+ </tr>
+ <tr>
+ <td>cds</td>
+ <td>JSConstDoubleSpec *</td>
+ <td>指向创建的包含双浮点属性值和属性名的结构化数组的指针。最后一个数组元素必须包含一个为零值的成员。</td>
+ </tr>
+ </tbody>
+</table>
+<h3 id=".E6.8F.8F.E8.BF.B0" name=".E6.8F.8F.E8.BF.B0">描述</h3>
+<p><code>JS_DefineConstDoubles</code>为特定的对象创建一个或多个成员变量,<code>obj</code>, 每个成员变量包含一个双浮点类型的值。每个成员变量在<code>JSConstDoubleSpec</code>结构中的<code>flags</code>字段被自动声名并由<code>cds</code>传递指针。 如果<code>flags</code>被设为<code>0</code>值, 成员变量的属性会自动被设为<code>JSPROP_PERMANENT 或 JSPROP_READONLY</code>。</p>
+<p><code>cds</code> 是一个指向具有<code>JSConstDoubleSpec</code>结构的数组的第一个元素的指针。每个数组元素定义独立的变量名和变量值。数组的最后一个元素的<code>name</code>字段必须是0。<code>JS_DefineConstDoubles</code>为数组中的每一个名称字段不为零的元素建立一个成员变量。</p>
+<p>通常情况下, <code>JS_DefineConstDoubles</code> 返回 <code>JS_TRUE</code>, 表明它在数组中已经建立了所有的属性列表。除此之外的情况下它返回<code>JS_FALSE</code>。</p>
+<h2 id=".E6.9B.B4.E5.A4.9A.E5.8F.82.E8.80.83" name=".E6.9B.B4.E5.A4.9A.E5.8F.82.E8.80.83">更多参考</h2>
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <td>新闻组</td>
+ <td><a href="cn/JSAPI_%e5%8f%82%e8%80%83#Functions">Functions</a></td>
+ </tr>
+ <tr>
+ <td>文档</td>
+ <td><a class="external" href="http://lxr.mozilla.org/mozilla/ident?i=JS_DefineConstDoubles">LXRSearch</a></td>
+ </tr>
+ <tr>
+ <td>章节</td>
+ <td>
+ <p><a href="cn/JSConstDoubleSpec">JSConstDoubleSpec</a>, <a href="cn/JS_DefineElement">JS_DefineElement</a>, <a href="cn/JS_DefineFunction">JS_DefineFunction</a>, <a href="cn/JS_DefineFunctions">JS_DefineFunctions</a>, <a href="cn/JS_DefineObject">JS_DefineObject</a>, <a href="cn/JS_DefineProperties">JS_DefineProperties</a>, <a href="cn/JS_DefineProperty">JS_DefineProperty</a>, <a href="cn/JS_DefinePropertyWithTinyId">JS_DefinePropertyWithTinyId</a></p>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<p> </p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_doublecolon_call/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_doublecolon_call/index.html
new file mode 100644
index 0000000000..a0c3d1239a
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_doublecolon_call/index.html
@@ -0,0 +1,92 @@
+---
+title: 'JS::Call'
+slug: 'Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS::Call'
+translation_of: 'Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS::Call'
+---
+<div>{{SpiderMonkeySidebar("JSAPI")}}</div>
+
+<div>{{ jsapi_minversion_header("17") }}</div>
+
+
+<div class="summary">
+<p><font><font>调用指定的JS函数。</font></font></p>
+</div>
+
+<h2 id="Syntax" name="Syntax"><font><font>句法</font></font></h2>
+
+<pre class="brush: cpp notranslate">bool
+JS::Call(JSContext *cx, JS::HandleObject thisObj, JS::HandleFunction fun,
+ const JS::HandleValueArray &amp;args, JS::MutableHandleValue rval);
+
+bool
+JS::Call(JSContext *cx, JS::HandleObject thisObj, const char *name,
+ const JS::HandleValueArray&amp; args, JS::MutableHandleValue rval);
+
+bool
+JS::Call(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue fun,
+ const JS::HandleValueArray&amp; args, JS::MutableHandleValue rval);
+
+bool
+JS::Call(JSContext *cx, JS::HandleValue thisv, JS::HandleValue fun,
+ const JS::HandleValueArray&amp; args, JS::MutableHandleValue rval);
+
+bool
+JS::Call(JSContext *cx, JS::HandleValue thisv, JS::HandleObject funObj,
+ const JS::HandleValueArray&amp; args, JS::MutableHandleValue rval);
+</pre>
+
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th><font><font>名称</font></font></th>
+ <th><font><font>类型</font></font></th>
+ <th><font><font>描述</font></font></th>
+ </tr>
+ <tr>
+ <td><code>cx</code></td>
+ <td>{{jsapixref("JSRuntime", "JSContext *")}}</td>
+ <td><font><font>指向JS上下文的指针,从中可以派生运行时信息。</font><font>{{Jsapi-requires-request()}}</font></font></td>
+ </tr>
+ <tr>
+ <td><code>thisObj</code></td>
+ <td>{{jsapixref("JSObject", "JS::HandleObject")}} / {{jsapixref("JS::Value", "JS::HandleValue")}}</td>
+ <td>The "current" object on which the function operates; the object specified here is "this" when the function executes.</td>
+ </tr>
+ <tr>
+ <td><code>fun</code> / <code>funObj</code></td>
+ <td>{{jsapixref("JSFunction", "JS::HandleFunction")}} / {{jsapixref("JS::Value", "JS::HandleValue")}} / {{jsapixref("JSObject", "JS::HandleObject")}}</td>
+ <td>Pointer to the function to call. <strong>Should be a native function or JSAPI-compiled function.</strong></td>
+ </tr>
+ <tr>
+ <td><code>name</code></td>
+ <td><code>const char *</code></td>
+ <td>Pointer to the function name to call.</td>
+ </tr>
+ <tr>
+ <td><code>args</code></td>
+ <td>{{jsapixref("JS::HandleValueArray", "JS::HandleValueArray &amp;")}}</td>
+ <td>Arguments to pass to the function.</td>
+ </tr>
+ <tr>
+ <td><code>rval</code></td>
+ <td>{{jsapixref("JS::Value", "JS::MutableHandleValue")}}</td>
+ <td>Out parameter. On success, <code>*rval</code> receives the return value from the function call.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Description" name="Description">Description</h2>
+
+<p><code>JS::Call</code><code>fun</code><font><font>在对象上</font><font>调用指定的函数</font></font><code>thisObj</code><font><font>。</font><font>在函数执行方面,该对象被视为</font></font><code>this</code><font><font>。</font></font></p>
+
+<p><font><font>有关更多详细信息,请参阅{{jsapixref("JS_CallFunction")}},{{jsapixref("JS_CallFunctionName")}}和{{jsapixref("JS_CallFunctionValue")}}。</font></font></p>
+
+<h2 id="See_Also" name="See_Also"><font><font>也可以看看</font></font></h2>
+
+<ul>
+ <li>{{ LXRSearch("ident", "i", "JS::Call") }}</li>
+ <li>{{jsapixref("JS_CallFunction")}}</li>
+ <li>{{jsapixref("JS_CallFunctionName")}}</li>
+ <li>{{jsapixref("JS_CallFunctionValue")}}</li>
+ <li>{{bug(601168)}}</li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_doublecolon_ordinarytoprimitive/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_doublecolon_ordinarytoprimitive/index.html
new file mode 100644
index 0000000000..b09164ee56
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_doublecolon_ordinarytoprimitive/index.html
@@ -0,0 +1,66 @@
+---
+title: 'JS::OrdinaryToPrimitive'
+slug: 'Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS::OrdinaryToPrimitive'
+translation_of: 'Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS::OrdinaryToPrimitive'
+---
+<div>{{SpiderMonkeySidebar("JSAPI")}}</div>
+
+<p>{{ jsapi_minversion_header("38") }}</p>
+
+<div class="summary">
+<p>将普通对象转换为原始值</p>
+</div>
+
+<h2 id="语法说明">语法说明</h2>
+
+<pre class="brush: cpp">bool
+JS::OrdinaryToPrimitive(JSContext *cx, JS::HandleObject obj, JSType type,
+ JS::MutableHandleValue vp);</pre>
+
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>名称</th>
+ <th>类型</th>
+ <th>描述</th>
+ </tr>
+ <tr>
+ <td><code>cx</code></td>
+ <td>{{jsapixref("JSRuntime", "JSContext *")}}</td>
+ <td>执行转换的上下文. {{ Jsapi-requires-request() }}</td>
+ </tr>
+ <tr>
+ <td><code>obj</code></td>
+ <td>{{jsapixref("JSObject", "JS::HandleObject")}}</td>
+ <td>要转换的对象。</td>
+ </tr>
+ <tr>
+ <td><code>type</code></td>
+ <td>{{jsapixref("JSType")}}</td>
+ <td>转换后值的类型。</td>
+ </tr>
+ <tr>
+ <td><code>vp</code></td>
+ <td>{{jsapixref("JS::Value", "JS::MutableHandleValue")}}</td>
+ <td>输出参数. 成功, <code>*vp 收到转换后的值</code></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="描述">描述</h2>
+
+<p><code>JS::OrdinaryToPrimitive</code> 通过ES6 draft rev 28(2014年10月14日)7.1.1第二算法中指定的算法将JavaScript对象转换为指定的类型值。</p>
+
+<p>Most users should not call this -- use {{jsapixref("JS::ToNumber")}}, {{jsapixref("JS::ToBoolean")}}, or {{jsapixref("JS::ToString")}} instead. This should only be called from custom convert hooks. It implements the default conversion behavior shared by most objects in JS, so it's useful as a fallback.</p>
+
+<p>On success, <code>JS::OrdinaryToPrimitive</code> stores the converted value in <code>*vp</code> and returns <code>true</code>. On error or exception, it returns <code>false</code>, and the value left in <code>*vp</code> is undefined.</p>
+
+<h2 id="See_Also" name="See_Also">了解其他</h2>
+
+<ul>
+ <li>{{ LXRSearch("ident", "i", "JS::OrdinaryToPrimitive") }}</li>
+ <li>{{jsapixref("JS::ToNumber")}}</li>
+ <li>{{jsapixref("JS::ToBoolean")}}</li>
+ <li>{{jsapixref("JS::ToString")}}</li>
+ <li>{{bug(1103152)}}</li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_evaluatescript/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_evaluatescript/index.html
new file mode 100644
index 0000000000..94454ee794
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_evaluatescript/index.html
@@ -0,0 +1,69 @@
+---
+title: SpiderMonkey/JSAPI_参考/JS_EvaluateScript
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_EvaluateScript
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_EvaluateScript
+---
+<p>编译并执行一个脚本。</p>
+<h2 id="Syntax" name="Syntax">语法</h2>
+<pre class="eval"><a href="/En/SpiderMonkey/JSAPI_Reference/JSBool" title="en/JSBool">JSBool</a> <strong>JS_EvaluateScript</strong>(<a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *cx, <a href="/en/SpiderMonkey/JSAPI_Reference/JSObject" title="en/JSObject">JSObject</a> *obj,
+ const char *src, <a href="/en/SpiderMonkey/JSAPI_Reference/jsint" title="en/jsint">uintN</a> length, const char *filename,
+ <a href="/en/SpiderMonkey/JSAPI_Reference/jsint" title="en/jsint">uintN</a> lineno, <a href="/En/SpiderMonkey/JSAPI_Reference/Jsval" title="en/jsval">jsval</a> *rval);
+
+<a href="/En/SpiderMonkey/JSAPI_Reference/JSBool" title="en/JSBool">JSBool</a> <strong>JS_EvaluateUCScript</strong>(<a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *cx, <a href="/en/SpiderMonkey/JSAPI_Reference/JSObject" title="en/JSObject">JSObject</a> *obj,
+ const <a href="/en/SpiderMonkey/JSAPI_Reference/jschar" title="en/jschar">jschar</a> *src, <a href="/en/SpiderMonkey/JSAPI_Reference/jsint" title="en/jsint">uintN</a> length, const char *filename,
+ <a href="/en/SpiderMonkey/JSAPI_Reference/jsint" title="en/jsint">uintN</a> lineno, <a href="/En/SpiderMonkey/JSAPI_Reference/Jsval" title="en/jsval">jsval</a> *rval);
+</pre>
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>名称</th>
+ <th>数据类型</th>
+ <th>描述</th>
+ </tr>
+ <tr>
+ <td><code>cx</code></td>
+ <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *</code></td>
+ <td>脚本运行的上下文. {{ Jsapi-requires-request() }}</td>
+ </tr>
+ <tr>
+ <td><code>obj</code></td>
+ <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JSObject" title="en/JSObject">JSObject</a> *</code></td>
+ <td>The scope in which to execute the script. This parameter is documented in detail at <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ExecuteScript" title="en/JS_ExecuteScript">JS_ExecuteScript</a></code>.</td>
+ </tr>
+ <tr>
+ <td><code>src</code></td>
+ <td><code>const char *</code> <em>or</em> <code>const <a href="/en/SpiderMonkey/JSAPI_Reference/jschar" title="en/jschar">jschar</a> *</code></td>
+ <td>包含要编译和执行的脚本的字符串.</td>
+ </tr>
+ <tr>
+ <td><code>length</code></td>
+ <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/jsint" title="en/jsint">uintN</a></code></td>
+ <td><code>src的长度</code>, in characters.</td>
+ </tr>
+ <tr>
+ <td><code>filename</code></td>
+ <td><code>const char *</code></td>
+ <td>Name of file or URL containing the script. Used to report filename or URL in error messages.</td>
+ </tr>
+ <tr>
+ <td><code>lineno</code></td>
+ <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/jsint" title="en/jsint">uintN</a></code></td>
+ <td>Line number. Used to report the offending line in the file or URL if an error occurs.</td>
+ </tr>
+ <tr>
+ <td><code>rval</code></td>
+ <td><code><a href="/En/SpiderMonkey/JSAPI_Reference/Jsval" title="en/jsval">jsval</a> *</code></td>
+ <td>Out parameter. On success, <code>*rval</code> receives the value of the last-executed expression statement processed in the script.</td>
+ </tr>
+ </tbody>
+</table>
+<h2 id="Description" name="Description">描述</h2>
+<p><code>JS_EvaluateScript</code> compiles and executes a script in the specified scope, <code>obj</code>. On successful completion, <code>rval</code> is a pointer to a variable that holds the value from the last executed expression statement processed in the script. <code>JS_EvaluateUCScript</code> is the Unicode version of the function.</p>
+<p><code>src</code> is the string containing the text of the script. <code>length</code> indicates the size of the text version of the script in characters.</p>
+<p><code>filename</code> is the name of the file (or URL) containing the script. This information is used in messages if an error occurs during compilation. Similarly, <code>lineno</code> is used to report the line number of the script or file where an error occurred during compilation.</p>
+<p>If a script compiles and executes successfully, <code>*rval</code> receives the value from the last-executed expression statement in the script, and <code>JS_EvaluateScript</code> or <code>JS_EvaluateUCScript</code> returns <code>JS_TRUE</code>. Otherwise it returns <code>JS_FALSE</code> and the value left in <code>*rval</code> is undefined.</p>
+<h2 id="See_Also" name="See_Also">See Also</h2>
+<p>{{ LXRSearch("ident", "i", "JS_EvaluateScript") }}<br>
+ {{ LXRSearch("ident", "i", "JS_EvaluateUCScript") }}</p>
+<p><a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileFile" title="en/JS_CompileFile">JS_CompileFile</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_CompileScript" title="en/JS_CompileScript">JS_CompileScript</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_DecompileScript" title="en/JS_DecompileScript">JS_DecompileScript</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_DestroyScript" title="en/JS_DestroyScript">JS_DestroyScript</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_EvaluateScriptForPrincipals" title="en/JS_EvaluateScriptForPrincipals">JS_EvaluateScriptForPrincipals</a></p>
+<p>{{ languages( { "ja": "ja/JS_EvaluateScript" } ) }}</p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_getversion/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_getversion/index.html
new file mode 100644
index 0000000000..a2b2888958
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_getversion/index.html
@@ -0,0 +1,29 @@
+---
+title: SpiderMonkey/JSAPI_参考/JS_GetVersion
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_GetVersion
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_GetVersion
+---
+<p>Retrieves the JavaScript version number used within a specified executable script context.</p>
+<h2 id="Syntax" name="Syntax">语法</h2>
+<pre class="eval"><a href="/en/SpiderMonkey/JSAPI_Reference/JSVersion" title="en/JSVersion">JSVersion</a> <strong>JS_GetVersion</strong>(<a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *cx);
+</pre>
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>参数名称</th>
+ <th>类型</th>
+ <th>描述</th>
+ </tr>
+ <tr>
+ <td><code>cx</code></td>
+ <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *</code></td>
+ <td>要查询的上下文.</td>
+ </tr>
+ </tbody>
+</table>
+<h2 id="Description" name="Description">描述</h2>
+<p><code>JS_GetVersion</code> returns the JavaScript version currently used by the given <code>JSContext</code>, <code>cx</code>. The result is one of the <code><a href="/en/SpiderMonkey/JSAPI_Reference/JSVersion" title="en/JSVersion">JSVersion</a></code> constants.</p>
+<p>When a context is created, its version is initially <code>JSVERSION_DEFAULT</code>. Scripts are compiled using the latest version of the JavaScript language. To configure a context to run scripts using a specific version of JavaScript, use <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetVersion" title="en/JS_SetVersion">JS_SetVersion</a></code>.</p>
+<h2 id="See_Also" name="See_Also">请参阅</h2>
+<p>{{ LXRSearch("ident", "i", "JS_GetVersion") }}</p>
+<p><a href="/en/SpiderMonkey/JSAPI_Reference/JS_VersionToString" title="en/JS_VersionToString">JS_VersionToString</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_StringToVersion" title="en/JS_StringToVersion">JS_StringToVersion</a></p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_hasownproperty/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_hasownproperty/index.html
new file mode 100644
index 0000000000..ed6e760796
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_hasownproperty/index.html
@@ -0,0 +1,73 @@
+---
+title: JS_HasOwnProperty
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_HasOwnProperty
+tags:
+ - 中文
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_HasOwnProperty
+---
+<div>{{SpiderMonkeySidebar("JSAPI")}}</div>
+
+<p>{{ jsapi_minversion_header("45") }}</p>
+
+<div class="summary">
+<p>Determine whether a JavaScript object has a specified own property.</p>
+</div>
+
+<h2 id="Syntax" name="Syntax">Syntax</h2>
+
+<pre class="brush: cpp notranslate">bool
+JS_HasOwnProperty(JSContext* cx, HandleObject obj, const char* name,
+ bool* foundp)
+
+bool
+JS_HasOwnPropertyById(JSContext* cx, HandleObject obj, HandleId id,
+ bool* foundp)
+</pre>
+
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>Name</th>
+ <th>Type</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>cx</code></td>
+ <td>{{jsapixref("JSRuntime", "JSContext *")}}</td>
+ <td>A context. {{ Jsapi-requires-request() }}</td>
+ </tr>
+ <tr>
+ <td><code>obj</code></td>
+ <td>{{jsapixref("JSObject", "JS::HandleObject")}}</td>
+ <td>Object to search on for the property.</td>
+ </tr>
+ <tr>
+ <td><code>name</code> <em>or<em> <code>id</code></em></em></td>
+ <td><code>const char *</code> <em>or</em> {{jsapixref("jsid", "JS::HandleId")}}</td>
+ <td>Name of the property to look up.</td>
+ </tr>
+ <tr>
+ <td><code>foundp</code></td>
+ <td><code>bool *</code></td>
+ <td>Non-null pointer to a variable of type <code>bool</code>. On success, <code>JS_HasOwnProperty</code> stores <code>true</code> in this variable if <code>obj</code> has an own property with the given <code>name</code>, and <code>false</code> if not.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Description" name="Description">Description</h2>
+
+<p><strong><code>JS_HasOwnProperty</code></strong> searches an object, <code>obj</code>, for an own property with the specified <code>name</code>. It behaves like the JavaScript expression <code>Object.hasOwnProperty(obj, name)</code>. <strong><code>JS_HasOwnPropertyById</code></strong> is the same but takes a {{jsapixref("jsid", "JS::HandleId")}} for the property name.</p>
+
+<p>If the property exists, this function sets <code>*foundp</code> to <code>true</code> and returns <code>true</code>.</p>
+
+<p>If the object <code>obj</code> has no such property, the function sets <code>*foundp</code> to <code>false</code> and returns <code>true</code> (to indicate that no error occurred).</p>
+
+<p>If an error occurs during the search, the function returns <code>false</code>, and the value of <code>*foundp</code> is undefined.</p>
+
+<h2 id="See_Also" name="See_Also">See Also</h2>
+
+<ul>
+ <li>{{ LXRSearch("ident", "i", "JS_HasOwnProperty") }}</li>
+ <li>{{ LXRSearch("ident", "i", "JS_HasOwnPropertyById") }}</li>
+ <li>{{bug(1163423)}}</li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_newruntime/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_newruntime/index.html
new file mode 100644
index 0000000000..885bb3dd6e
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_newruntime/index.html
@@ -0,0 +1,33 @@
+---
+title: JS_NewRuntime
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_NewRuntime
+tags:
+ - JSAPI_Reference
+ - SpiderMonkey
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_NewRuntime
+---
+<p>Initializes the JavaScript runtime.</p>
+<h2 id="Syntax" name="Syntax">Syntax</h2>
+<pre class="eval"><a href="/zh-CN/SpiderMonkey/JSAPI_Reference/JSRuntime" title="zh-CN/JSRuntime">JSRuntime</a> * <strong>JS_NewRuntime</strong>(uint32 maxbytes);
+</pre>
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>Name</th>
+ <th>Type</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>maxbytes</code></td>
+ <td><code>uint32</code></td>
+ <td>Maximum number of allocated bytes after which garbage collection is run.</td>
+ </tr>
+ </tbody>
+</table>
+<h2 id="Description" name="Description">Description</h2>
+<p><code>JS_NewRuntime</code> initializes the JavaScript runtime environment. Call <code>JS_NewRuntime</code> before making any other API calls. <code>JS_NewRuntime</code> allocates memory for the <code>JSRuntime</code> and initializes certain internal runtime structures. <code>maxbytes</code> specifies the number of allocated bytes after which garbage collection is run.</p>
+<p>Generally speaking, most applications need only one <code><a href="/zh-CN/SpiderMonkey/JSAPI_Reference/JSRuntime" title="zh-CN/JSRuntime">JSRuntime</a></code>. In a <code><a href="/zh-CN/SpiderMonkey/JSAPI_Reference/JS_THREADSAFE" title="zh-CN/JS_THREADSAFE">JS_THREADSAFE</a></code> build, each runtime is capable of handling multiple execution threads, using one <code><a href="/zh-CN/SpiderMonkey/JSAPI_Reference/JSRuntime" title="zh-CN/JSRuntime">JSContext</a></code> per thread, sharing the same <code>JSRuntime</code>. You only need multiple runtimes if your application requires completely separate JS engines that cannot share values, objects, and functions.</p>
+<p>On success, <code>JS_NewRuntime</code> returns a pointer to the newly created runtime, which the caller must later destroy using <code><a href="/zh-CN/SpiderMonkey/JSAPI_Reference/JS_DestroyRuntime" title="zh-CN/JS_DestroyRuntime">JS_DestroyRuntime</a></code>. Otherwise it returns <code>NULL</code>.</p>
+<h3 id="Notes" name="Notes">Notes</h3>
+<p>Ordinarily, <code>JS_NewRuntime</code> should be the first JSAPI call in an application, and <code><a href="/zh-CN/SpiderMonkey/JSAPI_Reference/JS_DestroyRuntime" title="zh-CN/JS_DestroyRuntime">JS_DestroyRuntime</a></code> and <code><a href="/zh-CN/SpiderMonkey/JSAPI_Reference/JS_ShutDown" title="zh-CN/JS_ShutDown">JS_ShutDown</a></code> should be the last ones.</p>
+<p>{{ LXRSearch("ident", "i", "JS_NewRuntime") }}</p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_seterrorreporter/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_seterrorreporter/index.html
new file mode 100644
index 0000000000..e04127a541
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_seterrorreporter/index.html
@@ -0,0 +1,61 @@
+---
+title: SpiderMonkey/JSAPI_参考/JS_SetErrorReporter
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_SetErrorReporter
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_SetErrorReporter
+---
+<p>指定一个程序的错误报告途径.</p>
+<h2 id="Syntax" name="Syntax">语法</h2>
+<pre class="eval"><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetErrorReporter" title="en/JS_SetErrorReporter">JSErrorReporter</a> <strong>JS_SetErrorReporter</strong>(<a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *cx, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetErrorReporter" title="en/JS_SetErrorReporter">JSErrorReporter</a> er);
+</pre>
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>形式参数</th>
+ <th>类型</th>
+ <th>描述</th>
+ </tr>
+ <tr>
+ <td><code>cx</code></td>
+ <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *</code></td>
+ <td>Pointer to a JS context from which to derive runtime information.</td>
+ </tr>
+ <tr>
+ <td><code>er</code></td>
+ <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetErrorReporter" title="en/JS_SetErrorReporter">JSErrorReporter</a></code></td>
+ <td>在你的程序中用于报告错误的自定义函数, 见下面的描述.</td>
+ </tr>
+ </tbody>
+</table>
+<h3 id="Callback_Syntax" name="Callback_Syntax">  回调函数语法</h3>
+<pre class="eval">typedef void (*<strong>JSErrorReporter</strong>)(
+ <a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *cx, const char *message, <a href="/en/SpiderMonkey/JSAPI_Reference/JSErrorReport" title="en/JSErrorReport">JSErrorReport</a> *report);
+</pre>
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>形式参数</th>
+ <th>类型</th>
+ <th>描述</th>
+ </tr>
+ <tr>
+ <td><code>cx</code></td>
+ <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *</code></td>
+ <td>错误发生的上下文。</td>
+ </tr>
+ <tr>
+ <td><code>message</code></td>
+ <td><code>const char *</code></td>
+ <td>一个错误信息。</td>
+ </tr>
+ <tr>
+ <td><code>report</code></td>
+ <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JSErrorReport" title="en/JSErrorReport">JSErrorReport</a> *</code></td>
+ <td>一个包含错误额外的详细资料报告记录。</td>
+ </tr>
+ </tbody>
+</table>
+<h2 id="Description" name="Description">描述</h2>
+<p><code>JS_SetErrorReporter</code> enables you to define and use your own error reporting mechanism in your applications. The reporter you define is automatically passed a <code><a href="/en/SpiderMonkey/JSAPI_Reference/JSErrorReport" title="en/JSErrorReport">JSErrorReport</a></code> structure when an error occurs and has been parsed by <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ReportError" title="en/JS_ReportError">JS_ReportError</a></code>.</p>
+<p>Typically, the error reporting mechanism you define should log the error where appropriate (such as to a log file), and display an error to the user of your application. The error you log and display can make use of the information passed about the error condition in the <code>JSErrorReport</code> structure.</p>
+<p>Like all other SpiderMonkey callbacks, the error reporter callback must not throw a C++ exception.</p>
+<p>{{ LXRSearch("ident", "i", "JS_SetErrorReporter") }}</p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_valuetostring/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_valuetostring/index.html
new file mode 100644
index 0000000000..ab0e6654a4
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/js_valuetostring/index.html
@@ -0,0 +1,45 @@
+---
+title: SpiderMonkey/JSAPI_参考/JS_ValueToString
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_ValueToString
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_ValueToString
+---
+<p>把一个<code>jsval值</code> 转换成一个 <code>JSString</code>.</p>
+
+<p> </p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="eval"><a href="/en/SpiderMonkey/JSAPI_Reference/JSString" title="en/JSString">JSString</a> * <strong>JS_ValueToString</strong>(<a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *cx, <a href="/En/SpiderMonkey/JSAPI_Reference/Jsval" title="en/jsval">jsval</a> v);
+</pre>
+
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>Name</th>
+ <th>Type</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>cx</code></td>
+ <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *</code></td>
+ <td>The context in which to perform the conversion. {{ Jsapi-requires-request() }}</td>
+ </tr>
+ <tr>
+ <td><code>v</code></td>
+ <td><code><a href="/En/SpiderMonkey/JSAPI_Reference/Jsval" title="en/jsval">jsval</a></code></td>
+ <td>转换的jsval值.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p><code>JS_ValueToString</code> converts a specified JS value, <code>v</code>, to a JS string. It implements the ToString operator specified in <span class="pl-s1"><span class="pl-s">ECMA 262-3 §</span></span>9. If <code>v</code> is an object, the actual conversion is performed by its <code><a href="/en/SpiderMonkey/JSAPI_Reference/JSObjectOps.defaultValue" title="en/JSObjectOps.defaultValue">JSClass.convert</a></code> callback, which may call the JavaScript methods <code>v.toString()</code> and/or <code>v.valueOf()</code>. On success, <code>JS_ValueToString</code> returns a pointer to a string. On error or exception, it returns <code>NULL</code>. This happens, for example, if <code>v</code> is an object and <code>v.toString()</code> throws an exception.</p>
+
+<p>The resulting <code>JSString</code> is subject to garbage collection unless you protect it using a local root, an object property, or the <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_AddRoot" title="en/JS_AddRoot">JS_AddRoot</a></code> function.</p>
+
+<h2 id="See_Also" name="See_Also">See Also</h2>
+
+<p>{{ LXRSearch("ident", "i", "JS_ValueToString") }}</p>
+
+<p><a href="/en/SpiderMonkey/JSAPI_Reference/JS_ConvertArguments" title="en/JS_ConvertArguments">JS_ConvertArguments</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ConvertValue" title="en/JS_ConvertValue">JS_ConvertValue</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetTypeName" title="en/JS_GetTypeName">JS_GetTypeName</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_TypeOfValue" title="en/JS_TypeOfValue">JS_TypeOfValue</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToBoolean" title="en/JS_ValueToBoolean">JS_ValueToBoolean</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToFunction" title="en/JS_ValueToFunction">JS_ValueToFunction</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToInt32" title="en/JS_ValueToInt32">JS_ValueToInt32</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToNumber" title="en/JS_ValueToNumber">JS_ValueToNumber</a>, <a href="/en/SpiderMonkey/JSAPI_Reference/JS_ValueToObject" title="en/JS_ValueToObject">JS_ValueToObject</a></p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsclass/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsclass/index.html
new file mode 100644
index 0000000000..dd119aba3f
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsclass/index.html
@@ -0,0 +1,137 @@
+---
+title: JSClass
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSClass
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSClass
+---
+<h3 id=".E6.91.98.E8.A6.81" name=".E6.91.98.E8.A6.81">摘要</h3>
+<p><b>数据结构</b> 定义一个基本类用于建立和维护JS对象。</p>
+<h3 id=".E8.AF.AD.E6.B3.95" name=".E8.AF.AD.E6.B3.95">语法</h3>
+<pre>struct JSClass {
+ char *name;
+ uint32 flags;
+ /* Mandatory non-null function pointer members. */
+ JSPropertyOp addProperty;
+ JSPropertyOp delProperty;
+ JSPropertyOp getProperty;
+ JSPropertyOp setProperty;
+ JSEnumerateOp enumerate;
+ JSResolveOp resolve;
+ JSConvertOp convert;
+ JSFinalizeOp finalize;
+ /* Optionally non-null members start here. */
+ JSGetObjectOps getObjectOps;
+ JSCheckAccessOp checkAccess;
+ JSNative call;
+ JSNative construct;
+ JSXDRObjectOp xdrObject;
+ JSHasInstanceOp hasInstance;
+ JSMarkOp mark;
+ JSReserveSlotsOp reserveSlots;
+};
+</pre>
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>名称</th>
+ <th>类型</th>
+ <th>描述</th>
+ </tr>
+ <tr>
+ <td><code>name</code></td>
+ <td><code>char *</code></td>
+ <td>类名</td>
+ </tr>
+ <tr>
+ <td><code>flags</code></td>
+ <td><code>uint32</code></td>
+ <td>类的属性(成员变量)。0表明属性不是一个集合. 属性值可以是下面这些值中的一个或多个:
+ <ul>
+ <li><code><a href="cn/JSAPI_Reference/JSCLASS_HAS_PRIVATE">JSCLASS_HAS_PRIVATE</a></code>: 类可以使用私有数据。</li>
+ <li><code><a href="cn/JSAPI_Reference/JSCLASS_NEW_ENUMERATE">JSCLASS_NEW_ENUMERATE</a></code>: 返回由类定义的<code>getObjectOps</code>方法获取所有属性的一个新方法。</li>
+ <li><code><a href="cn/JSAPI_Reference/JSCLASS_NEW_RESOLVE">JSCLASS_NEW_RESOLVE</a></code>: 返回由类定义的<code>getObjectOps</code>方法获取属性值的一个新方法。</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td><code>addProperty</code></td>
+ <td><code>JSPropertyOp</code></td>
+ <td>为类增加属性的函数。</td>
+ </tr>
+ <tr>
+ <td><code>delProperty</code></td>
+ <td><code>JSPropertyOp</code></td>
+ <td>从类中删除属性的函数。</td>
+ </tr>
+ <tr>
+ <td><code>getProperty</code></td>
+ <td><code>JSPropertyOp</code></td>
+ <td>获取属性值的函数。</td>
+ </tr>
+ <tr>
+ <td><code>setProperty</code></td>
+ <td><code>JSPropertyOp</code></td>
+ <td>设置属性值的函数</td>
+ </tr>
+ <tr>
+ <td><code>enumerate</code></td>
+ <td><code>JSEnumerateOp</code></td>
+ <td>枚举类所有属性的函数。</td>
+ </tr>
+ <tr>
+ <td><code>resolve</code></td>
+ <td><code>JSResolveOp</code></td>
+ <td>Method for resolving property ambiguities.</td>
+ </tr>
+ <tr>
+ <td><code>convert</code></td>
+ <td><code>JSConvertOp</code></td>
+ <td>进行属性值转换的函数。</td>
+ </tr>
+ <tr>
+ <td><code>finalize</code></td>
+ <td><code>JSFinalizeOp</code></td>
+ <td>将类设为不可修改(finalizing)的函数。</td>
+ </tr>
+ <tr>
+ <td><code>getObjectOps</code></td>
+ <td><code>JSGetObjectOps</code></td>
+ <td>为类定义重载方法指向一个可选的结构。如果你不想重载类的默认方法,可以将<code>getObjectOps</code> 设为 <code>NULL</code>。</td>
+ </tr>
+ <tr>
+ <td><code>checkAccess</code></td>
+ <td><code>JSCheckAccessOp</code></td>
+ <td>为类或对象操作结构指定可选的自定义请求控制方法。如果你不想提供自定义的请求控制,设置此值为<code>NULL</code>。</td>
+ </tr>
+ <tr>
+ <td><code>call</code></td>
+ <td><code>JSNative</code></td>
+ <td>为对象提供替换这个类的方法。</td>
+ </tr>
+ <tr>
+ <td><code>construct</code></td>
+ <td><code>JSNative</code></td>
+ <td>为对象提供方法去替换这个类的构造器。</td>
+ </tr>
+ <tr>
+ <td><code>xdrObject</code></td>
+ <td><code>JSXDRObjectOp</code></td>
+ <td>指向一个可选的XDR对象和它的方法。如果你不想使用XDR, 设置这个值为 <code>NULL</code>。</td>
+ </tr>
+ <tr>
+ <td><code>hasInstance</code></td>
+ <td><code>JSHasInstanceOp</code></td>
+ <td>Pointer to an optional <code>hasInstance</code> method for this object. If you do not provide a method for <code>hasInstance</code>, set this pointer to <code>NULL</code>.</td>
+ </tr>
+ <tr>
+ <td><code>mark</code></td>
+ <td><code>JSMarkOp</code></td>
+ <td>Pointer to an optional <code>mark</code> method for this object. If you do not provide a method for <code>mark</code>, set this pointer to <code>NULL</code>.</td>
+ </tr>
+ <tr>
+ <td><code>reserveSlots</code></td>
+ <td><code>JSReserveSlotsOp</code></td>
+ <td>Pointer to an optional <code>reserveSlots</code> method for this object. If you do not provide a method for <code>reserveSlots</code>, set this pointer to <code>NULL</code>.</td>
+ </tr>
+ </tbody>
+</table>
+<p> </p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsconstdoublespec/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsconstdoublespec/index.html
new file mode 100644
index 0000000000..509d3b12ed
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsconstdoublespec/index.html
@@ -0,0 +1,56 @@
+---
+title: JSConstDoubleSpec
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSConstDoubleSpec
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSConstDoubleSpec
+---
+<h3 id=".E6.91.98.E8.A6.81" name=".E6.91.98.E8.A6.81">摘要</h3>
+<p><b>数据结构</b></p>
+<p>定义一个双浮点类型的变量并进行赋值。</p>
+<h3 id=".E8.AF.AD.E6.B3.95" name=".E8.AF.AD.E6.B3.95">语法</h3>
+<pre>struct JSConstDoubleSpec {
+ jsdouble dval;
+ const char *name;
+ uint8 flags;
+ uint8 spare[3];
+};
+</pre>
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <th>名称</th>
+ <th>类型</th>
+ <th>描述</th>
+ </tr>
+ <tr>
+ <td><code>dval</code></td>
+ <td><code>jsdouble</code></td>
+ <td>双浮点类型的值。</td>
+ </tr>
+ <tr>
+ <td><code>name</code></td>
+ <td><code>const char *</code></td>
+ <td>给双浮点类型定义的名称。</td>
+ </tr>
+ <tr>
+ <td><code>flags</code></td>
+ <td><code>uint8</code></td>
+ <td>双浮点类型的属性。这里可以是0或者是下面这些值之中的一个:
+ <ul>
+ <li><code><a href="cn/JSPROP_ENUMERATE">JSPROP_ENUMERATE</a></code>: 在for循环中的可用性。</li>
+ <li><code><a href="cn/JSPROP_READONLY">JSPROP_READONLY</a></code>: 只读性。</li>
+ <li><code><a href="cn/JSPROP_PERMANENT">JSPROP_PERMANENT</a></code>: 非删除性。</li>
+ <li><code><a href="cn/JSPROP_EXPORTED">JSPROP_EXPORTED</a></code>: 可导出性。(property can be exported outside its object.)</li>
+ <li><code><a href="cn/JSPROP_INDEX">JSPROP_INDEX</a></code>: 数组(array)元素的当前索引。</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td><code>spare</code></td>
+ <td><code>uint8{{ mediawiki.external(3) }}</code></td>
+ <td>为以后的扩展保留的属性。</td>
+ </tr>
+ </tbody>
+</table>
+<h3 id=".E6.8F.8F.E8.BF.B0" name=".E6.8F.8F.E8.BF.B0">描述</h3>
+<p><code>JS双浮点型的构造规范</code> 典型应用于定义一个双浮点值集合,并使用<code><a href="cn/JS_DefineConstDoubles">JS_DefineConstDoubles</a></code>对生成的对象进行赋值。使用<code>JS_DefineConstDouble</code>为指定的对象创建一个或多个双浮点类型属性。</p>
+<p><code>JS_DefineConstDoubles</code>为一类由<code>JSConstDoubleSpecs</code>定义的数组提供证明。为每个数据元素定义独立的属性名和设置独立的属性值。数组的最后一个元素必须包括0值(zero-valued)的属性。<code>JS_DefineConstDoubles</code> 为数组中每个非0值(non-zero)元素创建一个属性值。</p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jserrorreport/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jserrorreport/index.html
new file mode 100644
index 0000000000..7246c3c416
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jserrorreport/index.html
@@ -0,0 +1,6 @@
+---
+title: JSErrorReport
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSErrorReport
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSErrorReport
+---
+<p><a>Media:Example.ogg</a></p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsproperty/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsproperty/index.html
new file mode 100644
index 0000000000..16f0cca090
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsproperty/index.html
@@ -0,0 +1,29 @@
+---
+title: JSProperty
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSProperty
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSProperty
+---
+<div>{{SpiderMonkeySidebar("JSAPI")}}</div>
+
+<p>{{deprecated_header("jsapi16")}}</p>
+
+<div class="summary">
+<p>限内部使用。{{jsapixref("JSObjectOps")}}层使用的JavaScript对象属性的类型。</p>
+</div>
+
+<h3 id="Syntax" name="Syntax">语法</h3>
+
+<pre class="eval">struct JSProperty {
+ jsid id;
+};
+</pre>
+
+<h3 id="Description" name="Description">Description</h3>
+
+<p><code>JSProperty</code> 是所有对象属性的抽象基类。 它在 {{jsapixref("JSObjectOps.lookupProperty")}}, {{jsapixref("JSObjectOps.getAttributes", "getAttributes")}}, {{jsapixref("JSObjectOps.getAttributes", "setAttributes")}}, 和 {{jsapixref("JSObjectOps.dropProperty", "dropProperty")}}中内部使用。</p>
+
+<h2 id="See_Also" name="See_Also">See Also</h2>
+
+<ul>
+ <li>{{bug(483473)}}</li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jspropertydescriptor/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jspropertydescriptor/index.html
new file mode 100644
index 0000000000..9f35d49fdb
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jspropertydescriptor/index.html
@@ -0,0 +1,69 @@
+---
+title: JSPropertyDescriptor
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSPropertyDescriptor
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSPropertyDescriptor
+---
+<div>{{SpiderMonkeySidebar("JSAPI")}}</div>
+
+<div class="summary">描述符是一个用于声明一个属性是否可以被修改,是否可以被删除,是否可以被枚举的一个对象</div>
+
+<h2 id="内容">内容</h2>
+
+<p>每一个属性只拥有一个描述符对象,但是这个对象中拥有多个键值,用来描述这个属性,下表说明了描述符中可以拥有的键值.</p>
+
+<table class="fullwidth-table">
+ <tbody>
+ <tr>
+ <td class="header">Field Name</td>
+ <td class="header">Description</td>
+ </tr>
+ <tr>
+ <td><code>getter</code></td>
+ <td><code>get</code> 语法为属性绑定一个函数,每当查询该属性时便调用对应的函数,查询的结构为该函数的返回值</td>
+ </tr>
+ <tr>
+ <td><code>setter</code></td>
+ <td>如果试着改变一个属性的值,那么对应的 <em>setter</em> 函数将被执行</td>
+ </tr>
+ <tr>
+ <td><code>value</code></td>
+ <td>描述指定属性的值 , 可以是任何有效的 <em>Javascript</em> 值(函数 , 对象 , 字符串 ...).</td>
+ </tr>
+ <tr>
+ <td><code>configurable</code></td>
+ <td>当且仅当该属性的 <em>configurable</em> 为 true 时,该属性 <code>描述符</code> 才能够被改变, 同时该属性也能从对应的对象上被删除.</td>
+ </tr>
+ <tr>
+ <td><code>enumerable</code></td>
+ <td>描述指定的属性是否是 <a href="https://www.yuque.com/hardtoname/ur9xy2/rwbt5g#o93qms">可枚举</a> 的.</td>
+ </tr>
+ <tr>
+ <td><code>writable</code></td>
+ <td>当且仅当该属性的 <em>writable</em> 为 <code>true</code> 时, <em>value</em> 才能被赋值运算符改变。</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Description" name="Description">描述</h2>
+
+<p><em>描述符</em> 是描述对象属性的属性 , 对象里目前存在的属性描述符有两种主要形式:<strong>数据描述符 </strong>和 <strong>存取描述符</strong>. 可以通过 <em>Object.getOwnPropertyDescriptor()</em> 函数来获取某个对象下指定属性的对应的 <em>描述符</em> .</p>
+
+<h2 id="示例">示例</h2>
+
+<p>下面将演示通过 <em>Object.defineProperty()</em> 函数定义一个对象的属性.</p>
+
+<pre class="brush: js">var language = {}; // 定义一个空对象 language
+
+Object.defineProperty(language, 'log', { // 定义 language 对象下的 log 属性
+ value : ['CN','EN'],
+ writable : true,
+ enumerable : true,
+ configurable : true
+})</pre>
+
+<p>此时这是一个可读可写可枚举的属性 此时我们将这三个值都设为了 true 此时上面这段代码等价于:</p>
+
+<pre class="brush: js">var language = {}; // 定义一个空对象 language
+
+languange.log = ['CN','EN']; // 定义 language 对象下的 log 属性
+</pre>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsruntime/index.html b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsruntime/index.html
new file mode 100644
index 0000000000..daabc3f876
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/jsapi_reference/jsruntime/index.html
@@ -0,0 +1,29 @@
+---
+title: JSRuntime
+slug: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSRuntime
+translation_of: Mozilla/Projects/SpiderMonkey/JSAPI_reference/JSRuntime
+---
+<div>{{SpiderMonkeySidebar("JSAPI")}}</div>
+
+<div>
+<p><font><font>在JSAPI中,</font></font><code><strong>JSRuntime</strong></code><font><font>是代表JavaScript引擎实例的顶级对象。</font><font>一个程序通常只有一个</font></font><code>JSRuntime</code><font><font>,即使它有很多线程。</font><font>这</font></font><code>JSRuntime</code><font><font>是JavaScript对象所居住的世界;</font><font>他们不能去其他人</font></font><code>JSRuntime</code><font><font>。</font></font></p>
+
+<p><font><font>所有JavaScript代码和大多数JSAPI调用都在内运行</font></font><code><strong>JSContext</strong></code><font><font>。</font><font>该</font></font><code>JSContext</code><font><font>是对一个孩子</font></font><code>JSRuntime</code><font><font>。</font><font>上下文可以运行脚本。</font><font>它包含</font></font><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_GetGlobalObject" title="该函数已过时:请改用JS_GetGlobalForObject或JS_GetGlobalForScopeChain。 属于上下文的全局对象的概念可能会在以后的SpiderMonkey版本中逐步淘汰。"><font><font>全局对象</font></font></a><font><font>和执行堆栈。</font></font><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_SetPendingException" title="JS_SetPendingException设置在上下文中引发的当前异常。 如果已经引发异常,则将其替换为给定的新异常。"><font><font>异常处理</font></font></a><font><font>,</font></font><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_SetErrorReporter" title="JS_SetErrorReporter使您可以在应用程序中定义和使用自己的错误报告机制。 发生错误并由JS_ReportError解析后,您定义的报告程序会自动传递JSErrorReport结构。 JS_SetErrorReporter"><font><font>错误报告</font></font></a><font><font>和某些</font></font><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_SetOptions" title="JS_SetOptions设置给定JS上下文cx的选项标志。 此函数返回包含标志的先前值的uint32值。"><font><font>语言选项</font></font></a><font><font>是基于Per-的</font></font><code>JSContext</code><font><font>。</font><font>创建上下文后,可以将上下文多次用于不同的脚本或JSAPI查询。</font><font>例如,浏览器可能会为每个HTML页面创建一个单独的上下文。</font><font>页面中的每个脚本都可以使用相同的上下文。</font></font></p>
+
+<p><font><font>对象</font></font><code>在同一个</code><font><font> </font></font><code>JSRuntime</code><font><font>内</font></font><code>JSContext</code><font><font>之间可以共享。对象与创建对象的上下文之间没有固定的关联。</font></font></p>
+
+<p><font><font>设置和拆卸a </font></font><code>JSRuntime</code><font><font>和a的</font><font>示例代码</font></font><code>JSContext</code><font><font>在</font></font><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_User_Guide" title="JSAPI用户指南"><font><font>JSAPI用户指南中</font></font></a><font><font>。</font></font></p>
+</div>
+
+<h3 id="Threads" name="Threads">线程</h3>
+
+<p><font><font>只有一个线程可以使用</font></font><code>JSContext </code><font><font>或</font></font><code>JSRuntime</code><font><font>。</font><font>较早的版本允许使用  </font></font><code>JS_ClearContextThread</code><font><font> 和其他功能将a </font></font><code>JSContext</code><font><font> 从一个线程</font><font>移动  </font><font>到另一个线程。</font><font>此功能已被删除。</font></font></p>
+
+<h2 id="相关文档"><font><font>相关文档</font></font></h2>
+
+<ul>
+ <li>{{jsapixref("JS_NewRuntime")}}</li>
+ <li>{{jsapixref("JS_DestroyRuntime")}}</li>
+ <li>{{jsapixref("JS_NewContext")}}</li>
+ <li>{{jsapixref("JS_DestroyContext")}}</li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/parser_api/index.html b/files/zh-cn/mozilla/projects/spidermonkey/parser_api/index.html
new file mode 100644
index 0000000000..03b00c9b00
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/parser_api/index.html
@@ -0,0 +1,1625 @@
+---
+title: Parser API
+slug: Mozilla/Projects/SpiderMonkey/Parser_API
+translation_of: Mozilla/Projects/SpiderMonkey/Parser_API
+---
+<p>{{ jsapi_minversion_header("1.8.5") }}</p>
+
+<p>最近构建的<a href="/En/SpiderMonkey/Build_Documentation" title="https://developer.mozilla.org/en/SpiderMonkey/Build_Documentation">独立的SpiderMonkey shell</a>包含了SpiderMonkey解析器的反射,可以通过JavaScript API来访问. 这使得我们更容易的用JavaScript写出处理JavaScript源代码的工具, 比如语法高亮工具,静态分析工具, 翻译器,编译器,混淆器等等.</p>
+
+<p>例子:</p>
+
+<pre>&gt; var expr = Reflect.parse("obj.foo + 42").body[0].expression
+&gt; expr.left.property
+({loc:null, type:"Identifier", name:"foo"})
+&gt; expr.right
+({loc:{source:null, start:{line:1, column:10}, end:{line:1, column:12}}, type:"Literal", value:42})
+</pre>
+
+<p>Reflect也可以使用在Firefox 7及以上版本中,但必须要导入一个模块:</p>
+
+<pre>Components.utils.import("resource://gre/modules/reflect.jsm")
+</pre>
+
+<p>如果不想用<code>Reflect</code>全局对象,也可以指定一个对象名称:</p>
+
+<pre>Components.utils.import("resource://gre/modules/reflect.jsm", obj)
+</pre>
+
+<h2 id="内置对象">内置对象</h2>
+
+<p>无论是SpiderMonkey shell还是Firefox (导入模块之后),全局对象<code>Reflect</code>目前都只有一个<code>parse</code>方法.</p>
+
+<h2 id="Reflect对象的属性"><code>Reflect</code>对象的属性</h2>
+
+<p><code>Reflect</code>对象目前只有一个方法.</p>
+
+<h4 id="Reflect.parse(src_options)"><code>Reflect.parse(src[, options])</code></h4>
+
+<p>将SRC强制转为字符串,并将结果作为javascript程序进行分析。默认情况下,解析返回一个表示被解析的抽象语法树(AST)的程序对象(见下文)</p>
+
+<p>可通过<strong>options</strong>对象提供其他选项, 可以使用的属性如下:</p>
+
+<table style="border: 1px solid #edf2f7; width: 67%;">
+ <tbody>
+ <tr style="background-color: rgb(241, 246, 251);">
+ <td><strong><span style="font-family: Courier New;">loc</span></strong></td>
+ <td>Boolean</td>
+ <td>Default: <span style="font-family: Courier New;">true</span></td>
+ </tr>
+ <tr>
+ <td colspan="3">如果<strong><span style="font-family: Courier New;">loc</span></strong>为<span style="font-family: Courier New;">true</span>,则解析器会在返回的AST节点中包含上源码的位置信息.</td>
+ </tr>
+ <tr style="background-color: rgb(241, 246, 251);">
+ <td><strong><span style="font-family: Courier New;">source</span></strong></td>
+ <td>String</td>
+ <td>Default: <span style="font-family: Courier New;">null</span></td>
+ </tr>
+ <tr>
+ <td colspan="3">A description of the input source; typically a filename, path, or URL. This string is not meaningful to the parsing process, but is produced as part of the source location information in the returned AST nodes.</td>
+ </tr>
+ <tr style="background-color: rgb(241, 246, 251);">
+ <td><strong><span style="font-family: Courier New;">line</span></strong></td>
+ <td>Number</td>
+ <td>Default: <span style="font-family: Courier New;">1</span></td>
+ </tr>
+ <tr>
+ <td colspan="3">初始行号,用在源码位置信息上.</td>
+ </tr>
+ <tr style="background-color: rgb(241, 246, 251);">
+ <td><strong><span style="font-family: Courier New;">builder</span></strong></td>
+ <td>Builder</td>
+ <td>Default: <span style="font-family: Courier New;">null</span></td>
+ </tr>
+ <tr>
+ <td colspan="3">
+ <p>A builder object, which can be used to produce AST nodes in custom data formats. The expected callback methods are described under <a href="/en/SpiderMonkey/Parser_API#Builder_objects" title="en/SpiderMonkey/Parser API#Builder objects">Builder Objects</a>.</p>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<p>If parsing fails due to a syntax error, an instance of <code>SyntaxError</code> is thrown. The syntax error object thrown by <code>Reflect.parse()</code> has the same <code>message</code> property as the syntax error that would be thrown by <code>eval(src)</code>. The <code>lineNumber</code> and <code>fileName</code> properties of the syntax error object indicate the source location of the syntax error.</p>
+
+<h2 id="节点对象">节点对象</h2>
+
+<p>默认情况下, <code>Reflect.parse()</code> 生成Node对象, 即普通的JavaScript对象 (i.e., 它们的原型来自标准的<code>Object原型</code>). 所有的节点类型都实现了以下的接口:</p>
+
+<pre>interface Node {
+ type: string;
+ loc: SourceLocation | null;
+}
+</pre>
+
+<p><code>type</code> 字段是一个字符串,代表AST变量类型.节点的每个子类型在下面的文档中都用其  <code>type</code> 字段特定的字符串标注出来了. 你可以使用这个字段去决定一个节点要实现的接口.</p>
+
+<p><code>loc</code> 字段代表节点的源位置信息. 如果解析器未生成有关节点的源位置信息,  <code>null</code> 字段为空;否则它是一个对象, 包括一个起始位置 (the position of the first character of the parsed source region) 和一个结束位置 (the position of the first character <em>after</em> the parsed source region):ss</p>
+
+<pre>interface SourceLocation {
+ source: string | null;
+ start: Position;
+ end: Position;
+}
+</pre>
+
+<p>每个 <code>Position</code> 包括一个 <code>line</code> 数字 (1-indexed) 和 <code>column</code> 数字 (0-indexed):</p>
+
+<pre>interface Position {
+ line: uint32 &gt;= 1;
+ column: uint32 &gt;= 0;
+}</pre>
+
+<h3 id="Programs">Programs</h3>
+
+<pre>interface Program &lt;: Node {
+ type: "Program";
+ body: [ Statement ];
+}
+</pre>
+
+<p>A complete program source tree.</p>
+
+<h3 id="函数">函数</h3>
+
+<pre>interface Function &lt;: Node {
+ id: Identifier | null;
+ params: [ Pattern ];
+ defaults: [ Expression ];
+ rest: Identifier | null;
+ body: BlockStatement | Expression;
+ generator: boolean;
+ expression: boolean;
+}
+</pre>
+
+<p>A function declaration or expression. The <code>body</code> of the function may be a block statement, or in the case of an <a href="/en/JavaScript/New_in_JavaScript/1.8#Expression_closures_%28Merge_into_own_page.2fsection%29" title="https://developer.mozilla.org/en/new_in_javascript_1.8#Expression_closures_(Merge_into_own_page.2fsection)">expression closure</a>, an expression.</p>
+
+<div class="note"><strong>注:</strong> Expression closures 是SpiderMonkey特有的.</div>
+
+<p>If the <code>generator</code> flag is <code>true</code>, the function is a <a href="/en/JavaScript/Guide/Iterators_and_Generators" title="https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Iterators_and_Generators">generator function</a>, i.e., contains a <code>yield</code> expression in its body (other than in a nested function).</p>
+
+<div class="note"><strong>注:</strong> Generators 是SpiderMonkey特有的.</div>
+
+<p>If the <code>expression</code> flag is <code>true</code>, the function is an expression closure and the <code>body</code> field is an expression.</p>
+
+<h3 id="语句">语句</h3>
+
+<pre>interface Statement &lt;: Node { }
+</pre>
+
+<p>任意语句.</p>
+
+<pre>interface EmptyStatement &lt;: Statement {
+ type: "EmptyStatement";
+}
+</pre>
+
+<p>一个空语句,也就是,一个孤立的分号.</p>
+
+<pre>interface BlockStatement &lt;: Statement {
+ type: "BlockStatement";
+ body: [ Statement ];
+}
+</pre>
+
+<p>一个语句块,也就是由大括号包围的语句序列.</p>
+
+<pre>interface ExpressionStatement &lt;: Statement {
+ type: "ExpressionStatement";
+ expression: Expression;
+}
+</pre>
+
+<p>一个表达式语句,也就是,仅有一个表达式组成的语句.</p>
+
+<pre>interface IfStatement &lt;: Statement {
+ type: "IfStatement";
+ test: Expression;
+ consequent: Statement;
+ alternate: Statement | null;
+}
+</pre>
+
+<p>一个<code>if</code>语句.</p>
+
+<pre>interface LabeledStatement &lt;: Statement {
+ type: "LabeledStatement";
+ label: Identifier;
+ body: Statement;
+}
+</pre>
+
+<p>一个标签语句,也就是, a statement prefixed by a <code>break</code>/<code>continue</code> label.</p>
+
+<pre>interface BreakStatement &lt;: Statement {
+ type: "BreakStatement";
+ label: Identifier | null;
+}
+</pre>
+
+<p>一个<code>break</code>语句.</p>
+
+<pre>interface ContinueStatement &lt;: Statement {
+ type: "ContinueStatement";
+ label: Identifier | null;
+}
+</pre>
+
+<p>一个<code>continue语句</code>.</p>
+
+<pre>interface WithStatement &lt;: Statement {
+ type: "WithStatement";
+ object: Expression;
+ body: Statement;
+}
+</pre>
+
+<p>A <code>with</code> statement.</p>
+
+<pre>interface SwitchStatement &lt;: Statement {
+ type: "SwitchStatement";
+ discriminant: Expression;
+ cases: [ SwitchCase ];
+ lexical: boolean;
+}
+</pre>
+
+<p>一个<code>switch</code>语句. The lexical flag is metadata indicating whether the <code>switch</code> statement contains any unnested <code>let</code> declarations (and therefore introduces a new lexical scope).</p>
+
+<pre>interface ReturnStatement &lt;: Statement {
+ type: "ReturnStatement";
+ argument: Expression | null;
+}
+</pre>
+
+<p>一个<code>return</code>语句.</p>
+
+<pre>interface ThrowStatement &lt;: Statement {
+ type: "ThrowStatement";
+ argument: Expression;
+}
+</pre>
+
+<p>一个<code>throw</code>语句.</p>
+
+<pre>interface TryStatement &lt;: Statement {
+ type: "TryStatement";
+ block: BlockStatement;
+ handlers: [ CatchClause ];
+ finalizer: BlockStatement | null;
+}
+</pre>
+
+<p>一个<code>try</code>语句.</p>
+
+<div class="note"><strong>注:</strong> 多个<code>catch</code>子句是SpiderMonkey特有的.</div>
+
+<pre>interface WhileStatement &lt;: Statement {
+ type: "WhileStatement";
+ test: Expression;
+ body: Statement;
+}
+</pre>
+
+<p>一个<code>while</code>语句.</p>
+
+<pre>interface DoWhileStatement &lt;: Statement {
+ type: "DoWhileStatement";
+ body: Statement;
+ test: Expression;
+}
+</pre>
+
+<p>一个<code>do</code>/<code>while</code>语句.</p>
+
+<pre>interface ForStatement &lt;: Statement {
+ type: "ForStatement";
+ init: VariableDeclaration | Expression | null;
+ test: Expression | null;
+ update: Expression | null;
+ body: Statement;
+}
+</pre>
+
+<p>一个<code>for</code>语句.</p>
+
+<pre>interface ForInStatement &lt;: Statement {
+ type: "ForInStatement";
+ left: VariableDeclaration | Expression;
+ right: Expression;
+ body: Statement;
+ each: boolean;
+}
+</pre>
+
+<p>一个<code>for</code>/<code>in</code>语句, or, if <code>each</code> is <code>true</code>, a <code>for each</code>/<code>in</code> statement.</p>
+
+<div class="note"><strong>注:</strong> <code>for each</code>语法是SpiderMonkey特有的.</div>
+
+<pre>interface LetStatement &lt;: Statement {
+ type: "LetStatement";
+ head: [ { id: Pattern, init: Expression | null } ];
+ body: Statement;
+}
+</pre>
+
+<p>一个<code>let语句</code>.</p>
+
+<div class="note"><strong>注:</strong> <code>let</code>语句形式是SpiderMonkey特有的.</div>
+
+<pre>interface DebuggerStatement &lt;: Statement {
+ type: "DebuggerStatement";
+}
+</pre>
+
+<p>一个<code>debugger</code>语句.</p>
+
+<div class="note"><strong>注:</strong> <code>debugger</code>语句是ECMAScript 5中的新语法,尽管SpiderMonkey已经支持它很多年了.</div>
+
+<h3 id="声明">声明</h3>
+
+<pre>interface Declaration &lt;: Statement { }
+</pre>
+
+<p>Any declaration node. Note that declarations are considered statements; this is because declarations can appear in any statement context in the language recognized by the SpiderMonkey parser.</p>
+
+<div class="note"><strong>注:</strong> 任意嵌套作用域下的声明是SpiderMonkey特有的.</div>
+
+<pre>interface FunctionDeclaration &lt;: Function, Declaration {
+ type: "FunctionDeclaration";
+ id: Identifier;
+ params: [ Pattern ];
+ defaults: [ Expression ];
+ rest: Identifier | null;
+ body: BlockStatement | Expression;
+ generator: boolean;
+ expression: boolean;
+}
+</pre>
+
+<p>一个函数声明.</p>
+
+<div class="note"><strong>注:</strong> <code>id</code>字段不能为<code>null</code>.</div>
+
+<pre>interface VariableDeclaration &lt;: Declaration {
+ type: "VariableDeclaration";
+ declarations: [ VariableDeclarator ];
+ kind: "var" | "let" | "const";
+}
+</pre>
+
+<p>一个变量声明,可以通过<code>var</code>, <code>let</code>, 或<code>const</code>.</p>
+
+<pre>interface VariableDeclarator &lt;: Node {
+ type: "VariableDeclarator";
+ id: Pattern;
+ init: Expression | null;
+}
+</pre>
+
+<p>一个变量<span class="st">声明符</span>.</p>
+
+<div class="note"><strong>注:</strong> <code>id</code>字段不能为<code>null</code>.</div>
+
+<div class="note"><strong>注:</strong> <code>let</code>和<code>const是</code>SpiderMonkey特有的.</div>
+
+<h3 id="表达式">表达式</h3>
+
+<pre>interface Expression &lt;: Node, Pattern { }</pre>
+
+<p>任意表达式节点. Since the left-hand side of an assignment may be any expression in general, an expression can also be a pattern.</p>
+
+<pre>interface ThisExpression &lt;: Expression {
+ type: "ThisExpression";
+}
+</pre>
+
+<p>一个<code>this</code>表达式.</p>
+
+<pre>interface ArrayExpression &lt;: Expression {
+ type: "ArrayExpression";
+ elements: [ Expression | null ];
+}</pre>
+
+<p>一个数组表达式.</p>
+
+<pre>interface ObjectExpression &lt;: Expression {
+ type: "ObjectExpression";
+ properties: [ { key: Literal | Identifier,
+  value: Expression,
+ kind: "init" | "get" | "set" } ];
+}</pre>
+
+<p>一个对象表达式. A literal property in an object expression can have either a string or number as its <code>value</code>. Ordinary property initializers have a <code>kind</code> value <code>"init"</code>; getters and setters have the <code>kind</code> values <code>"get"</code> and <code>"set"</code>, respectively.</p>
+
+<pre>interface FunctionExpression &lt;: Function, Expression {
+ type: "FunctionExpression";
+ id: Identifier | null;
+ params: [ Pattern ];
+ defaults: [ Expression ];
+ rest: Identifier | null;
+ body: BlockStatement | Expression;
+ generator: boolean;
+ expression: boolean;
+}
+</pre>
+
+<p>一个函数表达式.</p>
+
+<pre>interface SequenceExpression &lt;: Expression {
+ type: "SequenceExpression";
+ expressions: [ Expression ];
+}</pre>
+
+<p>一个序列表达式,也就是一个由逗号分割的表达式序列.</p>
+
+<pre>interface UnaryExpression &lt;: Expression {
+ type: "UnaryExpression";
+ operator: UnaryOperator;
+ prefix: boolean;
+ argument: Expression;
+}</pre>
+
+<p>A unary operator expression.</p>
+
+<pre>interface BinaryExpression &lt;: Expression {
+ type: "BinaryExpression";
+ operator: BinaryOperator;
+ left: Expression;
+ right: Expression;
+}</pre>
+
+<p>一个二元运算符表达式.</p>
+
+<pre>interface AssignmentExpression &lt;: Expression {
+ type: "AssignmentExpression";
+ operator: AssignmentOperator;
+ left: Expression;
+ right: Expression;
+}</pre>
+
+<p>An assignment operator expression.</p>
+
+<pre>interface UpdateExpression &lt;: Expression {
+ type: "UpdateExpression";
+ operator: UpdateOperator;
+ argument: Expression;
+ prefix: boolean;
+}</pre>
+
+<p>An update (increment or decrement) operator expression.</p>
+
+<pre>interface LogicalExpression &lt;: Expression {
+ type: "LogicalExpression";
+ operator: LogicalOperator;
+ left: Expression;
+ right: Expression;
+}</pre>
+
+<p>一个逻辑运算符表达式.</p>
+
+<pre>interface ConditionalExpression &lt;: Expression {
+ type: "ConditionalExpression";
+ test: Expression;
+ alternate: Expression;
+ consequent: Expression;
+}</pre>
+
+<p>一个条件运算符表达式, i.e., a ternary <code>?</code>/<code>:</code> expression.</p>
+
+<pre>interface NewExpression &lt;: Expression {
+ type: "NewExpression";
+ callee: Expression;
+ arguments: [ Expression ] | null;
+}</pre>
+
+<p>A <code>new</code> expression.</p>
+
+<pre>interface CallExpression &lt;: Expression {
+ type: "CallExpression";
+ callee: Expression;
+ arguments: [ Expression ];
+}</pre>
+
+<p>A function or method call expression.</p>
+
+<pre>interface MemberExpression &lt;: Expression {
+ type: "MemberExpression";
+ object: Expression;
+ property: Identifier | Expression;
+ computed : boolean;
+}</pre>
+
+<p>一个member表达式. If <code>computed === true</code>, the node corresponds to a computed <code>e1[e2]</code> expression and property is an <code>Expression</code>. If <code>computed === false</code>, the node corresponds to a static <code>e1.x</code> expression and property is an <code>Identifier</code>.</p>
+
+<pre>interface YieldExpression &lt;: Expression {
+ argument: Expression | null;
+}
+</pre>
+
+<p>A <code>yield</code> expression.</p>
+
+<div class="note"><strong>注:</strong> <code>yield</code> expressions 是SpiderMonkey特有的.</div>
+
+<pre>interface ComprehensionExpression &lt;: Expression {
+ body: Expression;
+ blocks: [ ComprehensionBlock ];
+ filter: Expression | null;
+}
+</pre>
+
+<p>An <a href="/en/JavaScript/Guide/Obsolete_Pages/Working_with_Arrays#Array_comprehensions" title="https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Working_with_Arrays#Array_comprehensions">array comprehension</a>. The <code>blocks</code> array corresponds to the sequence of <code>for</code> and <code>for each</code> blocks. The optional <code>filter</code> expression corresponds to the final <code>if</code> clause, if present.</p>
+
+<div class="note"><strong>注:</strong> Array comprehensions 是SpiderMonkey特有的.</div>
+
+<pre>interface GeneratorExpression &lt;: Expression {
+ body: Expression;
+ blocks: [ ComprehensionBlock ];
+ filter: Expression | null;
+}
+</pre>
+
+<p>A <a href="/en/JavaScript/Guide/Iterators_and_Generators#Generator_expressions" title="https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Iterators_and_Generators#Generator_expressions">generator expression</a>. As with array comprehensions, the <code>blocks</code> array corresponds to the sequence of <code>for</code> and <code>for each</code> blocks, and the optional <code>filter</code> expression corresponds to the final <code>if</code> clause, if present.</p>
+
+<div class="note"><strong>注:</strong> Generator expressions 是SpiderMonkey特有的.</div>
+
+<pre>interface GraphExpression &lt;: Expression {
+ index: uint32;
+ expression: Literal;
+}
+</pre>
+
+<p>A <a href="/en/JavaScript/Sharp_variables_in_JavaScript" title="https://developer.mozilla.org/en/Sharp_variables_in_JavaScript">graph expression</a>, aka "sharp literal," such as <code>#1={ self: #1# }</code>.</p>
+
+<div class="note"><strong>注:</strong> Graph expressions 是SpiderMonkey特有的.</div>
+
+<pre>interface GraphIndexExpression &lt;: Expression {
+ index: uint32;
+}
+</pre>
+
+<p>一个<a href="/en/JavaScript/Sharp_variables_in_JavaScript" title="https://developer.mozilla.org/en/Sharp_variables_in_JavaScript">graph索引表达式</a>,又称为"井号变量",比如<code>#1#</code>.</p>
+
+<div class="note"><strong>注:</strong> Graph索引表达式</div>
+
+<div class="note">Graph索引表达式是SpiderMonkey特有的.</div>
+
+<pre>interface LetExpression &lt;: Expression {
+ type: "LetExpression";
+ head: [ { id: Pattern, init: Expression | null } ];
+ body: Expression;
+}
+</pre>
+
+<p>一个<code>let表达式</code>.</p>
+
+<div class="note"><strong>注:</strong> <code>let</code>表达式是SpiderMonkey特有的.</div>
+
+<h3 id="模式">模式</h3>
+
+<pre>interface Pattern &lt;: Node { }
+</pre>
+
+<p>JavaScript 1.7 introduced <a href="/en/JavaScript/New_in_JavaScript/1.7#Destructuring_assignment_%28Merge_into_own_page.2fsection%29" title="https://developer.mozilla.org/en/new_in_javascript_1.7#Destructuring_assignment_(Merge_into_own_page.2fsection)">destructuring assignment and binding</a> forms. All binding forms (such as function parameters, variable declarations, and <code>catch</code> block headers), accept array and object destructuring patterns in addition to plain identifiers. The left-hand sides of assignment expressions can be arbitrary expressions, but in the case where the expression is an object or array literal, it is interpreted by SpiderMonkey as a destructuring pattern.</p>
+
+<p>Since the left-hand side of an assignment can in general be any expression, in an assignment context, a pattern can be any expression. In binding positions (such as function parameters, variable declarations, and <code>catch</code> headers), patterns can only be identifiers in the base case, not arbitrary expressions.</p>
+
+<pre>interface ObjectPattern &lt;: Pattern {
+ type: "ObjectPattern";
+ properties: [ { key: Literal | Identifier, value: Pattern } ];
+}
+</pre>
+
+<p>An object-destructuring pattern. A literal property in an object pattern can have either a string or number as its <code>value</code>.</p>
+
+<pre>interface ArrayPattern &lt;: Pattern {
+ type: "ArrayPattern";
+ elements: [ Pattern | null ];
+}
+</pre>
+
+<p>An array-destructuring pattern.</p>
+
+<h3 id="子句">子句</h3>
+
+<pre>interface SwitchCase &lt;: Node {
+ type: "SwitchCase";
+ test: Expression | null;
+ consequent: [ Statement ];
+}
+</pre>
+
+<p>一个<code>case</code> (if <code>test</code> is an <code>Expression</code>) or <code>default</code> (if <code>test === null</code>) clause in the body of a <code>switch</code>语句.</p>
+
+<pre>interface CatchClause &lt;: Node {
+ type: "CatchClause";
+ param: Pattern;
+ guard: Expression | null;
+ body: BlockStatement;
+}
+</pre>
+
+<p>A <code>catch</code> clause following a <code>try</code> block. The optional <code>guard</code> property corresponds to the optional expression guard on the bound variable.</p>
+
+<div class="note"><strong>注:</strong> The guard expression is SpiderMonkey-specific.</div>
+
+<pre>interface ComprehensionBlock &lt;: Node {
+ left: Pattern;
+ right: Expression;
+ each: boolean;
+}
+</pre>
+
+<p>A <code>for</code> or <code>for each</code> block in an array comprehension or generator expression.</p>
+
+<div class="note"><strong>注:</strong> Array comprehensions and generator expressions 是SpiderMonkey特有的.</div>
+
+<h3 class="r" id="杂项"><nobr>杂项</nobr></h3>
+
+<pre>interface Identifier &lt;: Node, Expression, Pattern {
+ type: "Identifier";
+ name: string;
+}
+</pre>
+
+<p>An identifier. Note that an identifier may be an expression or a destructuring pattern.</p>
+
+<pre>interface Literal &lt;: Node, Expression {
+ type: "Literal";
+ value: string | boolean | null | number | RegExp;
+}
+</pre>
+
+<p>A literal token. Note that a literal can be an expression.</p>
+
+<pre>enum UnaryOperator {
+ "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"
+}
+</pre>
+
+<p>A unary operator token.</p>
+
+<pre>enum BinaryOperator {
+ "==" | "!=" | "===" | "!=="
+ | "&lt;" | "&lt;=" | "&gt;" | "&gt;="
+ | "&lt;&lt;" | "&gt;&gt;" | "&gt;&gt;&gt;"
+ | "+" | "-" | "*" | "/" | "%"
+ | "|" | "^" | "in"
+ | "instanceof" | ".."
+}
+</pre>
+
+<p>A binary operator token.</p>
+
+<div class="note"><strong>注:</strong> The <code>..</code> operator is E4X-specific.</div>
+
+<pre>enum LogicalOperator {
+ "||" | "&amp;&amp;"
+}
+</pre>
+
+<p>A logical operator token.</p>
+
+<pre>enum AssignmentOperator {
+ "=" | "+=" | "-=" | "*=" | "/=" | "%="
+ | "&lt;&lt;=" | "&gt;&gt;=" | "&gt;&gt;&gt;="
+ | "|=" | "^=" | "&amp;="
+}
+</pre>
+
+<p>An assignment operator token.</p>
+
+<pre>enum UpdateOperator {
+ "++" | "--"
+}
+</pre>
+
+<p>An update (increment or decrement) operator token.</p>
+
+<h3 id="E4X">E4X</h3>
+
+<p>下面介绍一下为E4X提供支持的节点类型.</p>
+
+<div class="note"><strong>注:</strong> E4X不是ECMAScript规范(<a class="external" href="http://www.ecma-international.org/publications/standards/Ecma-262.htm" title="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMA-262</a>)的一部分,它是一个单独的标准(<a class="external" href="http://www.ecma-international.org/publications/standards/Ecma-357.htm" title="http://www.ecma-international.org/publications/standards/Ecma-357.htm">ECMA-357</a>).</div>
+
+<h4 id="声明_2">声明</h4>
+
+<pre>interface XMLDefaultDeclaration &lt;: Declaration {
+ type: "XMLDefaultDeclaration";
+ namespace: Expression;
+}
+</pre>
+
+<p>一个默认<code>xml命名空间</code>声明</p>
+
+<h4 id="表达式_2">表达式</h4>
+
+<pre>interface XMLAnyName &lt;: Expression {
+ type: "XMLAnyName";
+}
+</pre>
+
+<p>The special E4X wildcard pseudo-identifier <code>*</code>.</p>
+
+<pre>interface XMLQualifiedIdentifier &lt;: Expression {
+ type: "XMLQualifiedIdentifier";
+ left: Identifier | XMLAnyName;
+ right: Identifier | Expression;
+ computed: boolean;
+}
+</pre>
+
+<p>An E4X qualified identifier, i.e., a pseudo-identifier using the namespace separator <code>::</code>. If the qualified identifier has a computed name (i.e., the <code>id::[expr]</code> form), then <code>computed</code> is <code>true</code> and the <code>right</code> property is an expression.</p>
+
+<pre>interface XMLFunctionQualifiedIdentifier &lt;: Expression {
+ type: "XMLFunctionQualifiedIdentifier";
+ right: Identifier | Expression;
+ computed: boolean;
+}
+</pre>
+
+<p>An E4X identifier qualified by the <code>function</code> keyword, e.g. <code>function::id</code>.</p>
+
+<div class="note"><strong>注:</strong> <code>function</code>-qualified identifiers 是SpiderMonkey特有的.</div>
+
+<pre>interface XMLAttributeSelector &lt;: Expression {
+ type: "XMLAttributeSelector";
+ attribute: Expression;
+}
+</pre>
+
+<p>An E4X attribute selector expression, i.e., an <code>@</code> expression.</p>
+
+<pre>interface XMLFilterExpression &lt;: Expression {
+ type: "XMLFilterExpression";
+ left: Expression;
+ right: Expression;
+}
+</pre>
+
+<p>An E4X list filter expression, i.e., an expression of the form <code>expr.(expr)</code>.</p>
+
+<pre>interface XMLElement &lt;: XML, Expression {
+ type: "XMLElement";
+ contents: [ XML ];
+}
+</pre>
+
+<p>An E4X literal representing a single XML element.</p>
+
+<pre>interface XMLList &lt;: XML, Expression {
+ type: "XMLList";
+ contents: [ XML ];
+}
+</pre>
+
+<p>An E4X literal representing a list of XML elements.</p>
+
+<h4 id="XML">XML</h4>
+
+<pre>interface XML &lt;: Node { }
+</pre>
+
+<p>XML data.</p>
+
+<pre>interface XMLEscape &lt;: XML {
+ type "XMLEscape";
+ expression: Expression;
+}
+</pre>
+
+<p>XML data with an escaped JavaScript expression.</p>
+
+<pre>interface XMLText &lt;: XML {
+ type: "XMLText";
+ text: string;
+}
+</pre>
+
+<p>Literal XML text.</p>
+
+<pre>interface XMLStartTag &lt;: XML {
+ type: "XMLStartTag";
+ contents: [ XML ];
+}
+</pre>
+
+<p>An XML start tag.</p>
+
+<pre>interface XMLEndTag &lt;: XML {
+ type: "XMLEndTag";
+ contents: [ XML ];
+}
+</pre>
+
+<p>An XML end tag.</p>
+
+<pre>interface XMLPointTag &lt;: XML {
+ type: "XMLPointTag";
+ contents: [ XML ];
+}
+</pre>
+
+<p>An XML point tag.</p>
+
+<pre>interface XMLName &lt;: XML {
+ type: "XMLName";
+ contents: string | [ XML ];
+}
+</pre>
+
+<p>An XML name.</p>
+
+<pre>interface XMLAttribute &lt;: XML {
+ type: "XMLAttribute";
+ value: string;
+}
+</pre>
+
+<p>An XML attribute value.</p>
+
+<pre>interface XMLCdata &lt;: XML {
+ type: "XMLCdata";
+ contents: string;
+}
+</pre>
+
+<p>An XML CDATA node.</p>
+
+<pre>interface XMLComment &lt;: XML {
+ type: "XMLComment";
+ contents: string;
+}
+</pre>
+
+<p>An XML comment.</p>
+
+<pre>interface XMLProcessingInstruction &lt;: XML {
+ type: "XMLProcessingInstruction";
+ target: string;
+ contents: string | null;
+}
+</pre>
+
+<p>An XML processing instruction.</p>
+
+<h2 id="Builder_objects">Builder objects</h2>
+
+<p>The optional <strong><code>builder</code></strong> parameter to <code>Reflect.parse()</code> makes it possible to construct user-specified data from the parser, rather than the default <code>Node</code> objects. Builder objects may contain any of the callback methods described in this section.</p>
+
+<p>Each callback can produce any custom, user-defined datatype; these are referred to below as <code>CustomExpression</code>, <code>CustomStatement</code>, etc.</p>
+
+<div class="note"><strong>注:</strong> Because this library uses <code>null</code> for optional nodes, it is recommended that user-defined datatypes <strong>not</strong> use <code>null</code> as a representation of an AST node.</div>
+
+<p>If the <strong><code>loc</code></strong> option is enabled (see the <a href="/en/SpiderMonkey/Parser_API#Reflect.parse(src.5b.2c_options.5d)" title="en/SpiderMonkey/Parser API#Reflect.parse(src.5b.2c options.5d)">Reflect.parse() options</a> above), then each callback is provided with the source location information of the parsed node as an extra parameter.</p>
+
+<p>All builder callbacks are optional. When a callback is missing, the default format is used, but the provided builder methods are still used recursively for sub-nodes.</p>
+
+<h3 id="Programs_2">Programs</h3>
+
+<h5 id="program(body_loc)"><code>program(body[, loc])</code></h5>
+
+<pre>body: [ CustomStatement ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomProgram</p>
+
+<p>Callback to produce a custom program node.</p>
+
+<h3 id="Statements">Statements</h3>
+
+<h5 id="emptyStatement(loc)"><code>emptyStatement([loc])</code></h5>
+
+<pre>loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom empty statement node.</p>
+
+<h5 id="blockStatement(body_loc)"><code>blockStatement(body[, loc])</code></h5>
+
+<pre>body: CustomStatement
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom block statement node.</p>
+
+<h5 id="expressionStatement(expr_loc)"><code>expressionStatement(expr[, loc])</code></h5>
+
+<pre>expr: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom expression statement node.</p>
+
+<h5 id="labeledStatement(label_body_loc)"><code>labeledStatement(label, body[, loc])</code></h5>
+
+<pre>label: CustomIdentifier
+body: CustomStatement
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom labeled statement node.</p>
+
+<h5 id="ifStatement(test_cons_alt_loc)"><code>ifStatement(test, cons, alt[, loc])</code></h5>
+
+<pre>test: CustomExpression
+cons: CustomStatement
+alt: CustomStatement | null
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>if</code> statement node.</p>
+
+<h5 id="switchStatement(disc_cases_isLexical_loc)"><code>switchStatement(disc, cases, isLexical[, loc])</code></h5>
+
+<pre>disc: CustomExpression
+cases: [ CustomSwitchCase ]
+isLexical: boolean
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>switch</code> statement node. The <strong><code>isLexical</code></strong> flag is metadata indicating whether the <code>switch</code> statement contains any unnested <code>let</code> declarations (and therefore introduces a new lexical scope).</p>
+
+<h5 id="whileStatement(test_body_loc)"><code>whileStatement(test, body[, loc])</code></h5>
+
+<pre>test: CustomExpression
+body: CustomStatement
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>while</code> statement node.</p>
+
+<h5 id="doWhileStatement(body_test_loc)"><code>doWhileStatement(body, test[, loc])</code></h5>
+
+<pre>body: CustomStatement
+test: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>do</code>-<code>while</code> statement node.</p>
+
+<h5 id="forStatement(init_test_update_body_loc)"><code>forStatement(init, test, update, body[, loc])</code></h5>
+
+<pre>init: CustomVariableDeclaration | CustomExpression | null
+test: CustomExpression | null
+update: CustomExpression | null
+body: CustomStatement
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>for</code> statement node.</p>
+
+<h5 id="forInStatement(left_right_body_isForEach_loc)"><code>forInStatement(left, right, body, isForEach[, loc])</code></h5>
+
+<pre>left: CustomVariableDeclaration | CustomExpression
+right: CustomExpression
+body: CustomStatement
+isForEach: boolean
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>for</code>-<code>in</code> statement node. The <strong><code>isForEach</code></strong> flag indicates whether the node is a <code>for each</code> statement.</p>
+
+<h5 id="breakStatement(label_loc)"><code>breakStatement(label[, loc])</code></h5>
+
+<pre>label: CustomIdentifier | null
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>break</code> statement node.</p>
+
+<h5 id="continueStatement(label_loc)"><code>continueStatement(label[, loc])</code></h5>
+
+<pre>label: CustomIdentifier | null
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>continue</code> statement node.</p>
+
+<h5 id="withStatement(obj_body_loc)"><code>withStatement(obj, body[, loc])</code></h5>
+
+<pre>obj: CustomExpression
+body: CustomStatement
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>with</code> statement node.</p>
+
+<h5 id="returnStatement(arg_loc)"><code>returnStatement(arg[, loc])</code></h5>
+
+<pre>arg: CustomExpression | null
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>return</code> statement node.</p>
+
+<h5 id="tryStatement(body_handlers_fin_loc)"><code>tryStatement(body, handlers, fin[, loc])</code></h5>
+
+<pre>body: CustomStatement
+handlers: [ CustomCatchClause ]
+fin: CustomStatement | null
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>try</code> statement node.</p>
+
+<h5 id="throwStatement(arg_loc)"><code>throwStatement(arg[, loc])</code></h5>
+
+<pre>arg: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>throw</code> statement node.</p>
+
+<h5 id="debuggerStatement(loc)"><code>debuggerStatement([loc])</code></h5>
+
+<pre>loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>debugger</code> statement node.</p>
+
+<h5 id="letStatement(head_body_loc)"><code>letStatement(head, body[, loc])</code></h5>
+
+<pre>head: [ CustomDeclarator ]
+body: CustomStatement
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomStatement</p>
+
+<p>Callback to produce a custom <code>let</code> statement node.</p>
+
+<h3 id="声明_3">声明</h3>
+
+<h5 id="functionDeclaration(name_args_body_isGenerator_isExpression_loc)"><code>functionDeclaration(name, args, body, isGenerator, isExpression[, loc])</code></h5>
+
+<pre>name: string
+args: [ CustomPattern ]
+body: CustomStatement | CustomExpression
+isGenerator: boolean
+isExpression: boolean
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomDeclaration</p>
+
+<p>Callback to produce a custom function declaration node.</p>
+
+<h5 id="variableDeclaration(kind_dtors_loc)"><code>variableDeclaration(kind, dtors[, loc])</code></h5>
+
+<pre>kind: "const" | "let" | "var"
+dtors: [ CustomDeclarator ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomDeclaration</p>
+
+<p>Callback to produce a custom variable declaration node.</p>
+
+<h5 id="variableDeclarator(patt_init_loc)"><code>variableDeclarator(patt, init[, loc])</code></h5>
+
+<pre>patt: CustomPattern
+init: CustomExpression | null
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomDeclarator</p>
+
+<p>Callback to produce a custom variable declarator node.</p>
+
+<h3 id="表达式_3">表达式</h3>
+
+<h5 id="sequenceExpression(exprs_loc)"><code>sequenceExpression(exprs[, loc])</code></h5>
+
+<pre>exprs: [ CustomExpression ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom sequence expression node.</p>
+
+<h5 id="conditionalExpression(test_cons_alt_loc)"><code>conditionalExpression(test, cons, alt[, loc])</code></h5>
+
+<pre>test: CustomExpression
+cons: CustomExpression
+alt: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom conditional expression node.</p>
+
+<h5 id="unaryExpression(op_arg_isPrefix_loc)"><code>unaryExpression(op, arg, isPrefix[, loc])</code></h5>
+
+<pre>op: UnaryOperator
+arg: CustomExpression
+isPrefix: boolean
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom unary expression node.</p>
+
+<h5 id="binaryExpression(op_left_right_loc)"><code>binaryExpression(op, left, right[, loc])</code></h5>
+
+<pre>op: BinaryOperator
+left: CustomExpression
+right: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom binary expression node.</p>
+
+<h5 id="assignmentExpression(op_left_right_loc)"><code>assignmentExpression(op, left, right[, loc])</code></h5>
+
+<pre>op: AssignmentOperator
+left: CustomExpression
+right: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom assignment expression node.</p>
+
+<h5 id="logicalExpression(op_left_right_loc)"><code>logicalExpression(op, left, right[, loc])</code></h5>
+
+<pre>op: LogicalOperator
+left: CustomExpression
+right: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom logical expression node.</p>
+
+<h5 id="updateExpression(op_arg_isPrefix_loc)"><code>updateExpression(op, arg, isPrefix[, loc])</code></h5>
+
+<pre>op: UpdateOperator
+arg: CustomExpression
+isPrefix: boolean
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom update expression node.</p>
+
+<h5 id="newExpression(callee_args_loc)"><code>newExpression(callee, args[, loc])</code></h5>
+
+<pre>callee: CustomExpression
+args: [ CustomExpression ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom <code>new</code>-expression node.</p>
+
+<h5 id="callExpression(callee_args_loc)"><code>callExpression(callee, args[, loc])</code></h5>
+
+<pre>callee: CustomExpression
+args: [ CustomExpression ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom function call node.</p>
+
+<h5 id="memberExpression(obj_prop_isComputed_loc)"><code>memberExpression(obj, prop, isComputed[, loc])</code></h5>
+
+<pre>obj: CustomExpression
+prop: CustomIdentifier | CustomExpression
+isComputed: boolean
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom member expression node.</p>
+
+<h5 id="functionExpression(name_args_body_isGenerator_isExpression_loc)"><code>functionExpression(name, args, body, isGenerator, isExpression[, loc])</code></h5>
+
+<pre>name: CustomIdentifier | null
+args: [ CustomPattern ]
+body: CustomStatement | CustomExpression
+isGenerator: boolean
+isExpression: boolean
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom function expression node.</p>
+
+<h5 id="arrayExpression(elts_loc)"><code>arrayExpression(elts[, loc])</code></h5>
+
+<pre>elts: [ CustomExpression | null ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom array expression node.</p>
+
+<h5 id="objectExpression(props_loc)"><code>objectExpression(props[, loc])</code></h5>
+
+<pre>props: [ CustomObjectProperty ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom object expression node.</p>
+
+<h5 id="thisExpression(loc)"><code>thisExpression([loc])</code></h5>
+
+<pre>loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom <code>this</code> expression node.</p>
+
+<h5 id="graphExpression(index_expr_loc)"><code>graphExpression(index, expr[, loc])</code></h5>
+
+<pre>index: uint32 &gt;= 1
+expr: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom <code>graph</code> expression node.</p>
+
+<h5 id="graphIndexExpression(index_loc)"><code>graphIndexExpression(index[, loc])</code></h5>
+
+<pre>index: uint32 &gt;= 1
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom <code>graph index</code> expression node.</p>
+
+<h5 id="comprehensionExpression(body_blocks_filter_loc)"><code>comprehensionExpression(body, blocks, filter[, loc])</code></h5>
+
+<pre>body: CustomExpression
+blocks: [ CustomComprehensionBlock ]
+filter: CustomExpression | null
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom <code>comprehension</code> expression node.</p>
+
+<h5 id="generatorExpression(body_blocks_filter_loc)"><code>generatorExpression(body, blocks, filter[, loc])</code></h5>
+
+<pre>body: CustomExpression
+blocks: [ CustomComprehensionBlock ]
+filter: CustomExpression | null
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom <code>generator</code> expression node.</p>
+
+<h5 id="yieldExpression(arg_loc)"><code>yieldExpression(arg[, loc])</code></h5>
+
+<pre>arg: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom <code>yield</code> expression node.</p>
+
+<h5 id="letExpression(head_body_loc)"><code>letExpression(head, body[, loc])</code></h5>
+
+<pre>head: [ CustomDeclarator ]
+body: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomExpression</p>
+
+<p>Callback to produce a custom <code>let</code> expression node.</p>
+
+<h3 id="Patterns">Patterns</h3>
+
+<h5 id="arrayPattern(elts_loc)"><code>arrayPattern(elts[, loc])</code></h5>
+
+<pre>elts: [ CustomPattern | null ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomPattern</p>
+
+<p>Callback to produce a custom array destructuring pattern node.</p>
+
+<h5 id="objectPattern(props_loc)"><code>objectPattern(props[, loc])</code></h5>
+
+<pre>props: [ CustomPropertyPattern ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomPattern</p>
+
+<p>Callback to produce a custom object destructuring pattern node.</p>
+
+<h5 id="propertyPattern(key_patt_loc)"><code>propertyPattern(key, patt[, loc])</code></h5>
+
+<pre>key: CustomLiteral | CustomIdentifier
+patt: CustomPattern
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomPropertyPattern</p>
+
+<p>Callback to produce a custom object property destructuring pattern node.</p>
+
+<h3 id="Clauses">Clauses</h3>
+
+<h5 id="switchCase(test_cons_loc)"><code>switchCase(test, cons[, loc])</code></h5>
+
+<pre>test: CustomExpression | null
+cons: [ CustomStatement ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomSwitchCase</p>
+
+<p>Callback to produce a custom <code>case</code> or <code>default</code> clause node. The <strong><code>test</code></strong> argument is <code>null</code> if and only if the node is a <code>default</code> clause.</p>
+
+<h5 id="catchClause(arg_guard_body_loc)"><code>catchClause(arg, guard, body[, loc])</code></h5>
+
+<pre>arg: CustomPattern
+guard: CustomExpression
+body: CustomStatement
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomCatchClause</p>
+
+<p>Callback to produce a custom <code>catch</code> clause node.</p>
+
+<h5 id="comprehensionBlock(left_right_isForEach_loc)"><code>comprehensionBlock(left, right, isForEach[, loc])</code></h5>
+
+<pre>left: CustomPattern
+right: CustomExpression
+isForEach: boolean
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomComprehensionBlock</p>
+
+<p>Callback to produce a custom comprehension block node. The <strong><code>isForEach</code></strong> flag indicates whether the node is a <code>for each</code> block.</p>
+
+<h3 id="Miscellaneous">Miscellaneous</h3>
+
+<h5 id="identifier(name_loc)"><code>identifier(name[, loc])</code></h5>
+
+<pre>name: string
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomIdentifier/CustomPattern/CustomExpression</p>
+
+<p>Callback to produce a custom identifier node.</p>
+
+<h5 id="literal(val_loc)"><code>literal(val[, loc])</code></h5>
+
+<pre>val: string | boolean | null | number | RegExp
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomLiteral / CustomExpression</p>
+
+<p>Callback to produce a custom literal node.</p>
+
+<h5 id="property(kind_key_val_loc)"><code>property(kind, key, val[, loc])</code></h5>
+
+<pre>kind: "init" | "get" | "set"
+key: CustomLiteral | CustomIdentifier
+val: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomObjectProperty</p>
+
+<p>Callback to produce a custom object property initializer node.</p>
+
+<h3 id="E4X_2">E4X</h3>
+
+<h4 id="Declarations">Declarations</h4>
+
+<h5 id="xmlDefaultDeclaration(ns_loc)"><code>xmlDefaultDeclaration(ns[, loc])</code></h5>
+
+<pre>loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomDeclaration</p>
+
+<p>Callback to produce a custom XML default namespace declaration node.</p>
+
+<h4 id="Expressions">Expressions</h4>
+
+<h5 id="xmlAnyName(loc)"><code>xmlAnyName([loc])</code></h5>
+
+<pre>loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXMLAnyName/CustomXML/CustomExpression</p>
+
+<p>Callback to produce a custom XML node for the wildcard pseudo-identifier <code>*</code>.</p>
+
+<h5 id="xmlAttributeSelector(expr_loc)"><code>xmlAttributeSelector(expr[, loc])</code></h5>
+
+<pre>expr: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML/CustomExpression</p>
+
+<p>Callback to produce a custom XML attribute selector node.</p>
+
+<h5 id="xmlFilterExpression(left_right_loc)"><code>xmlFilterExpression(left, right[, loc])</code></h5>
+
+<pre>left: CustomExpression
+right: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML/CustomExpression</p>
+
+<p>Callback to produce a custom XML filter expression node.</p>
+
+<h5 id="xmlQualifiedIdentifier(left_right_isComputed_loc)"><code>xmlQualifiedIdentifier(left, right, isComputed[, loc])</code></h5>
+
+<pre>left: CustomIdentifier | CustomXMLAnyName
+right: CustomIdentifier | CustomExpression
+isComputed: boolean
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML/CustomExpression</p>
+
+<p>Callback to produce a custom qualified identifier node.</p>
+
+<h5 id="xmlFunctionQualifiedIdentifier(right_isComputed_loc)"><code>xmlFunctionQualifiedIdentifier(right, isComputed[, loc])</code></h5>
+
+<pre>right: CustomIdentifier | CustomExpression
+isComputed: boolean
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML/CustomExpression</p>
+
+<p>Callback to produce a custom XML <code>function</code>-qualified identifier node.</p>
+
+<h5 id="xmlElement(contents_loc)"><code>xmlElement(contents[, loc])</code></h5>
+
+<pre>contents: [ CustomXML ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML / CustomExpression</p>
+
+<p>Callback to produce a custom XML element node.</p>
+
+<h5 id="xmlList(contents_loc)"><code>xmlList(contents[, loc])</code></h5>
+
+<pre>contents: [ CustomXML ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML/CustomExpression</p>
+
+<p>Callback to produce a custom XML list node.</p>
+
+<h4 id="XML_2">XML</h4>
+
+<h5 id="xmlEscape(expr_loc)"><code>xmlEscape(expr[, loc])</code></h5>
+
+<pre>expr: CustomExpression
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML</p>
+
+<p>Callback to produce a custom XML escape node.</p>
+
+<h5 id="xmlText(text_loc)"><code>xmlText(text[, loc])</code></h5>
+
+<pre>text: string
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML</p>
+
+<p>Callback to produce a custom XML text node.</p>
+
+<h5 id="xmlStartTag(contents_loc)"><code>xmlStartTag(contents[, loc])</code></h5>
+
+<pre>contents: [ CustomXML ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML</p>
+
+<p>Callback to produce a custom XML start-tag node.</p>
+
+<h5 id="xmlEndTag(contents_loc)"><code>xmlEndTag(contents[, loc])</code></h5>
+
+<pre>contents: [ CustomXML ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML</p>
+
+<p>Callback to produce a custom XML end-tag node.</p>
+
+<h5 id="xmlPointTag(contents_loc)"><code>xmlPointTag(contents[, loc])</code></h5>
+
+<pre>contents: [ CustomXML ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML</p>
+
+<p>Callback to produce a custom XML point tag node.</p>
+
+<h5 id="xmlName(contents_loc)"><code>xmlName(contents[, loc])</code></h5>
+
+<pre>contents: string | [ CustomXML ]
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML</p>
+
+<p>Callback to produce a custom XML name node.</p>
+
+<h5 id="xmlAttribute(value_loc)"><code>xmlAttribute(value[, loc])</code></h5>
+
+<pre>value: string
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML</p>
+
+<p>Callback to produce a custom XML attribute node.</p>
+
+<h5 id="xmlCdata(contents_loc)"><code>xmlCdata(contents[, loc])</code></h5>
+
+<pre>contents: string
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML</p>
+
+<p>Callback to produce a custom XML <code>CDATA</code> node.</p>
+
+<h5 id="xmlComment(contents_loc)"><code>xmlComment(contents[, loc])</code></h5>
+
+<pre>contents: string
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML</p>
+
+<p>Callback to produce a custom XML comment node.</p>
+
+<h5 id="xmlProcessingInstruction(target_contents_loc)"><code>xmlProcessingInstruction(target, contents[, loc])</code></h5>
+
+<pre>target: string
+contents: string | null
+loc: SourceLocation
+</pre>
+
+<p><strong>返回:</strong> CustomXML</p>
+
+<p>Callback to produce a custom XML processing instruction node.</p>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/releases/index.html b/files/zh-cn/mozilla/projects/spidermonkey/releases/index.html
new file mode 100644
index 0000000000..fd88b37529
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/releases/index.html
@@ -0,0 +1,42 @@
+---
+title: SpiderMonkey releases
+slug: Mozilla/Projects/SpiderMonkey/Releases
+translation_of: Mozilla/Projects/SpiderMonkey/Releases
+---
+<div>{{SpiderMonkeySidebar("Releases")}}</div>
+
+<div class="summary">
+<p>本页开列了 <a href="/en-US/docs/Mozilla/Projects/SpiderMonkey">SpiderMonkey</a> 的版本记录.</p>
+</div>
+
+<div class="note">
+<p><strong>注意:</strong> 独立的 SpiderMonkey 并不是官方产品. Our continuous integration system does produce a tarball that is built into a binary that runs our smoke tests, but we do not maintain it nor actively test its suitability for general embedding. We have periodically created "releases", but they are best-effort and incomplete. We do happily accept patches, and make some effort to keep the tip of the Gecko tree minimally working as an embeddable source package. We are very limited in our ability to support older versions, including those labeled as "releases" on this page.</p>
+</div>
+
+<p>The easiest way to fetch the version corresponding to the current Firefox release is to visit the <a href="https://treeherder.mozilla.org/#/jobs?repo=mozilla-release&amp;filter-searchStr=spidermonkey-sm-package">treeherder page for the release repository</a> and click on the first SM(pkg) link you see. That will open a small window in the bottom left with a line like "<label>artifact uploaded:</label> <a href="https://queue.taskcluster.net/v1/task/e8X3tKITQTeSFhtdirD7Xg/runs/0/artifacts/public/build/mozjs-57.0.1.tar.bz2" title="artifact uploaded">mozjs-57.0.1.tar.bz2</a>".</p>
+
+<h2 id="当前版本">当前版本</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/52">SpiderMonkey 52</a></li>
+</ul>
+
+<h2 id="Future_release">Future release</h2>
+
+<ul>
+ <li>None</li>
+</ul>
+
+<h2 id="过往版本">过往版本</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/45">SpiderMonkey 45</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/38">SpiderMonkey 38</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/31">SpiderMonkey 31</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/24">SpiderMonkey 24</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/17">SpiderMonkey 17</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/1.8.8">SpiderMonkey 1.8.8</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/1.8.7">SpiderMonkey 1.8.7</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/1.8.5">SpiderMonkey 1.8.5</a></li>
+ <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/1.8">SpiderMonkey 1.8</a></li>
+</ul>
diff --git a/files/zh-cn/mozilla/projects/spidermonkey/split_object/index.html b/files/zh-cn/mozilla/projects/spidermonkey/split_object/index.html
new file mode 100644
index 0000000000..86d82e7d58
--- /dev/null
+++ b/files/zh-cn/mozilla/projects/spidermonkey/split_object/index.html
@@ -0,0 +1,72 @@
+---
+title: Split object
+slug: Mozilla/Projects/SpiderMonkey/Split_object
+translation_of: Mozilla/Projects/SpiderMonkey/Split_object
+---
+<p>In <a href="/en/SpiderMonkey" title="en/SpiderMonkey">SpiderMonkey</a>, a <strong>split object</strong> is made up of two <code><a href="/en/SpiderMonkey/JSAPI_Reference/JSObject" title="en/SpiderMonkey/JSAPI_Reference/JSObject">JSObject</a></code>s: an <strong>inner object</strong> and an <strong>outer object</strong>.</p>
+
+<p>Each half of a split object always has a pointer to the other half. Inner objects implement the <code><a href="/En/SpiderMonkey/JSAPI_Reference/JSExtendedClass.outerObject" title="En/SpiderMonkey/JSAPI_Reference/JSExtendedClass.outerObject">JSExtendedClass.outerObject</a></code> hook, which returns a pointer to the corresponding outer object. Outer objects implement the <code><a href="/En/SpiderMonkey/JSAPI_Reference/JSExtendedClass.outerObject" title="En/SpiderMonkey/JSAPI_Reference/JSExtendedClass.outerObject">JSExtendedClass.innerObject</a></code> hook. But the association is not fixed. An outer object may be associated with different inner objects at different times.</p>
+
+<p>This feature is complicated. Programs other than Mozilla that embed SpiderMonkey should avoid using split objects.</p>
+
+<h2 id="The_window_object" name="The_window_object">The <code>window</code> object</h2>
+
+<p>Split objects were introduced to resolve a problem posed by the <code><a href="/en/DOM/window" title="en/DOM/window">window</a></code> object. Three interrelated requirements on the <code>window</code> object seemed to conflict.</p>
+
+<ul>
+ <li>
+ <p>The <code>window</code> object is the global object for scripts in Web pages. Firefox has to maintain this for Web compatibility. For performance, access to global properties must be fast.</p>
+ </li>
+</ul>
+
+<ul>
+ <li>
+ <p>There is a glaring difference in the lifetime of the <code>window</code> object as seen from two different angles. Suppose a script in page A, in tab TA, has a reference to the <code>window</code> object of page B in another tab TB. The <code>window</code> object for tab TB must persist as the user navigates from page to page in that tab. To the script in page A, the <code>window</code> must appear to be a single object that moves from page to page. But each web page must load with fresh globals.</p>
+
+ <p>(The problem is even a bit subtler than this, since the reference may be direct or indirect. The script in A might have opened TB by calling <code><a href="/en/DOM/window.open" title="en/DOM/window.open">window.open</a></code>, which returns a direct reference to TB's <code>window</code>. More indirectly, suppose there's a JavaScript function defined in page B that refers to global variables in page B. If page A gets a reference to that function, then by calling it, it is indirectly accessing tab TB's <code>window</code>. The <code>Function</code> object carries a reference to the <code>window</code>, via the scope chain. To further complicate matters, A and B are in the same security domain, so security checks between them automatically succeed. This makes the problem resistant to a wrapper-based approach.)</p>
+
+ <p>Older versions of Firefox accomplished this by blowing away all <code>window</code> properties every time a user navigated to another page, then reusing the <code>window</code>. Each page, even on Back, had to load from scratch. This was slow. Circa Firefox 1.5, the decision was made to cache layout information and JavaScript state across navigation. A new approach for <code>window</code> was needed.</p>
+ </li>
+</ul>
+
+<ul>
+ <li>
+ <p>Security privileges are granted to JS code on the basis of the scope chain of the executing code. SpiderMonkey walks up the scope chain to the nearest object that has <code><a href="/en/SpiderMonkey/JSAPI_Reference/JSPrincipals" title="en/SpiderMonkey/JSAPI_Reference/JSPrincipals">JSPrincipals</a></code> attached. The end of the scope chain is the global object for the script. But what <code>JSPrincipals</code> should be attached to a <code>window</code> object? The principals of the page the window is <em>currently</em> displaying? But then the page that called <code>window.open</code> could use a <code>with</code> statement to inject that <code>window</code> into its scope chain, gaining access to that window's privileges. <em>(Note: <code>with</code> does add an object to the scope chain, but it's a special <code>With</code> wrapper object that is skipped, or something, during the search described here. This security feature is not peculiar to split objects. ...And yet, there is special code in jsobj.h with a comment about fixing some kind of interaction between <code>with</code> an split objects. Write that down, it'll be on the test.)</em></p>
+ </li>
+</ul>
+
+<p>Split objects were the solution. The inner <code>window</code> object is different for each page a browser window visits. It serves as the "globals" object and provides the <code>JSPrincipals</code> for scripts on that page. Access to inner <code>window</code> properties is fast. The outer <code>window</code> object is the object returned by <code>window.open</code>. It represents the window or tab itself and survives as the user navigates in that window or tab. The <code>window</code> object's <code><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass" title="en/SpiderMonkey/JSAPI_Reference/JSClass">JSClass</a>.resolve</code> hook ensures that properties of the inner object are visible via the outer object, if the running code has the right principals to access them. This privilege check may be slow.</p>
+
+<p>See {{ interwiki('wikimo', 'Gecko:SplitWindow', 'wikimo:Gecko:SplitWindow') }} and {{ Bug(296639) }} for more discussion.</p>
+
+<p>See also <a class="external" href="http://groups.google.com/group/mozilla.dev.tech.js-engine/msg/df81825b338fb84f" rel="freelink">http://groups.google.com/group/mozil...81825b338fb84f</a></p>
+
+<h2 id="Details" name="Details">Details</h2>
+
+<p>This section describes split objects as a feature of the JSAPI. It catalogues (and tries to explain) the subtle ways in which split objects affect SpiderMonkey's behavior.</p>
+
+<p>Split objects are only useful for implementing objects that will be on the scope chain of functions. SpiderMonkey assumes that inner and outer objects are dangerous in two different and complementary ways.</p>
+
+<p>Inner objects are dangerous because they have fast property accessors that do not perform security checks. Therefore, no function may be allowed to see an inner object that has different <code>JSPrincipals</code>. Apart from the security issue, if one page directly or indirectly gets a reference to another page's <code>window</code> object, that <code>window</code> object must appear to behave like the outer window and navigate from page to page. SpiderMonkey arranges this by not allowing JS code to see inner objects at all. To enforce this rule:</p>
+
+<ul>
+ <li>If <code>this</code> would evaluate to an inner object, it evaluates to the corresponding outer object instead.</li>
+</ul>
+
+<p>Outer objects are dangerous because their <code>JSPrincipals</code> may change over time. Because a <code>Function</code> inherits the <code>JSPrincipals</code> of its lexical scope (specifically, the nearest principals-aware object in its scope chain), untrusted code must <em>never</em> be able to make an outer object appear in a <code>Function</code>'s scope chain. Again, SpiderMonkey enforces a slightly stronger rule: outer objects may never appear in a scope chain at all, except when put there by an explicit C-level JSAPI call (to <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_SetParent" title="en/SpiderMonkey/JSAPI_Reference/JS_SetParent">JS_SetParent</a></code> or equivalent). (Several objects, such as <code><a href="/en/DOM/window.location" title="en/DOM/window.location">window.location</a></code> and <code><a href="/en/DOM/window.navigator" title="en/DOM/window.navigator">window.navigator</a></code>, are intentionally parented to the outer window object using such APIs.) To enforce this rule:</p>
+
+<ul>
+ <li>APIs that allow the caller to pass a scope object always check that object first and fail if any outer objects are on its scope chain.</li>
+</ul>
+
+<ul>
+ <li>In the spirit of this rule, <code><a href="/en/SpiderMonkey/JSAPI_Reference/JS_GetScopeChain" title="en/SpiderMonkey/JSAPI_Reference/JS_GetScopeChain">JS_GetScopeChain</a></code> should always return an inner object. But there is a special case when <code>JS_GetScopeChain</code> is called on a <code>JSContext</code> in which no code is currently running. By convention, the context's global object is returned in this case. For consistency with the rule, if that global object is an outer object, SpiderMonkey returns the inner object instead.</li>
+</ul>
+
+<p>Inner and outer objects are in certain other respects the same object:</p>
+
+<ul>
+ <li>If <code><a href="/en/JavaScript/Reference/Global_Objects/Object/hasOwnProperty" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/hasOwnProperty">Object.hasOwnProperty</a></code> is called on an inner object, and the named property is found on an outer object, that's considered close enough and <code>hasOwnProperty</code> returns <code>true</code>.</li>
+</ul>
+
+<p>Note that none of the rules listed here affects ordinary property accesses. SpiderMonkey's split object support, by itself, does not cause inner object properties to appear on the outer object or vice versa. Split objects that need this behavior must implement it in custom <code><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass" title="en/SpiderMonkey/JSAPI_Reference/JSClass">JSClass</a></code> hooks. In the case of <code>window</code>, each half has custom hooks.</p>