Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6885583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:39:10+00:00 2026-05-27T05:39:10+00:00

Is there some limitation of javascript function length on Opera? I’ve tested, how efficient

  • 0

Is there some limitation of javascript function length on Opera?

I’ve tested, how efficient solution will be to provide dictionaries as javascript function that tests what key we give and return proper values.

The advantage of that solution would be, that dictionaries would be cached without LocalStorage from HTML5, using browser cache mechanism only.

I’ve done test with address database, writing function, which fragment is here:

window.dict = {};

dict.getStreets = function (sym) {
if (sym == '46') {
    return [["Andrzeja","10028"],["B\u0142o\u0144ska","34182"],["Cisowa","10027"],["Dojazdowa","177799"],["Dolna","126726"],["Dzia\u0142kowa","153180"],["Dzikiej R\u00f3\u017cy","211051"],["Fio\u0142kowa","98636"],["Gimnazjalna","126727"],["Gwia\u017adzista","126728"],["Jana","34189"],["Jod\u0142owa","34183"],["Majowa","34184"],["Mi\u0142a","98637"],["Orzechowa","34185"],["Osiedlowa","153181"],["Polowa","34186"],["Po\u0142udniowa","98638"],["Prosta","211052"],["Purzyckiego","126729"],["R\u00f3\u017cana","211053"],["S\u0142owicza","224648"],["Spokojna","34187"],["Stra\u017cacka","98639"],["Szarotki","34188"],["\u015awierkowa","224596"],["Weso\u0142a","153182"],["Wschodnia","126730"],["Zachodnia","34190"]];
} else if (sym == '98') {
    return [["Bia\u0142ych Brz\u00f3z","177802"],["Calineczki","34192"],["Chabrowa","98640"],["Czarodziejska","98641"],["D\u0142uga","10029"],["Dworcowa","34191"],["Familijna","68666"],["Kasztanowa","153183"],["Konwaliowa","217850"],["Ko\u015bcielna","10030"],["Kr\u0119ta","34193"],["Le\u015bna","177803"],["Lipowa","153184"],["\u0141\u00f3dzka","217851"],["Malownicza","177804"],["Masztowa","217852"],["Milenijna","10031"],["P\u00f3\u0142nocna","10032"],["Przesmyk","10033"],["Romantyczna","34720"],["Skrajna","98642"],["Sosnowa","98643"],["Stokrotki","126731"],["T\u0119czowa","10034"],["Uko\u015bna","68667"],["Urocza","34721"],["Ustronna","98644"],["Zaciszna","34722"],["Zau\u0142ek","217853"]];
} else if (sym == '224') {
    return [["Maj\u0105tkowa","217854"],["Orionist\u00f3w","153185"],["Wiosenna","98645"]];
} else if (sym == '394') {
    return [["Kwiatowa","177805"],["Sochaczewska","217855"]];
} else if (sym == '460') {
    return [["Grodziska","34723"],["\u0141\u0105ki","98647"],["Nowakowskiego","217856"],["\u017buk\u00f3wka","95137"]];
// ...... about 5MB of data goes here
} else return null;
};

The whole JavaScipt has over 5MB length. This works under FireFox (very slow, as I’ve supposed), IE 9 and Chrome (quite fast), but under Opera it is not working. When I’ve limited function’s size, it works, but with full size there’s not even function getStreets set on dict object.

So I see for sure that Opera does not allow to create such big functions, as only from ‘big’ browsers. My question is, if it is somewhere documented what the limits are, or it is just some buffer overflow (or anything similar) in Opera’s javascript engine?

update
The case with dictionaries was only an inspiration that made this code to be generated. The question is about limits to the Opera javascript parser, not the other way the code above could be written

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:39:10+00:00Added an answer on May 27, 2026 at 5:39 am

    This is a known limitation which will soon be history: it’s got nothing to do with the size of the function, but there is a limit to the number of chained if..else if.. statements you can have. In this test and on my computer the limit is 1020 chained statements: http://jsfiddle.net/8RAn8/ but I’m not sure if this is really a static hard-coded limit or depending on some parameters. If you remove the else from the ..else if.. chaining it runs just fine: http://jsfiddle.net/8RAn8/1/ and I’ve tested more than 15000 if blocks successfully without else.

    We’re about to fix this bug and change the limit to something closer to what other browsers have.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there some kind of Session size limitation or advisable value to not to
Is there some means of querying the system tables to establish which tables are
Is there some way I can use URLs like: http://www.blog.com/team-spirit/ instead of http://www.blog.com/?p=122 in
Is there some built-in way to share files between Xen guests? I don't currently
Is there some way to block access from a referrer using a .htaccess file
Is there some way to hide the browser toolbar / statusbar etc in current
Is there some rare language construct I haven't encountered (like the few I've learned
Are there some principles of organizing classes into namespaces? For example is it OK
Is there some reasonably cross platform way to create a thumbnail image given a
Is there some way to cache a generated report in the reporting services, so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.