I could put in explicit calls which provide evalCarefully around those tests?


On 11/8/06, P T Withington <[EMAIL PROTECTED] > wrote:
Ok, that's the catch that I turned off because it was too expensive
(basically turns every `.` into a funcall).

Off the top of my head, I can't think how to catch this without a
huge overhead (wish we had condition-bind!).  Perhaps the best thing
to do for now is remove that test.

Unless someone else has a clever idea?

On 2006-11-08, at 11:13 EST, Henry Minsky wrote:

> it's complaining that undefined has no properties
>
> On 11/8/06, P T Withington < [EMAIL PROTECTED]> wrote:
>>
>> Yes, there is.  I think I had code in the compiler to deal with this,
>> but I disabled it because it made the overhead in debug builds too
>> onerous.  Is the browser halting because of the reference to
>> undefined (which I thought should be protected already) or because we
>> are trying to de-reference undefined (which is the check that I have
>> turned off)?
>>
>> On 2006-11-07, at 23:52 EST, Henry Minsky wrote:
>>
>> > The code in the Debug portion of the test below causes a fatal
>> > error in
>> > DHTML
>> >
>> >    undefined.flooglesnort;
>> >
>> > Is there some way we can use evalCarefully in this portion to tally
>> > the
>> > error but not halt
>> > the DHTML _javascript_ interpereter?
>> >
>> >
>> >
>> >    <method name="testUndefinedErrors">
>> >    <![CDATA[
>> >      expectedError = function(m) {
>> >          return m.indexOf(arguments.callee.expectedMatch ) != -1;
>> >      }
>> >      expectedError.toString = function () {
>> >          return '/.*' + this.expectedMatch + '.*/';
>> >      }
>> >
>> >       expectedError.expectedMatch = "testing";
>> >      error("testing: 1, 2, 3");
>> >      assertEquals(1, expectedErrors, "Total number of expected
>> > errors");
>> >
>> >      expectedError.expectedMatch = "This is a";
>> >      $reportSourceWarning(0, 0, "This is a test");
>> >      assertEquals(2, expectedErrors, "Total number of expected
>> > errors");
>> >
>> >      // These tests only work if debugging is enabled
>> >      if (Debug) {
>> >        expectedError.expectedMatch = "flooglesnort";
>> >        // TODO: [2002-11-16 ptw] below currently signals two errors
>> >    ===>    undefined.flooglesnort;
>> >        assertEquals(4, expectedErrors, "Total number of expected
>> > errors");
>> >
>> >        nonFunction.flooglesnort;
>> >        assertEquals(5, expectedErrors, "Total number of expected
>> > errors");
>> >
>> >        expectedError.expectedMatch = "call to undefined function";
>> >        flooglesnort();
>> >        assertEquals(6, expectedErrors, "Total number of expected
>> > errors");
>> >
>> >        expectedError.expectedMatch = "call to non-function";
>> >        nonFunction();
>> >        assertEquals(7, expectedErrors, "Total number of expected
>> > errors");
>> >
>> >        expectedError.expectedMatch = "call to undefined method";
>> >        nonFunction.flooglesnort();
>> >        assertEquals(8, expectedErrors, "Total number of expected
>> > errors");
>> >
>> >        expectedError.expectedMatch = "call to non-method";
>> >        nonFunction.nonMethod();
>> >        assertEquals(9, expectedErrors, "Total number of expected
>> > errors");
>> >
>> >        expectedError.expectedMatch = "undefined variable";
>> >        this.devnull = flooglesnort;
>> >        assertEquals(10, expectedErrors, "Total number of expected
>> > errors");
>> >
>> >        expectedError.expectedMatch = "undefined object";
>> >        undefined['flooglesnort'];
>> >        assertEquals(11, expectedErrors, "Total number of expected
>> > errors");
>> >
>> >        expectedError.expectedMatch = "undefined property";
>> >        nonFunction[undefined] = 'this is an error';
>> >        assertEquals(12, expectedErrors, "Total number of expected
>> > errors");
>> >      }
>> >      ]]>
>> >    </method>
>> >
>> > --
>> > Henry Minsky
>> > Software Architect
>> > [EMAIL PROTECTED]
>>
>>
>
>
> --
> Henry Minsky
> Software Architect
> [EMAIL PROTECTED]




--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to