GlobalObject.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. using System.Globalization;
  2. using System.Linq;
  3. using System.Runtime.CompilerServices;
  4. using System.Text;
  5. using Esprima;
  6. using Jint.Native.Object;
  7. using Jint.Native.String;
  8. using Jint.Runtime;
  9. using Jint.Runtime.Descriptors;
  10. namespace Jint.Native.Global
  11. {
  12. public sealed partial class GlobalObject : ObjectInstance
  13. {
  14. private readonly Realm _realm;
  15. private readonly StringBuilder _stringBuilder = new();
  16. internal GlobalObject(
  17. Engine engine,
  18. Realm realm) : base(engine, ObjectClass.Object, InternalTypes.Object | InternalTypes.PlainObject)
  19. {
  20. _realm = realm;
  21. }
  22. private JsValue ToStringString(JsValue thisObject, JsValue[] arguments)
  23. {
  24. return _realm.Intrinsics.Object.PrototypeObject.ToObjectString(thisObject, Arguments.Empty);
  25. }
  26. /// <summary>
  27. /// https://tc39.es/ecma262/#sec-parseint-string-radix
  28. /// </summary>
  29. public static JsValue ParseInt(JsValue thisObject, JsValue[] arguments)
  30. {
  31. var inputString = TypeConverter.ToString(arguments.At(0));
  32. var trimmed = StringPrototype.TrimEx(inputString);
  33. var s = trimmed.AsSpan();
  34. var radix = arguments.Length > 1 ? TypeConverter.ToInt32(arguments[1]) : 0;
  35. var hexStart = s.Length > 1 && trimmed.StartsWith("0x", StringComparison.OrdinalIgnoreCase);
  36. var stripPrefix = true;
  37. if (radix == 0)
  38. {
  39. radix = hexStart ? 16 : 10;
  40. }
  41. else if (radix < 2 || radix > 36)
  42. {
  43. return JsNumber.DoubleNaN;
  44. }
  45. else if (radix != 16)
  46. {
  47. stripPrefix = false;
  48. }
  49. // check fast case
  50. if (radix == 10 && int.TryParse(trimmed, NumberStyles.Integer, CultureInfo.InvariantCulture, out var number))
  51. {
  52. return JsNumber.Create(number);
  53. }
  54. var sign = 1;
  55. if (s.Length > 0)
  56. {
  57. var c = s[0];
  58. if (c == '-')
  59. {
  60. sign = -1;
  61. }
  62. if (c is '-' or '+')
  63. {
  64. s = s.Slice(1);
  65. }
  66. }
  67. if (stripPrefix && hexStart)
  68. {
  69. s = s.Slice(2);
  70. }
  71. if (s.Length == 0)
  72. {
  73. return double.NaN;
  74. }
  75. var hasResult = false;
  76. double result = 0;
  77. double pow = 1;
  78. for (var i = s.Length - 1; i >= 0; i--)
  79. {
  80. var digit = s[i];
  81. var index = digit switch
  82. {
  83. >= '0' and <= '9' => digit - '0',
  84. >= 'a' and <= 'z' => digit - 'a' + 10,
  85. >= 'A' and <= 'Z' => digit - 'A' + 10,
  86. _ => -1
  87. };
  88. if (index == -1 || index >= radix)
  89. {
  90. // reset
  91. hasResult = false;
  92. result = 0;
  93. pow = 1;
  94. continue;
  95. }
  96. hasResult = true;
  97. result += index * pow;
  98. pow *= radix;
  99. }
  100. return hasResult ? JsNumber.Create(sign * result) : JsNumber.DoubleNaN;
  101. }
  102. /// <summary>
  103. /// https://tc39.es/ecma262/#sec-parsefloat-string
  104. /// </summary>
  105. public static JsValue ParseFloat(JsValue thisObject, JsValue[] arguments)
  106. {
  107. var inputString = TypeConverter.ToString(arguments.At(0));
  108. var trimmedString = StringPrototype.TrimStartEx(inputString);
  109. if (string.IsNullOrWhiteSpace(trimmedString))
  110. {
  111. return JsNumber.DoubleNaN;
  112. }
  113. // start of string processing
  114. var i = 0;
  115. // check known string constants
  116. if (!char.IsDigit(trimmedString[0]))
  117. {
  118. if (trimmedString[0] == '-')
  119. {
  120. i++;
  121. if (trimmedString.Length > 1 && trimmedString[1] == 'I' && trimmedString.StartsWith("-Infinity", StringComparison.Ordinal))
  122. {
  123. return JsNumber.DoubleNegativeInfinity;
  124. }
  125. }
  126. if (trimmedString[0] == '+')
  127. {
  128. i++;
  129. if (trimmedString.Length > 1 && trimmedString[1] == 'I' && trimmedString.StartsWith("+Infinity", StringComparison.Ordinal))
  130. {
  131. return JsNumber.DoublePositiveInfinity;
  132. }
  133. }
  134. if (trimmedString.StartsWith("Infinity", StringComparison.Ordinal))
  135. {
  136. return JsNumber.DoublePositiveInfinity;
  137. }
  138. if (trimmedString.StartsWith("NaN", StringComparison.Ordinal))
  139. {
  140. return JsNumber.DoubleNaN;
  141. }
  142. }
  143. // find the starting part of string that is still acceptable JS number
  144. var dotFound = false;
  145. var exponentFound = false;
  146. while (i < trimmedString.Length)
  147. {
  148. var c = trimmedString[i];
  149. if (Character.IsDecimalDigit(c))
  150. {
  151. i++;
  152. continue;
  153. }
  154. if (c == '.')
  155. {
  156. if (dotFound)
  157. {
  158. // does not look right
  159. break;
  160. }
  161. i++;
  162. dotFound = true;
  163. continue;
  164. }
  165. if (c is 'e' or 'E')
  166. {
  167. if (exponentFound)
  168. {
  169. // does not look right
  170. break;
  171. }
  172. i++;
  173. exponentFound = true;
  174. continue;
  175. }
  176. if (c is '+' or '-' && trimmedString[i - 1] is 'e' or 'E')
  177. {
  178. // ok
  179. i++;
  180. continue;
  181. }
  182. break;
  183. }
  184. while (exponentFound && i > 0 && !Character.IsDecimalDigit(trimmedString[i - 1]))
  185. {
  186. // we are missing required exponent number part info
  187. i--;
  188. }
  189. // we should now have proper input part
  190. #if SUPPORTS_SPAN_PARSE
  191. var substring = trimmedString.AsSpan(0, i);
  192. #else
  193. var substring = trimmedString.Substring(0, i);
  194. #endif
  195. const NumberStyles Styles = NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent | NumberStyles.AllowLeadingSign;
  196. if (double.TryParse(substring, Styles, CultureInfo.InvariantCulture, out var d))
  197. {
  198. return d;
  199. }
  200. return JsNumber.DoubleNaN;
  201. }
  202. /// <summary>
  203. /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.2.4
  204. /// </summary>
  205. public static JsValue IsNaN(JsValue thisObject, JsValue[] arguments)
  206. {
  207. var value = arguments.At(0);
  208. if (ReferenceEquals(value, JsNumber.DoubleNaN))
  209. {
  210. return true;
  211. }
  212. var x = TypeConverter.ToNumber(value);
  213. return double.IsNaN(x);
  214. }
  215. /// <summary>
  216. /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.2.5
  217. /// </summary>
  218. public static JsValue IsFinite(JsValue thisObject, JsValue[] arguments)
  219. {
  220. if (arguments.Length != 1)
  221. {
  222. return false;
  223. }
  224. var n = TypeConverter.ToNumber(arguments.At(0));
  225. if (double.IsNaN(n) || double.IsInfinity(n))
  226. {
  227. return false;
  228. }
  229. return true;
  230. }
  231. private static readonly string UriReserved = new (new [] { ';', '/', '?', ':', '@', '&', '=', '+', '$', ',' });
  232. private static readonly string UriUnescaped = new(new [] { '-', '_', '.', '!', '~', '*', '\'', '(', ')' });
  233. private static readonly string UnescapedUriSet = UriReserved + UriUnescaped + '#';
  234. private static readonly string ReservedUriSet = UriReserved + '#';
  235. private const string HexaMap = "0123456789ABCDEF";
  236. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  237. private static bool IsValidHexaChar(char c) => Uri.IsHexDigit(c);
  238. /// <summary>
  239. /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.2
  240. /// </summary>
  241. /// <param name="thisObject"></param>
  242. /// <param name="arguments"></param>
  243. /// <returns></returns>
  244. public JsValue EncodeUri(JsValue thisObject, JsValue[] arguments)
  245. {
  246. var uriString = TypeConverter.ToString(arguments.At(0));
  247. return Encode(uriString, UnescapedUriSet);
  248. }
  249. /// <summary>
  250. /// http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.4
  251. /// </summary>
  252. /// <param name="thisObject"></param>
  253. /// <param name="arguments"></param>
  254. /// <returns></returns>
  255. public JsValue EncodeUriComponent(JsValue thisObject, JsValue[] arguments)
  256. {
  257. var uriString = TypeConverter.ToString(arguments.At(0));
  258. return Encode(uriString, UriUnescaped);
  259. }
  260. private JsValue Encode(string uriString, string unescapedUriSet)
  261. {
  262. var strLen = uriString.Length;
  263. _stringBuilder.EnsureCapacity(uriString.Length);
  264. _stringBuilder.Clear();
  265. var buffer = new byte[4];
  266. for (var k = 0; k < strLen; k++)
  267. {
  268. var c = uriString[k];
  269. if (c is >= 'a' and <= 'z' || c is >= 'A' and <= 'Z' || c is >= '0' and <= '9' || unescapedUriSet.IndexOf(c) != -1)
  270. {
  271. _stringBuilder.Append(c);
  272. }
  273. else
  274. {
  275. if (c >= 0xDC00 && c <= 0xDBFF)
  276. {
  277. goto uriError;
  278. }
  279. int v;
  280. if (c < 0xD800 || c > 0xDBFF)
  281. {
  282. v = c;
  283. }
  284. else
  285. {
  286. k++;
  287. if (k == strLen)
  288. {
  289. goto uriError;
  290. }
  291. var kChar = (int) uriString[k];
  292. if (kChar is < 0xDC00 or > 0xDFFF)
  293. {
  294. goto uriError;
  295. }
  296. v = (c - 0xD800) * 0x400 + (kChar - 0xDC00) + 0x10000;
  297. }
  298. var length = 1;
  299. switch (v)
  300. {
  301. case >= 0 and <= 0x007F:
  302. // 00000000 0zzzzzzz -> 0zzzzzzz
  303. buffer[0] = (byte) v;
  304. break;
  305. case <= 0x07FF:
  306. // 00000yyy yyzzzzzz -> 110yyyyy ; 10zzzzzz
  307. length = 2;
  308. buffer[0] = (byte) (0xC0 | (v >> 6));
  309. buffer[1] = (byte) (0x80 | (v & 0x3F));
  310. break;
  311. case <= 0xD7FF:
  312. // xxxxyyyy yyzzzzzz -> 1110xxxx; 10yyyyyy; 10zzzzzz
  313. length = 3;
  314. buffer[0] = (byte) (0xE0 | (v >> 12));
  315. buffer[1] = (byte) (0x80 | ((v >> 6) & 0x3F));
  316. buffer[2] = (byte) (0x80 | (v & 0x3F));
  317. break;
  318. case <= 0xDFFF:
  319. goto uriError;
  320. case <= 0xFFFF:
  321. length = 3;
  322. buffer[0] = (byte) (0xE0 | (v >> 12));
  323. buffer[1] = (byte) (0x80 | ((v >> 6) & 0x3F));
  324. buffer[2] = (byte) (0x80 | (v & 0x3F));
  325. break;
  326. default:
  327. length = 4;
  328. buffer[0] = (byte) (0xF0 | (v >> 18));
  329. buffer[1] = (byte) (0x80 | (v >> 12 & 0x3F));
  330. buffer[2] = (byte) (0x80 | (v >> 6 & 0x3F));
  331. buffer[3] = (byte) (0x80 | (v >> 0 & 0x3F));
  332. break;
  333. }
  334. for (var i = 0; i < length; i++)
  335. {
  336. var octet = buffer[i];
  337. var x1 = HexaMap[octet / 16];
  338. var x2 = HexaMap[octet % 16];
  339. _stringBuilder.Append('%').Append(x1).Append(x2);
  340. }
  341. }
  342. }
  343. return _stringBuilder.ToString();
  344. uriError:
  345. _engine.SignalError(ExceptionHelper.CreateUriError(_realm, "URI malformed"));
  346. return null!;
  347. }
  348. public JsValue DecodeUri(JsValue thisObject, JsValue[] arguments)
  349. {
  350. var uriString = TypeConverter.ToString(arguments.At(0));
  351. return Decode(uriString, ReservedUriSet);
  352. }
  353. public JsValue DecodeUriComponent(JsValue thisObject, JsValue[] arguments)
  354. {
  355. var componentString = TypeConverter.ToString(arguments.At(0));
  356. return Decode(componentString, null);
  357. }
  358. private JsValue Decode(string uriString, string? reservedSet)
  359. {
  360. var strLen = uriString.Length;
  361. _stringBuilder.EnsureCapacity(strLen);
  362. _stringBuilder.Clear();
  363. #if SUPPORTS_SPAN_PARSE
  364. Span<byte> octets = stackalloc byte[4];
  365. #else
  366. var octets = new byte[4];
  367. #endif
  368. for (var k = 0; k < strLen; k++)
  369. {
  370. var C = uriString[k];
  371. if (C != '%')
  372. {
  373. _stringBuilder.Append(C);
  374. }
  375. else
  376. {
  377. var start = k;
  378. if (k + 2 >= strLen)
  379. {
  380. goto uriError;
  381. }
  382. var c1 = uriString[k + 1];
  383. var c2 = uriString[k + 2];
  384. if (!IsValidHexaChar(c1) || !IsValidHexaChar(c2))
  385. {
  386. goto uriError;
  387. }
  388. var B = StringToIntBase16(uriString.AsSpan(k + 1, 2));
  389. k += 2;
  390. if ((B & 0x80) == 0)
  391. {
  392. C = (char)B;
  393. #pragma warning disable CA2249
  394. if (reservedSet == null || reservedSet.IndexOf(C) == -1)
  395. #pragma warning restore CA2249
  396. {
  397. _stringBuilder.Append(C);
  398. }
  399. else
  400. {
  401. _stringBuilder.Append(uriString, start, k - start + 1);
  402. }
  403. }
  404. else
  405. {
  406. var n = 0;
  407. for (; ((B << n) & 0x80) != 0; n++)
  408. {
  409. }
  410. if (n == 1 || n > 4)
  411. {
  412. goto uriError;
  413. }
  414. octets[0] = B;
  415. if (k + (3 * (n - 1)) >= strLen)
  416. {
  417. goto uriError;
  418. }
  419. for (var j = 1; j < n; j++)
  420. {
  421. k++;
  422. if (uriString[k] != '%')
  423. {
  424. goto uriError;
  425. }
  426. c1 = uriString[k + 1];
  427. c2 = uriString[k + 2];
  428. if (!IsValidHexaChar(c1) || !IsValidHexaChar(c2))
  429. {
  430. goto uriError;
  431. }
  432. B = StringToIntBase16(uriString.AsSpan(k + 1, 2));
  433. // B & 11000000 != 10000000
  434. if ((B & 0xC0) != 0x80)
  435. {
  436. goto uriError;
  437. }
  438. k += 2;
  439. octets[j] = B;
  440. }
  441. #if SUPPORTS_SPAN_PARSE
  442. _stringBuilder.Append(Encoding.UTF8.GetString(octets.Slice(0, n)));
  443. #else
  444. _stringBuilder.Append(Encoding.UTF8.GetString(octets, 0, n));
  445. #endif
  446. }
  447. }
  448. }
  449. return _stringBuilder.ToString();
  450. uriError:
  451. _engine.SignalError(ExceptionHelper.CreateUriError(_realm, "URI malformed"));
  452. return null!;
  453. }
  454. private static byte StringToIntBase16(ReadOnlySpan<char> s)
  455. {
  456. var i = 0;
  457. var length = s.Length;
  458. if (s[i] == '+')
  459. {
  460. i++;
  461. }
  462. if (i + 1 < length && s[i] == '0')
  463. {
  464. if (s[i + 1] == 'x' || s[i + 1] == 'X')
  465. {
  466. i += 2;
  467. }
  468. }
  469. uint result = 0;
  470. while (i < s.Length && IsDigit(s[i], 16, out var value))
  471. {
  472. result = result * 16 + (uint) value;
  473. i++;
  474. }
  475. return (byte) (int) result;
  476. }
  477. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  478. private static bool IsDigit(char c, int radix, out int result)
  479. {
  480. int tmp;
  481. if ((uint)(c - '0') <= 9)
  482. {
  483. result = tmp = c - '0';
  484. }
  485. else if ((uint)(c - 'A') <= 'Z' - 'A')
  486. {
  487. result = tmp = c - 'A' + 10;
  488. }
  489. else if ((uint)(c - 'a') <= 'z' - 'a')
  490. {
  491. result = tmp = c - 'a' + 10;
  492. }
  493. else
  494. {
  495. result = -1;
  496. return false;
  497. }
  498. return tmp < radix;
  499. }
  500. /// <summary>
  501. /// http://www.ecma-international.org/ecma-262/5.1/#sec-B.2.1
  502. /// </summary>
  503. public JsValue Escape(JsValue thisObject, JsValue[] arguments)
  504. {
  505. const string WhiteList = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@*_ + -./";
  506. var uriString = TypeConverter.ToString(arguments.At(0));
  507. var strLen = uriString.Length;
  508. _stringBuilder.EnsureCapacity(strLen);
  509. _stringBuilder.Clear();
  510. for (var k = 0; k < strLen; k++)
  511. {
  512. var c = uriString[k];
  513. if (WhiteList.IndexOf(c) != -1)
  514. {
  515. _stringBuilder.Append(c);
  516. }
  517. else if (c < 256)
  518. {
  519. _stringBuilder.Append('%').AppendFormat(CultureInfo.InvariantCulture, "{0:X2}", (int) c);
  520. }
  521. else
  522. {
  523. _stringBuilder.Append("%u").AppendFormat(CultureInfo.InvariantCulture, "{0:X4}", (int) c);
  524. }
  525. }
  526. return _stringBuilder.ToString();
  527. }
  528. /// <summary>
  529. /// http://www.ecma-international.org/ecma-262/5.1/#sec-B.2.2
  530. /// </summary>
  531. public JsValue Unescape(JsValue thisObject, JsValue[] arguments)
  532. {
  533. var uriString = TypeConverter.ToString(arguments.At(0));
  534. var strLen = uriString.Length;
  535. _stringBuilder.EnsureCapacity(strLen);
  536. _stringBuilder.Clear();
  537. for (var k = 0; k < strLen; k++)
  538. {
  539. var c = uriString[k];
  540. if (c == '%')
  541. {
  542. if (k <= strLen - 6
  543. && uriString[k + 1] == 'u'
  544. && uriString.Skip(k + 2).Take(4).All(IsValidHexaChar))
  545. {
  546. var joined = string.Join(string.Empty, uriString.Skip(k + 2).Take(4));
  547. c = (char) int.Parse(joined, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
  548. k += 5;
  549. }
  550. else if (k <= strLen - 3
  551. && uriString.Skip(k + 1).Take(2).All(IsValidHexaChar))
  552. {
  553. var joined = string.Join(string.Empty, uriString.Skip(k + 1).Take(2));
  554. c = (char) int.Parse(joined, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
  555. k += 2;
  556. }
  557. }
  558. _stringBuilder.Append(c);
  559. }
  560. return _stringBuilder.ToString();
  561. }
  562. // optimized versions with string parameter and without virtual dispatch for global environment usage
  563. internal bool HasProperty(Key property)
  564. {
  565. return GetOwnProperty(property) != PropertyDescriptor.Undefined;
  566. }
  567. internal PropertyDescriptor GetProperty(Key property) => GetOwnProperty(property);
  568. internal bool DefinePropertyOrThrow(Key property, PropertyDescriptor desc)
  569. {
  570. if (!DefineOwnProperty(property, desc))
  571. {
  572. ExceptionHelper.ThrowTypeError(_realm);
  573. }
  574. return true;
  575. }
  576. internal bool DefineOwnProperty(Key property, PropertyDescriptor desc)
  577. {
  578. var current = GetOwnProperty(property);
  579. if (current == desc)
  580. {
  581. return true;
  582. }
  583. // check fast path
  584. if ((current._flags & PropertyFlag.MutableBinding) != PropertyFlag.None)
  585. {
  586. current._value = desc.Value;
  587. return true;
  588. }
  589. return ValidateAndApplyPropertyDescriptor(this, new JsString(property), true, desc, current);
  590. }
  591. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  592. internal PropertyDescriptor GetOwnProperty(Key property)
  593. {
  594. Properties!.TryGetValue(property, out var descriptor);
  595. return descriptor ?? PropertyDescriptor.Undefined;
  596. }
  597. internal bool SetFromMutableBinding(Key property, JsValue value, bool strict)
  598. {
  599. // here we are called only from global environment record context
  600. // we can take some shortcuts to be faster
  601. if (!_properties!.TryGetValue(property, out var existingDescriptor))
  602. {
  603. if (strict)
  604. {
  605. ExceptionHelper.ThrowReferenceNameError(_realm, property.Name);
  606. }
  607. _properties[property] = new PropertyDescriptor(value, PropertyFlag.ConfigurableEnumerableWritable | PropertyFlag.MutableBinding);
  608. return true;
  609. }
  610. if (existingDescriptor.IsDataDescriptor())
  611. {
  612. if (!existingDescriptor.Writable || existingDescriptor.IsAccessorDescriptor())
  613. {
  614. return false;
  615. }
  616. // check fast path
  617. if ((existingDescriptor._flags & PropertyFlag.MutableBinding) != PropertyFlag.None)
  618. {
  619. existingDescriptor._value = value;
  620. return true;
  621. }
  622. // slow path
  623. return DefineOwnProperty(property, new PropertyDescriptor(value, PropertyFlag.None));
  624. }
  625. if (existingDescriptor.Set is not ICallable setter)
  626. {
  627. return false;
  628. }
  629. setter.Call(this, new[] {value});
  630. return true;
  631. }
  632. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  633. internal void SetOwnProperty(Key property, PropertyDescriptor desc)
  634. {
  635. SetProperty(property, desc);
  636. }
  637. }
  638. }