You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
389 B

4 years ago
  1. 'use strict';
  2. var every = require('./every');
  3. module.exports = function isSamePropertyDescriptor(ES, D1, D2) {
  4. var fields = [
  5. '[[Configurable]]',
  6. '[[Enumerable]]',
  7. '[[Get]]',
  8. '[[Set]]',
  9. '[[Value]]',
  10. '[[Writable]]'
  11. ];
  12. return every(fields, function (field) {
  13. if ((field in D1) !== (field in D2)) {
  14. return false;
  15. }
  16. return ES.SameValue(D1[field], D2[field]);
  17. });
  18. };