Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple JavaScript code crashed Firefox

In Firebug's console

var a = [];
a[0] = a;

crashed Firefox!

Why?

edit:

  1. This statement is logically correct, and there is nothing bad about referencing recursion. Therefor it's a bug in browser Firebug.
  2. Works fine in Chrome and Opera.
  3. I'm using last official versions of Firebug and Firefox

edit 2: It crashes in Firebug console and works in native Firefox web console

like image 396
Viller Avatar asked Feb 25 '12 10:02

Viller


People also ask

Why does JavaScript keep crashing?

Most unpredictable crashes in Javascript are caused by memory leaks - objects that are still stored in memory and not being picked up by the garbage collector.

Why JavaScript is not working in my browser?

On the web browser menu click on the "Edit" and select "Preferences". In the "Preferences" window select the "Security" tab. In the "Security" tab section "Web content" mark the "Enable JavaScript" checkbox. Click on the "Reload the current page" button of the web browser to refresh the page.

How do I test JavaScript code in Firefox?

In Firefox, the shortcut to open them is CTRL+SHIFT+K. Then go to the Console tab, and you can type JavaScript.

What is the problem with JavaScript?

These days, most cross-browser JavaScript problems are seen: When poor-quality browser-sniffing code, feature-detection code, and vendor prefix usage block browsers from running code they could otherwise use just fine. When developers make use of new/nascent JavaScript features, modern Web APIs, etc.)


1 Answers

I think this is a firebug bug.

It works fine in the built-in firefox console (ctrl+shift+k), the chrome console, and the opera console.

I'd file a bug report with firebug.

like image 128
Dagg Nabbit Avatar answered Oct 11 '22 03:10

Dagg Nabbit