mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-03 10:31:10 +08:00
None of the breaking changes listed in https://github.com/mochajs/mocha/releases/tag/v7.0.0 appear to be relevant for us. R=jacktfranklin@chromium.org DISABLE_THIRD_PARTY_CHECK=Update Mocha Bug: 1068145 Change-Id: I4aec1e775595a0cfcfaa307a8aad7fc9abad22ca Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137392 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
41 lines
985 B
JavaScript
Generated
41 lines
985 B
JavaScript
Generated
'use strict';
|
|
|
|
var GetIntrinsic = require('../GetIntrinsic');
|
|
|
|
var $TypeError = GetIntrinsic('%TypeError%');
|
|
|
|
var DefineOwnProperty = require('../helpers/DefineOwnProperty');
|
|
|
|
var FromPropertyDescriptor = require('./FromPropertyDescriptor');
|
|
var IsDataDescriptor = require('./IsDataDescriptor');
|
|
var IsPropertyKey = require('./IsPropertyKey');
|
|
var SameValue = require('./SameValue');
|
|
var Type = require('./Type');
|
|
|
|
// https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty
|
|
|
|
module.exports = function CreateMethodProperty(O, P, V) {
|
|
if (Type(O) !== 'Object') {
|
|
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
|
}
|
|
|
|
if (!IsPropertyKey(P)) {
|
|
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
|
}
|
|
|
|
var newDesc = {
|
|
'[[Configurable]]': true,
|
|
'[[Enumerable]]': false,
|
|
'[[Value]]': V,
|
|
'[[Writable]]': true
|
|
};
|
|
return DefineOwnProperty(
|
|
IsDataDescriptor,
|
|
SameValue,
|
|
FromPropertyDescriptor,
|
|
O,
|
|
P,
|
|
newDesc
|
|
);
|
|
};
|