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 8670305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:40:51+00:00 2026-06-12T18:40:51+00:00

Some forms of indirect eval fail in Opera, and, I’m told, in Safari. [eval][0](”)

  • 0

Some forms of indirect eval fail in Opera, and, I’m told, in Safari.

[eval][0]('')

Unhandled Error: eval called with invalid this object

Notice that it fails when evaluating an empty string… as far as I can tell it should return undefined.

Other forms, like (0,eval)(''), seem to work fine.

Running the examples from this test suite by kangax, I see several forms that fail with the “invalid this object” message in Opera, but not Chrome or Firefox.

Can anyone explain why this happens? What dictates this behavior? It seems intentional, does it adhere to some part of the standard I don’t know about?

Related — SO discussion about indirect vs. direct eval.

Also — Why is (0 || eval) not treated as indirect in Opera?

  • 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-06-12T18:40:52+00:00Added an answer on June 12, 2026 at 6:40 pm

    This is simply because ECMAScript 262 3rd edition specified a somewhat odd optional exception for unusual eval() calls. See the last part of this section of the specification:
    http://bclary.com/2004/11/07/#a-15.1.2.1

    If value of the eval property is used in any way other than a direct call (that is, other than by the explicit use of its name as an Identifier which is the MemberExpression in a CallExpression), or if the eval property is assigned to, an EvalError exception may be thrown.

    I’m not entirely sure what the reasoning behind this sentence is, but as you see both Opera’s Carakan engine and Safari’s ES engine have chosen to implement an exception if a reference to eval is defined on some object and called from there.

    Later editions of the ECMAScript standard have removed this (having an optional exception in a spec is a very bad idea in the first place) and Opera will be adapting in some future Carakan-version. It’s already been fixed internally due to these questions on StackOverflow 😉

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

Sidebar

Related Questions

I have this website http://wedessertmore.com that has some forms popup when you click on
In strict mode, indirect calls to eval should have this bound to the global
I'm using jNice to enhance some forms on my site. jNice is called by
Im working on some forms in this website and it renders perfectly fine but
So lets say I have some forms like this: Form A: <form name=formA> <input
I have some forms, which are in some DIVs. DIVs are hidden, and are
Suppose an application with some forms and only one data module are created at
I am using colorbox.js to display some forms in a lightbox. There are multiple
I have public site with some forms. Simple question: What kind of informations should
I've a php page with some forms used to upload images. Each form upload

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.