Преглед на файлове

Implement Object.hasOwn (#960)

* add Object.hasOwn

* remove unneeded change to csproj

* use test262 for Object.hasOwn
Gökhan Kurt преди 3 години
родител
ревизия
87ee8e2c4b
променени са 63 файла, в които са добавени 1368 реда и са изтрити 1 реда
  1. 15 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/descriptor.js
  2. 19 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown.js
  3. 16 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_exists.js
  4. 18 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter.js
  5. 22 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter.js
  6. 25 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter_configurable_enumerable.js
  7. 24 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter_configurable_nonenumerable.js
  8. 24 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter_nonconfigurable_enumerable.js
  9. 23 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter_nonconfigurable_nonenumerable.js
  10. 23 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_configurable_enumerable.js
  11. 22 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_configurable_nonenumerable.js
  12. 22 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_nonconfigurable_enumerable.js
  13. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_nonconfigurable_nonenumerable.js
  14. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_nonwritable_configurable_enumerable.js
  15. 20 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_nonwritable_configurable_nonenumerable.js
  16. 20 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_nonwritable_nonconfigurable_enumerable.js
  17. 19 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_nonwritable_nonconfigurable_nonenumerable.js
  18. 17 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_setter.js
  19. 22 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_setter_configurable_enumerable.js
  20. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_setter_configurable_nonenumerable.js
  21. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_setter_nonconfigurable_enumerable.js
  22. 20 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_setter_nonconfigurable_nonenumerable.js
  23. 22 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_writable_configurable_enumerable.js
  24. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_writable_configurable_nonenumerable.js
  25. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_writable_nonconfigurable_enumerable.js
  26. 20 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_writable_nonconfigurable_nonenumerable.js
  27. 13 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_nonexistent.js
  28. 17 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter.js
  29. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_and_setter.js
  30. 24 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_and_setter_configurable_enumerable.js
  31. 23 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_and_setter_configurable_nonenumerable.js
  32. 23 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_and_setter_nonconfigurable_enumerable.js
  33. 22 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_and_setter_nonconfigurable_nonenumerable.js
  34. 22 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_configurable_enumerable.js
  35. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_configurable_nonenumerable.js
  36. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_nonconfigurable_enumerable.js
  37. 20 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_nonconfigurable_nonenumerable.js
  38. 20 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_nonwritable_configurable_enumerable.js
  39. 19 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_nonwritable_nonconfigurable_enumerable.js
  40. 19 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_nonwriteable_configurable_nonenumerable.js
  41. 18 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_nonwriteable_nonconfigurable_nonenumerable.js
  42. 15 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_property_exists.js
  43. 16 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_setter.js
  44. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_setter_configurable_enumerable.js
  45. 20 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_setter_configurable_nonenumerable.js
  46. 20 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_setter_nonconfigurable_enumerable.js
  47. 19 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_setter_nonconfigurable_nonenumerable.js
  48. 21 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_writable_configurable_enumerable.js
  49. 20 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_writable_configurable_nonenumerable.js
  50. 20 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_writable_nonconfigurable_enumerable.js
  51. 19 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_writable_nonconfigurable_nonenumerable.js
  52. 31 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/length.js
  53. 28 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/name.js
  54. 33 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/not-a-constructor.js
  55. 13 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/prototype.js
  56. 32 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/symbol_own_property.js
  57. 35 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/symbol_property_toPrimitive.js
  58. 39 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/symbol_property_toString.js
  59. 37 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/symbol_property_valueOf.js
  60. 48 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/toobject_before_topropertykey.js
  61. 15 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/toobject_null.js
  62. 15 0
      Jint.Tests.Test262/test/built-ins/Object/hasOwn/toobject_undefined.js
  63. 9 1
      Jint/Native/Object/ObjectConstructor.cs

+ 15 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/descriptor.js

@@ -0,0 +1,15 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Testing descriptor property of Object.hasOwn
+includes:
+    - propertyHelper.js
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+verifyWritable(Object, "hasOwn");
+verifyNotEnumerable(Object, "hasOwn");
+verifyConfigurable(Object, "hasOwn");

+ 19 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown.js

@@ -0,0 +1,19 @@
+// Copyright 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+info: |
+    Object.hasOwn ( _O_, _P_ )
+
+    1. Let _obj_ be ? ToObject(_O_).
+    2. Let _key_ be ? ToPropertyKey(_P_).
+    3. Return ? HasOwnProperty(_obj_, _key_).
+description: >
+    Checking type of the Object.hasOwn and the returned result
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+assert.sameValue(typeof Object.hasOwn, 'function');
+assert(Object.hasOwn(Object, 'hasOwn'));

+ 16 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_exists.js

@@ -0,0 +1,16 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Properties - [[HasOwnProperty]] (old style inherited property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {
+  foo: 42
+};
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 18 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter.js

@@ -0,0 +1,18 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Properties - [[HasOwnProperty]] (literal inherited getter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {
+  get foo() {
+    return 42;
+  }
+};
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 22 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter.js

@@ -0,0 +1,22 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (literal inherited getter/setter
+    property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {
+  get foo() {
+    return 42;
+  },
+  set foo(x) {
+  }
+};
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 25 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter_configurable_enumerable.js

@@ -0,0 +1,25 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, enumerable
+    inherited getter/setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  get: function() {
+    return 42;
+  },
+  set: function() {;
+  },
+  enumerable: true,
+  configurable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 24 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter_configurable_nonenumerable.js

@@ -0,0 +1,24 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, non-enumerable
+    inherited getter/setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  get: function() {
+    return 42;
+  },
+  set: function() {;
+  },
+  configurable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 24 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter_nonconfigurable_enumerable.js

@@ -0,0 +1,24 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, enumerable
+    inherited getter/setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  get: function() {
+    return 42;
+  },
+  set: function() {;
+  },
+  enumerable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 23 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_and_setter_nonconfigurable_nonenumerable.js

@@ -0,0 +1,23 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
+    inherited getter/setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  get: function() {
+    return 42;
+  },
+  set: function() {;
+  }
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 23 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_configurable_enumerable.js

@@ -0,0 +1,23 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, enumerable
+    inherited getter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  get: function() {
+    return 42;
+  },
+  enumerable: true,
+  configurable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 22 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_configurable_nonenumerable.js

@@ -0,0 +1,22 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, non-enumerable
+    inherited getter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  get: function() {
+    return 42;
+  },
+  configurable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 22 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_nonconfigurable_enumerable.js

@@ -0,0 +1,22 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, enumerable
+    inherited getter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  get: function() {
+    return 42;
+  },
+  enumerable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_getter_nonconfigurable_nonenumerable.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
+    inherited getter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  get: function() {
+    return 42;
+  }
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_nonwritable_configurable_enumerable.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-writable, configurable,
+    enumerable inherited value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  value: 42,
+  configurable: true,
+  enumerable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_nonwritable_configurable_nonenumerable.js

@@ -0,0 +1,20 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-writable, configurable,
+    non-enumerable inherited value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  value: 42,
+  configurable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_nonwritable_nonconfigurable_enumerable.js

@@ -0,0 +1,20 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-writable, non-configurable,
+    enumerable inherited value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  value: 42,
+  enumerable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 19 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_nonwritable_nonconfigurable_nonenumerable.js

@@ -0,0 +1,19 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-writable, non-configurable,
+    non-enumerable inherited value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  value: 42
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 17 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_setter.js

@@ -0,0 +1,17 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Properties - [[HasOwnProperty]] (literal inherited setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {
+  set foo(x) {
+  }
+};
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 22 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_setter_configurable_enumerable.js

@@ -0,0 +1,22 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, enumerable
+    inherited setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  set: function() {;
+  },
+  enumerable: true,
+  configurable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_setter_configurable_nonenumerable.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, non-enumerable
+    inherited setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  set: function() {;
+  },
+  configurable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_setter_nonconfigurable_enumerable.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, enumerable
+    inherited setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  set: function() {;
+  },
+  enumerable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_setter_nonconfigurable_nonenumerable.js

@@ -0,0 +1,20 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
+    inherited setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  set: function() {;
+  }
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 22 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_writable_configurable_enumerable.js

@@ -0,0 +1,22 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (writable, configurable,
+    enumerable inherited value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  value: 42,
+  writable: true,
+  enumerable: true,
+  configurable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_writable_configurable_nonenumerable.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (writable, configurable,
+    non-enumerable inherited value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  value: 42,
+  writable: true,
+  configurable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_writable_nonconfigurable_enumerable.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (writable, non-configurable,
+    enumerable inherited value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  value: 42,
+  writable: true,
+  enumerable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_inherited_writable_nonconfigurable_nonenumerable.js

@@ -0,0 +1,20 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (writable, non-configurable,
+    non-enumerable inherited value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var base = {};
+Object.defineProperty(base, "foo", {
+  value: 42,
+  writable: true
+});
+var o = Object.create(base);
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 13 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_nonexistent.js

@@ -0,0 +1,13 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Properties - [[HasOwnProperty]] (property does not exist)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+
+assert.sameValue(Object.hasOwn(o, "foo"), false, 'Object.hasOwn(o, "foo")');

+ 17 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter.js

@@ -0,0 +1,17 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Properties - [[HasOwnProperty]] (literal own getter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {
+  get foo() {
+    return 42;
+  }
+};
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_and_setter.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (literal own getter/setter
+    property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {
+  get foo() {
+    return 42;
+  },
+  set foo(x) {
+  }
+};
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 24 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_and_setter_configurable_enumerable.js

@@ -0,0 +1,24 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, enumerable own
+    getter/setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  get: function() {
+    return 42;
+  },
+  set: function() {;
+  },
+  enumerable: true,
+  configurable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 23 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_and_setter_configurable_nonenumerable.js

@@ -0,0 +1,23 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, non-enumerable own
+    getter/setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  get: function() {
+    return 42;
+  },
+  set: function() {;
+  },
+  configurable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 23 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_and_setter_nonconfigurable_enumerable.js

@@ -0,0 +1,23 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, enumerable own
+    getter/setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  get: function() {
+    return 42;
+  },
+  set: function() {;
+  },
+  enumerable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 22 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_and_setter_nonconfigurable_nonenumerable.js

@@ -0,0 +1,22 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
+    own getter/setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  get: function() {
+    return 42;
+  },
+  set: function() {;
+  }
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 22 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_configurable_enumerable.js

@@ -0,0 +1,22 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, enumerable own
+    getter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  get: function() {
+    return 42;
+  },
+  enumerable: true,
+  configurable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_configurable_nonenumerable.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, non-enumerable own
+    getter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  get: function() {
+    return 42;
+  },
+  configurable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_nonconfigurable_enumerable.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, enumerable own
+    getter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  get: function() {
+    return 42;
+  },
+  enumerable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_getter_nonconfigurable_nonenumerable.js

@@ -0,0 +1,20 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
+    own getter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  get: function() {
+    return 42;
+  }
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_nonwritable_configurable_enumerable.js

@@ -0,0 +1,20 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-writable, configurable,
+    enumerable own value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  value: 42,
+  configurable: true,
+  enumerable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 19 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_nonwritable_nonconfigurable_enumerable.js

@@ -0,0 +1,19 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-writable, non-configurable,
+    enumerable own value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  value: 42,
+  enumerable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 19 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_nonwriteable_configurable_nonenumerable.js

@@ -0,0 +1,19 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-writable, configurable,
+    non-enumerable own value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  value: 42,
+  configurable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 18 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_nonwriteable_nonconfigurable_nonenumerable.js

@@ -0,0 +1,18 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-writable, non-configurable,
+    non-enumerable own value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  value: 42
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 15 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_property_exists.js

@@ -0,0 +1,15 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Properties - [[HasOwnProperty]] (old style own property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {
+  foo: 42
+};
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 16 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_setter.js

@@ -0,0 +1,16 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Properties - [[HasOwnProperty]] (literal own setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {
+  set foo(x) {
+  }
+};
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_setter_configurable_enumerable.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, enumerable own
+    setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  set: function() {;
+  },
+  enumerable: true,
+  configurable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_setter_configurable_nonenumerable.js

@@ -0,0 +1,20 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (configurable, non-enumerable own
+    setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  set: function() {;
+  },
+  configurable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_setter_nonconfigurable_enumerable.js

@@ -0,0 +1,20 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, enumerable own
+    setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  set: function() {;
+  },
+  enumerable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 19 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_setter_nonconfigurable_nonenumerable.js

@@ -0,0 +1,19 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (non-configurable, non-enumerable
+    own setter property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  set: function() {;
+  }
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 21 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_writable_configurable_enumerable.js

@@ -0,0 +1,21 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (writable, configurable,
+    enumerable own value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  value: 42,
+  writable: true,
+  enumerable: true,
+  configurable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_writable_configurable_nonenumerable.js

@@ -0,0 +1,20 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (writable, configurable,
+    non-enumerable own value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  value: 42,
+  writable: true,
+  configurable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 20 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_writable_nonconfigurable_enumerable.js

@@ -0,0 +1,20 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (writable, non-configurable,
+    enumerable own value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  value: 42,
+  writable: true,
+  enumerable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 19 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/hasown_own_writable_nonconfigurable_nonenumerable.js

@@ -0,0 +1,19 @@
+// Copyright (c) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Properties - [[HasOwnProperty]] (writable, non-configurable,
+    non-enumerable own value property)
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+var o = {};
+Object.defineProperty(o, "foo", {
+  value: 42,
+  writable: true
+});
+
+assert.sameValue(Object.hasOwn(o, "foo"), true, 'Object.hasOwn(o, "foo") !== true');

+ 31 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/length.js

@@ -0,0 +1,31 @@
+// Copyright (C) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+  Object.hasOwn.length is 2.
+info: |
+  Object.hasOwn ( _O_, _P_ )
+
+  ECMAScript Standard Built-in Objects
+
+  Every built-in function object, including constructors, has a "length"
+  property whose value is an integer. Unless otherwise specified, this
+  value is equal to the largest number of named arguments shown in the
+  subclause headings for the function description.
+
+  Unless otherwise specified, the "length" property of a built-in Function
+  object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+  [[Configurable]]: true }.
+includes: [propertyHelper.js]
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+verifyProperty(Object.hasOwn, "length", {
+  value: 2,
+  writable: false,
+  enumerable: false,
+  configurable: true,
+});

+ 28 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/name.js

@@ -0,0 +1,28 @@
+// Copyright (C) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+  Object.hasOwn.name is "hasOwn".
+info: |
+  Object.hasOwn ( _O_, _P_ )
+
+  17 ECMAScript Standard Built-in Objects:
+    Every built-in Function object, including constructors, that is not
+    identified as an anonymous function has a name property whose value
+    is a String.
+
+    Unless otherwise specified, the name property of a built-in Function
+    object, if it exists, has the attributes { [[Writable]]: false,
+    [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+assert.sameValue(Object.hasOwn.name, "hasOwn");
+
+verifyNotEnumerable(Object.hasOwn, "name");
+verifyNotWritable(Object.hasOwn, "name");
+verifyConfigurable(Object.hasOwn, "name");

+ 33 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/not-a-constructor.js

@@ -0,0 +1,33 @@
+// Copyright (C) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-ecmascript-standard-built-in-objects
+description: >
+  Object.hasOwn does not implement [[Construct]], is not new-able
+info: |
+  ECMAScript Function Objects
+
+  Built-in function objects that are not identified as constructors do not
+  implement the [[Construct]] internal method unless otherwise specified in
+  the description of a particular function.
+
+  sec-evaluatenew
+
+  ...
+  7. If IsConstructor(constructor) is false, throw a TypeError exception.
+  ...
+includes: [isConstructor.js]
+author: Jamie Kyle
+features: [Reflect.construct, arrow-function, Object.hasOwn]
+---*/
+
+assert.sameValue(
+  isConstructor(Object.hasOwn),
+  false,
+  'isConstructor(Object.hasOwn) must return false'
+);
+
+assert.throws(TypeError, () => {
+  new Object.hasOwn('');
+}, '`new Object.hasOwn(\'\')` throws TypeError');

+ 13 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/prototype.js

@@ -0,0 +1,13 @@
+// Copyright 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+info: Object.hasOwn has not prototype property
+description: >
+    Checking if obtaining the prototype property of Object.hasOwn fails
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+assert.sameValue(Object.hasOwn.prototype, undefined);

+ 32 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/symbol_own_property.js

@@ -0,0 +1,32 @@
+// Copyright (C) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Object.hasOwn called with symbol property key
+info: |
+  Object.hasOwn ( _O_, _P_ )
+
+  1. Let _obj_ be ? ToObject(_O_).
+  1. Let _key_ be ? ToPropertyKey(_P_).
+  ...
+author: Jamie Kyle
+features: [Symbol, Object.hasOwn]
+---*/
+
+var obj = {};
+var sym = Symbol();
+
+assert.sameValue(
+  Object.hasOwn(obj, sym),
+  false,
+  "Returns false if symbol own property not found"
+);
+
+obj[sym] = 0;
+
+assert.sameValue(
+  Object.hasOwn(obj, sym),
+  true,
+  "Returns true if symbol own property found"
+);

+ 35 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/symbol_property_toPrimitive.js

@@ -0,0 +1,35 @@
+// Copyright (C) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Object.hasOwn with symbol and @@toPrimitive conversion
+info: |
+  Object.hasOwn ( _O_, _P_ )
+
+  1. Let _obj_ be ? ToObject(_O_).
+  1. Let _key_ be ? ToPropertyKey(_P_).
+  ...
+author: Jamie Kyle
+features: [Symbol.toPrimitive, Object.hasOwn]
+---*/
+
+var obj = {};
+var sym = Symbol();
+
+var callCount = 0;
+var wrapper = {};
+wrapper[Symbol.toPrimitive] = function() {
+  callCount += 1;
+  return sym;
+};
+
+obj[sym] = 0;
+
+assert.sameValue(
+  Object.hasOwn(obj, wrapper),
+  true,
+  "Returns true if symbol own property found"
+);
+
+assert.sameValue(callCount, 1, "toPrimitive method called exactly once");

+ 39 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/symbol_property_toString.js

@@ -0,0 +1,39 @@
+// Copyright (C) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Object.hasOwn with symbol and toString conversion
+info: |
+  Object.hasOwn ( _O_, _P_ )
+
+  1. Let _obj_ be ? ToObject(_O_).
+  1. Let _key_ be ? ToPropertyKey(_P_).
+  ...
+author: Jamie Kyle
+features: [Symbol, Object.hasOwn]
+---*/
+
+var obj = {};
+var sym = Symbol();
+
+var callCount = 0;
+var wrapper = {
+  toString: function() {
+    callCount += 1;
+    return sym;
+  },
+  valueOf: function () {
+    throw new Test262Error("valueOf() called")
+  }
+};
+
+obj[sym] = 0;
+
+assert.sameValue(
+  Object.hasOwn(obj, wrapper),
+  true,
+  "Returns true if symbol own property found"
+);
+
+assert.sameValue(callCount, 1, "toString method called exactly once");

+ 37 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/symbol_property_valueOf.js

@@ -0,0 +1,37 @@
+// Copyright (C) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: Object.hasOwn with symbol and valueOf conversion
+info: |
+  Object.hasOwn ( _O_, _P_ )
+
+  1. Let _obj_ be ? ToObject(_O_).
+  2. Let _key_ be ? ToPropertyKey(_P_).
+  ...
+author: Jamie Kyle
+features: [Symbol, Object.hasOwn]
+---*/
+
+var obj = {};
+var sym = Symbol();
+
+var callCount = 0;
+var wrapper = {
+  valueOf: function() {
+    callCount += 1;
+    return sym;
+  },
+  toString: null
+};
+
+obj[sym] = 0;
+
+assert.sameValue(
+  Object.hasOwn(obj, wrapper),
+  true,
+  "Returns true if symbol own property found"
+);
+
+assert.sameValue(callCount, 1, "valueOf method called exactly once");

+ 48 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/toobject_before_topropertykey.js

@@ -0,0 +1,48 @@
+// Copyright (C) 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-object.hasown
+description: >
+  ToObject is performed before ToPropertyKey.
+info: |
+  Object.hasOwn ( _O_, _P_ )
+
+  1. Let _obj_ be ? ToObject(_O_).
+  2. Let _key_ be ? ToPropertyKey(_P_).
+
+  ToPropertyKey ( argument )
+
+  1. Let key be ? ToPrimitive(argument, hint String).
+author: Jamie Kyle
+features: [Symbol.toPrimitive, Object.hasOwn]
+---*/
+
+var callCount1 = 0;
+var coercibleKey1 = {
+  get toString() {
+    callCount1++;
+    throw new Test262Error();
+  },
+  get valueOf() {
+    callCount1++;
+    throw new Test262Error();
+  },
+};
+
+assert.throws(TypeError, function() {
+  Object.hasOwn(null, coercibleKey1);
+});
+assert.sameValue(callCount1, 0, "toString and valueOf must not be called");
+
+
+var callCount2 = 0;
+var coercibleKey2 = {};
+coercibleKey2[Symbol.toPrimitive] = function() {
+  callCount2++;
+  throw new Test262Error();
+};
+
+assert.throws(TypeError, function() {
+  Object.hasOwn(undefined, coercibleKey2);
+});
+assert.sameValue(callCount2, 0, "Symbol.toPrimitive must not be called");

+ 15 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/toobject_null.js

@@ -0,0 +1,15 @@
+// Copyright 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Let O be the result of calling ToObject passing the this value as
+    the argument.
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+assert.throws(TypeError, function() {
+  Object.hasOwn(null, 'foo');
+});

+ 15 - 0
Jint.Tests.Test262/test/built-ins/Object/hasOwn/toobject_undefined.js

@@ -0,0 +1,15 @@
+// Copyright 2021 Jamie Kyle.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-object.hasown
+description: >
+    Let O be the result of calling ToObject passing the this value as
+    the argument.
+author: Jamie Kyle
+features: [Object.hasOwn]
+---*/
+
+assert.throws(TypeError, function() {
+  Object.hasOwn(undefined, 'foo');
+});

+ 9 - 1
Jint/Native/Object/ObjectConstructor.cs

@@ -50,7 +50,8 @@ namespace Jint.Native.Object
                 ["isExtensible"] = new PropertyDescriptor(new ClrFunctionInstance(Engine, "isExtensible", IsExtensible, 1), propertyFlags),
                 ["keys"] = new PropertyDescriptor(new ClrFunctionInstance(Engine, "keys", Keys, 1, lengthFlags), propertyFlags),
                 ["values"] = new PropertyDescriptor(new ClrFunctionInstance(Engine, "values", Values, 1, lengthFlags), propertyFlags),
-                ["setPrototypeOf"] = new PropertyDescriptor(new ClrFunctionInstance(Engine, "setPrototypeOf", SetPrototypeOf, 2, lengthFlags), propertyFlags)
+                ["setPrototypeOf"] = new PropertyDescriptor(new ClrFunctionInstance(Engine, "setPrototypeOf", SetPrototypeOf, 2, lengthFlags), propertyFlags),
+                ["hasOwn"] = new PropertyDescriptor(new ClrFunctionInstance(Engine, "hasOwn", HasOwn, 2, lengthFlags), propertyFlags),
             };
             SetProperties(properties);
         }
@@ -219,6 +220,13 @@ namespace Jint.Native.Object
             return o;
         }
 
+        private JsValue HasOwn(JsValue thisObject, JsValue[] arguments)
+        {
+            var o = TypeConverter.ToObject(_realm, arguments.At(0));
+            var property = TypeConverter.ToPropertyKey(arguments.At(1));
+            return o.HasOwnProperty(property) ? JsBoolean.True : JsBoolean.False;
+        }
+
         internal JsValue GetOwnPropertyDescriptor(JsValue thisObject, JsValue[] arguments)
         {
             var o = TypeConverter.ToObject(_realm, arguments.At(0));