()
| 116 | |
| 117 | // 取得原生函数代码表示 |
| 118 | const getNativeCodeSegs = () => { |
| 119 | const k = "propertyIsEnumerable"; // 选用 Object.propertyIsEnumerable 取得原生函数代码表示 |
| 120 | const codeSeg = `${Object[k]}`; |
| 121 | const idx1 = codeSeg.indexOf(k); |
| 122 | const idx2 = codeSeg.indexOf("()"); |
| 123 | const idx3 = codeSeg.lastIndexOf("("); |
| 124 | if (idx1 > 0 && idx2 > 0 && idx3 === idx2) { |
| 125 | return [codeSeg.substring(0, idx1), codeSeg.substring(idx1 + k.length)]; |
| 126 | } |
| 127 | return null; |
| 128 | }; |
| 129 | |
| 130 | const ncs = getNativeCodeSegs(); |
| 131 |