aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/javascript/reference/global_objects/reflect/isextensible/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/javascript/reference/global_objects/reflect/isextensible/index.html')
-rw-r--r--files/ja/web/javascript/reference/global_objects/reflect/isextensible/index.html104
1 files changed, 104 insertions, 0 deletions
diff --git a/files/ja/web/javascript/reference/global_objects/reflect/isextensible/index.html b/files/ja/web/javascript/reference/global_objects/reflect/isextensible/index.html
new file mode 100644
index 0000000000..e3ee426638
--- /dev/null
+++ b/files/ja/web/javascript/reference/global_objects/reflect/isextensible/index.html
@@ -0,0 +1,104 @@
+---
+title: Reflect.isExtensible()
+slug: Web/JavaScript/Reference/Global_Objects/Reflect/isExtensible
+tags:
+ - ECMAScript 2015
+ - JavaScript
+ - Method
+ - Reference
+ - Reflect
+translation_of: Web/JavaScript/Reference/Global_Objects/Reflect/isExtensible
+---
+<div>{{JSRef}}</div>
+
+<p><span class="seoSummary">静的な <strong><code>Reflect.isExtensible()</code></strong> メソッドは 、オブジェクトを拡張できるかを測定します (オブジェクトに追加された新しいプロパティを持てるかどうか)。これは {{jsxref("Object.isExtensible()")}} に似ていますが、いくつかの<a href="#Difference_to_Object.isExtensible">違いがあります</a>。</span></p>
+
+<div>{{EmbedInteractiveExample("pages/js/reflect-isextensible.html", "taller")}}</div>
+
+<div class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</div>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox notranslate">Reflect.isExtensible(<var>target</var>)
+</pre>
+
+<h3 id="Parameters" name="Parameters">引数</h3>
+
+<dl>
+ <dt><code><var>target</var></code></dt>
+ <dd>拡張できるかどうかをチェックする対象のオブジェクト。</dd>
+</dl>
+
+<h3 id="Return_value" name="Return_value">返値</h3>
+
+<p>対象が拡張可能かどうかを示す {{jsxref("Boolean")}} 値。</p>
+
+<h3 id="Exceptions" name="Exceptions">例外</h3>
+
+<p>{{jsxref("TypeError")}}: <code>target</code> が {{jsxref("Object")}} ではなかった場合。</p>
+
+<h2 id="Description" name="Description">解説</h2>
+
+<p><code>Reflect.isExtensible</code> メソッドは 、オブジェクトを拡張できるかを測定します(オブジェクトに追加された新しいプロパティを持てるかどうか)。これは {{jsxref("Object.isExtensible()")}} と同じメソッドです。</p>
+
+<h2 id="Examples" name="Examples">例</h2>
+
+<h3 id="Using_Reflect.isExtensible" name="Using_Reflect.isExtensible">Reflect.isExtensible() の使用</h3>
+
+<p>{{jsxref("Object.isExtensible()")}} も見てください。</p>
+
+<pre class="brush: js notranslate">// 今オブジェクトは拡張可能。
+let empty = {}
+Reflect.isExtensible(empty) // === true
+
+// ...しかし、変更できます
+Reflect.preventExtensions(empty)
+Reflect.isExtensible(empty) // === false
+
+// シールドオブジェクトは拡張できないように定義される。
+let sealed = Object.seal({})
+Reflect.isExtensible(sealed) // === false
+
+// フローズンオブジェクトも拡張できないように定義される。
+let frozen = Object.freeze({})
+Reflect.isExtensible(frozen) // === false
+</pre>
+
+<h3 id="Difference_to_Object.isExtensible" name="Difference_to_Object.isExtensible">Object.isExtensible() との違い</h3>
+
+<p>このメソッドへの最初の引数がオブジェクトではなかった (プリミティブであった) 場合、これは {{jsxref("TypeError")}} を引き起こします。{{jsxref("Object.isExtensible()")}} だと、オブジェクトではない最初の引数はオブジェクトに強制的に変換されます。</p>
+
+<pre class="brush: js notranslate">Reflect.isExtensible(1)
+// TypeError: 1 はオブジェクトではない
+
+Object.isExtensible(1)
+// false
+</pre>
+
+<h2 id="Specifications" name="Specifications">仕様書</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">仕様書</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-reflect.isextensible', 'Reflect.isExtensible')}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
+
+<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>
+
+<p>{{Compat("javascript.builtins.Reflect.isExtensible")}}</p>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li>{{jsxref("Reflect")}}</li>
+ <li>{{jsxref("Object.isExtensible()")}}</li>
+</ul>