Index: src/symbol.js |
diff --git a/src/symbol.js b/src/symbol.js |
index 050e7d918a02e83934883f280ec75be9424ba9db..baf861c142b3d86d0d3dd854f6b38fe3a54e426d 100644 |
--- a/src/symbol.js |
+++ b/src/symbol.js |
@@ -68,6 +68,19 @@ function SymbolValueOf() { |
return %_ValueOf(this); |
} |
+// ES6 19.1.2.8 |
+function ObjectGetOwnPropertySymbols(obj) { |
+ if (!IS_SPEC_OBJECT(obj)) { |
+ throw MakeTypeError("called_on_non_object", |
+ ["Object.getOwnPropertySymbols"]); |
+ } |
+ |
+ // TODO(arv): Proxies use a shared trap for String and Symbol keys. |
+ |
+ return ObjectGetOwnPropertyKeys(obj, true); |
+} |
+ |
+ |
//------------------------------------------------------------------- |
function SetUpSymbol() { |
@@ -85,3 +98,13 @@ function SetUpSymbol() { |
} |
SetUpSymbol(); |
+ |
+function ExtendObject() { |
+ %CheckIsBootstrapping(); |
+ |
+ InstallFunctions($Object, DONT_ENUM, $Array( |
+ "getOwnPropertySymbols", ObjectGetOwnPropertySymbols |
+ )); |
+} |
+ |
+ExtendObject(); |