X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Fcore-js%2Fmodules%2Fes.function.name.js;h=8c989ed9ff91f8190bc9107520126949bdbea412;hb=3be0a9efc698a9570a44456009afc6014812625a;hp=2312d91ddd7f1f88ca244d3066b7b4b4da1471d6;hpb=3aba54c891969552833dbc350b3139e944e17a97;p=dotfiles%2F.git diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.function.name.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.function.name.js index 2312d91d..8c989ed9 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.function.name.js +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.function.name.js @@ -1,19 +1,22 @@ var DESCRIPTORS = require('../internals/descriptors'); +var FUNCTION_NAME_EXISTS = require('../internals/function-name').EXISTS; +var uncurryThis = require('../internals/function-uncurry-this'); var defineProperty = require('../internals/object-define-property').f; var FunctionPrototype = Function.prototype; -var FunctionPrototypeToString = FunctionPrototype.toString; -var nameRE = /^\s*function ([^ (]*)/; +var functionToString = uncurryThis(FunctionPrototype.toString); +var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/; +var regExpExec = uncurryThis(nameRE.exec); var NAME = 'name'; // Function instances `.name` property -// https://tc39.github.io/ecma262/#sec-function-instances-name -if (DESCRIPTORS && !(NAME in FunctionPrototype)) { +// https://tc39.es/ecma262/#sec-function-instances-name +if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) { defineProperty(FunctionPrototype, NAME, { configurable: true, get: function () { try { - return FunctionPrototypeToString.call(this).match(nameRE)[1]; + return regExpExec(nameRE, functionToString(this))[1]; } catch (error) { return ''; }