Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

212
Visualizações
Weird breakpoint in the chrome debugger

I was debugging my javascript code in the chrome console the other day and suddenly started hitting a breakpoint in some code I don't recognize. Is it possible that it is a part of the console itself and by accident there was a breakpoint created?

The thing is that this breakpoint was being hit over and over even when I was just typing in the console on a blank page with no scripts running.
Here is the code as it looks in the debugger:

(function i(t){let e;e="string"===t?new String(""):"number"===t?new Number(0):"bigint"===t?Object(BigInt(0)):"boolean"===t?new Boolean(!1):this;const s=[];try{for(let i=e;i;i=Object.getPrototypeOf(i)){if(("array"===t||"typedarray"===t)&&i===e&&i.length>9999)continue;const n={items:[],title:void 0,__proto__:null};try{"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,"constructor")&&i.constructor&&i.constructor.name&&(n.title=i.constructor.name)}catch(t){}s[s.length]=n;const o=Object.getOwnPropertyNames(i),r=Array.isArray(i);for(let t=0;t<o.length&&n.items.length<1e4;++t)r&&/^[0-9]/.test(o[t])||(n.items[n.items.length]=o[t])}}catch(t){}return s})

enter image description here

It looks like it's doing some type checking and returning some primitives, but it is pretty weird. Anyone got any idea what's going on?

Update:

I went through the code with the step icon in the debugger and apparently, the variable o used in the loop in the end of the code was the list of like +- 1000 JS registered names (like "String", "Promise", "URLSearchParams", "TouchList", "DeviceMotionEventAcceleration", ...). Perhaps this is a part of the autocomplete tool in the console?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda