首页 > 编程语言 >JavaScript所有内部属性列表 [[Configurable]] 等

JavaScript所有内部属性列表 [[Configurable]] 等

时间:2023-01-11 00:33:50浏览次数:46  
标签:11 10 13 15 14 17 JavaScript 列表 Configurable

简介

据MDN文档所说内部属性是由 [[···]] 包裹的内容,于是我们去复制 ECMA-262 标准的所有文字部分,然后用正则统计 [[···]] 的出现并打印

效果

image

代码

经老大提醒,这里的正则并不能完整匹配字母

'use strict';
let re = /\[\[[A-z]+\]\]/g;
let f = ()=>{
  let m = new Map()
  for (const x of a.match(re)) {
    let t = m.get(x) || 0
    m.set(x,++t)
  }
  let arr = []
  for (const [k,v] of m) {
    arr.push({k,v})
  }
  arr.sort((a,b)=>{
    return b.v - a.v
  })
  // console.log(arr.map(x=>JSON.stringify(x)).join('\n'))
  console.log(arr.slice(0,25));
}
var a = `Reference number...(注意这里要自己去粘贴,方法就是下载pdf全选复制)`
f();

所以结果呢??

{"k":"[[Value]]","v":276}
{"k":"[[Configurable]]","v":232}
{"k":"[[Writable]]","v":218}
{"k":"[[Enumerable]]","v":212}
{"k":"[[Prototype]]","v":119}
{"k":"[[Type]]","v":86}
{"k":"[[Status]]","v":77}
{"k":"[[Get]]","v":74}
{"k":"[[Set]]","v":73}
{"k":"[[Done]]","v":70}
{"k":"[[Key]]","v":65}
{"k":"[[GetOwnProperty]]","v":61}
{"k":"[[Call]]","v":60}
{"k":"[[Construct]]","v":57}
{"k":"[[ViewedArrayBuffer]]","v":54}
{"k":"[[GetPrototypeOf]]","v":44}
{"k":"[[DefineOwnProperty]]","v":42}
{"k":"[[TypedArrayName]]","v":42}
{"k":"[[ArrayLength]]","v":39}
{"k":"[[ArrayBufferData]]","v":38}
{"k":"[[Promise]]","v":37}
{"k":"[[OwnPropertyKeys]]","v":34}
{"k":"[[Delete]]","v":33}
{"k":"[[Realm]]","v":32}
{"k":"[[Target]]","v":31}
{"k":"[[Reject]]","v":31}
{"k":"[[DateValue]]","v":30}
{"k":"[[PendingAsyncDependencies]]","v":29}
{"k":"[[LocalName]]","v":28}
{"k":"[[Resolve]]","v":28}
{"k":"[[EvaluationError]]","v":27}
{"k":"[[DFSAncestorIndex]]","v":27}
{"k":"[[ReferencedName]]","v":26}
{"k":"[[Extensible]]","v":26}
{"k":"[[ByteOffset]]","v":26}
{"k":"[[AsyncEvaluation]]","v":26}
{"k":"[[ModuleRequest]]","v":26}
{"k":"[[SetPrototypeOf]]","v":25}
{"k":"[[ImportName]]","v":25}
{"k":"[[ProxyHandler]]","v":23}
{"k":"[[ProxyTarget]]","v":23}
{"k":"[[AsyncGeneratorState]]","v":23}
{"k":"[[ExportName]]","v":23}
{"k":"[[Capability]]","v":23}
{"k":"[[IsExtensible]]","v":22}
{"k":"[[Base]]","v":22}
{"k":"[[MapData]]","v":22}
{"k":"[[HasProperty]]","v":21}
{"k":"[[DFSIndex]]","v":21}
{"k":"[[PreventExtensions]]","v":20}
{"k":"[[Order]]","v":20}
{"k":"[[BindingName]]","v":19}
{"k":"[[SetData]]","v":19}
{"k":"[[ByteIndex]]","v":18}
{"k":"[[Iterator]]","v":18}
{"k":"[[AlreadyCalled]]","v":18}
{"k":"[[Description]]","v":17}
{"k":"[[Block]]","v":17}
{"k":"[[Kind]]","v":17}
{"k":"[[StringData]]","v":17}
{"k":"[[ECMAScriptCode]]","v":17}
{"k":"[[ContentType]]","v":17}
{"k":"[[ArrayBufferByteLength]]","v":17}
{"k":"[[Strict]]","v":16}
{"k":"[[Module]]","v":16}
{"k":"[[ErrorData]]","v":16}
{"k":"[[Index]]","v":16}
{"k":"[[RemainingElements]]","v":16}
{"k":"[[NoTear]]","v":15}
{"k":"[[ElementSize]]","v":15}
{"k":"[[Environment]]","v":15}
{"k":"[[WeakRefTarget]]","v":15}
{"k":"[[ByteLength]]","v":15}
{"k":"[[GeneratorBrand]]","v":15}
{"k":"[[CycleRoot]]","v":15}
{"k":"[[AsyncParentModules]]","v":15}
{"k":"[[PromiseState]]","v":15}
{"k":"[[OriginalFlags]]","v":15}
{"k":"[[ThisValue]]","v":14}
{"k":"[[NumberData]]","v":14}
{"k":"[[RegExpMatcher]]","v":14}
{"k":"[[BindingObject]]","v":14}
{"k":"[[ObjectRecord]]","v":14}
{"k":"[[Cells]]","v":14}
{"k":"[[GeneratorState]]","v":14}
{"k":"[[TopLevelCapability]]","v":14}
{"k":"[[Min]]","v":14}
{"k":"[[Max]]","v":14}
{"k":"[[HappensBefore]]","v":14}
{"k":"[[EventList]]","v":13}
{"k":"[[EventsRecords]]","v":13}
{"k":"[[OuterEnv]]","v":13}
{"k":"[[WeakMapData]]","v":13}
{"k":"[[ParameterMap]]","v":13}
{"k":"[[Indent]]","v":13}
{"k":"[[WeakSetData]]","v":12}
{"k":"[[InitialName]]","v":12}
{"k":"[[Values]]","v":12}
{"k":"[[CandidateExecution]]","v":11}
{"k":"[[IsHTMLDDA]]","v":11}
{"k":"[[BooleanData]]","v":11}
{"k":"[[SourceText]]","v":11}
{"k":"[[ThisBindingStatus]]","v":11}
{"k":"[[HostDefined]]","v":11}
{"k":"[[HasTLA]]","v":11}
{"k":"[[Handler]]","v":11}
{"k":"[[AgentSignifier]]","v":10}
{"k":"[[Payload]]","v":10}
{"k":"[[CodeUnitCount]]","v":10}
{"k":"[[NextMethod]]","v":10}
{"k":"[[DeclarativeRecord]]","v":10}
{"k":"[[GlobalEnv]]","v":10}
{"k":"[[AsyncGeneratorQueue]]","v":10}
{"k":"[[StartIndex]]","v":10}
{"k":"[[Intrinsics]]","v":9}
{"k":"[[Callback]]","v":9}
{"k":"[[LittleEndian]]","v":9}
{"k":"[[IsClassConstructor]]","v":9}
{"k":"[[DataView]]","v":9}
{"k":"[[SyncIteratorRecord]]","v":9}
{"k":"[[VarNames]]","v":8}
{"k":"[[Exports]]","v":8}
{"k":"[[CodePoint]]","v":8}
{"k":"[[AlreadyResolved]]","v":8}
{"k":"[[Job]]","v":8}
{"k":"[[ReadsFrom]]","v":8}
{"k":"[[BigIntData]]","v":7}
{"k":"[[IsUnpairedSurrogate]]","v":7}
{"k":"[[BoundTargetFunction]]","v":7}
{"k":"[[FunctionObject]]","v":7}
{"k":"[[ThisMode]]","v":7}
{"k":"[[Names]]","v":7}
{"k":"[[ConstructorKind]]","v":7}
{"k":"[[GeneratorContext]]","v":7}
{"k":"[[PromiseResult]]","v":7}
{"k":"[[OriginalSource]]","v":7}
{"k":"[[EndIndex]]","v":7}
{"k":"[[Stack]]","v":7}
{"k":"[[PromiseFulfillReactions]]","v":7}
{"k":"[[PromiseRejectReactions]]","v":7}
{"k":"[[HostSynchronizesWith]]","v":7}
{"k":"[[SynchronizesWith]]","v":7}
{"k":"[[Event]]","v":6}
{"k":"[[ChosenValue]]","v":6}
{"k":"[[ChosenValues]]","v":6}
{"k":"[[SymbolData]]","v":6}
{"k":"[[UnregisterToken]]","v":6}
{"k":"[[CleanupCallback]]","v":6}
{"k":"[[ClassFieldInitializerName]]","v":6}
{"k":"[[Namespace]]","v":6}
{"k":"[[Object]]","v":6}
{"k":"[[ObjectWasVisited]]","v":6}
{"k":"[[AsyncGeneratorContext]]","v":6}
{"k":"[[ModifyOp]]","v":6}
{"k":"[[Gap]]","v":6}
{"k":"[[PromiseIsHandled]]","v":6}
{"k":"[[ReadsBytesFrom]]","v":6}
{"k":"[[PrivateElements]]","v":5}
{"k":"[[IsWithEnvironment]]","v":5}
{"k":"[[NewTarget]]","v":5}
{"k":"[[HomeObject]]","v":5}
{"k":"[[GlobalThisValue]]","v":5}
{"k":"[[GlobalObject]]","v":5}
{"k":"[[TemplateMap]]","v":5}
{"k":"[[Array]]","v":5}
{"k":"[[Closure]]","v":5}
{"k":"[[RequestedModules]]","v":5}
{"k":"[[IndirectExportEntries]]","v":5}
{"k":"[[Completion]]","v":5}
{"k":"[[AgentOrder]]","v":5}
{"k":"[[PrivateMethods]]","v":4}
{"k":"[[Fields]]","v":4}
{"k":"[[OuterPrivateEnvironment]]","v":4}
{"k":"[[Site]]","v":4}
{"k":"[[CanBlock]]","v":4}
{"k":"[[Signifier]]","v":4}
{"k":"[[KeptAlive]]","v":4}
{"k":"[[AgentSynchronizesWith]]","v":4}
{"k":"[[HeldValue]]","v":4}
{"k":"[[FormalParameters]]","v":4}
{"k":"[[BoundArguments]]","v":4}
{"k":"[[ImportMeta]]","v":4}
{"k":"[[VisitedKeys]]","v":4}
{"k":"[[RemainingKeys]]","v":4}
{"k":"[[LocalExportEntries]]","v":4}
{"k":"[[StarExportEntries]]","v":4}
{"k":"[[Symbol]]","v":4}
{"k":"[[Greedy]]","v":4}
{"k":"[[CharSet]]","v":4}
{"k":"[[Invert]]","v":4}
{"k":"[[ArrayBufferDetachKey]]","v":4}
{"k":"[[Errors]]","v":4}
{"k":"[[RevocableProxy]]","v":4}
{"k":"[[Name]]","v":3}
{"k":"[[Initializer]]","v":3}
{"k":"[[BodyFunction]]","v":3}
{"k":"[[PrivateEnvironment]]","v":3}
{"k":"[[ScriptOrModule]]","v":3}
{"k":"[[BoundThis]]","v":3}
{"k":"[[Context]]","v":3}
{"k":"[[ImportEntries]]","v":3}
{"k":"[[ReplacerFunction]]","v":3}
{"k":"[[PropertyList]]","v":3}
{"k":"[[Class]]","v":1}

标签:11,10,13,15,14,17,JavaScript,列表,Configurable
From: https://www.cnblogs.com/dou-fu-gan/p/17042595.html

相关文章

  • JavaScript学习笔记—运算符
    运算符(操作符):可以用来对一个或多个操作数(值)进行运算1.算术运算符:+加法运算符-减法运算符*乘法运算符/触发运算符**幂运算%模运算算术运算时,除了字符串的加......
  • JavaScript 错误 throw、try、catch
    JavaScript错误throw、try、catchtry:语句测试代码的错误;catch:语句处理错误;throw:语句创建自定义错误;finally:语句在try和catch语句之后,无论是否有触发异常,该语句都会执行......
  • [JavaScript]判断是否为pc页面、是否为ios页面
    常用于pc页面与h5页面的跳转和适配,区分不同设备进行下载跳转区分。 varis_pc=!(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|......
  • JavaScript 扁平数据与树形结构数据的转换
    一、扁平转树形在JavaScript中,可以使用递归算法将扁平的数据转换为树形结构。扁平数据通常是一个带有parentId属性的数组,而树形结构通常是一个带有children属性......
  • JavaScript 实用工具方法库
     utils.jsimportmomentfrom'moment';exportfunctionfixedZero(val){returnval*1<10?`0${val}`:val;}exportfunctiongetTimeDistance(type){......
  • javaScript Object.is和==和===
    ##相等运算符(==)==相等运算符在判断相等前对两边的变量(如果它们不是同一类型)进行强制转换1.如果操作数具有相同的类型,则按如下方式进行比较:-对象:`true`仅......
  • JavaScript 将base64 转换为File
    在JavaScript中,可以使用Blob对象将base64字符串转换为File对象。 方法一(推荐,但存在兼容性问题):首先,你需要从base64字符串中获取文件类型,然后将文件类型和......
  • JavaScript 中URL 查询字符串(query string)的序列与反序列化
    方法一:在JavaScript中,可以使用URLSearchParams对象来处理URL中的查询字符串。序列化(将JavaScript对象转换为查询字符串)可以使用URLSearchParams对象的append(......
  • JavaScript 计算base64编码图片大小
    JavaScript可以通过获取图片的base64编码并计算其大小来计算图片大小。方法一://计算base64编码图片大小functiongetBase64ImageSize(base64){ if(base64){ b......
  • 【首页】商品列表和单个商品组件封装
    一、【首页】商品列表和单个商品组件封装1.1完成效果为:1.2组件再次说明    commodityList.vue组件为:商品列表组件    commodity.vue   组件为:......