[Webkit-unassigned] [Bug 92817] New: use strict, string property assignment throws TypeError

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 31 18:05:54 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=92817

           Summary: use strict, string property assignment throws
                    TypeError
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
               URL: http://jsbin.com/araqog/4/edit
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jrburke at gmail.com


In strict mode, assigning to a property on a string throws a TypeError in Safari 6 and in Nightly WebKit, Version 6.0 (8536.25, 537+).

This does not occur in other strict-aware browsers, tested with Firefox 15 and Chrome 20. They allow the assignment but then later reads of the property return undefined.

It may be that I misunderstood the strict mode rules, but in that case I am surprised the browsers do not agree in this case.

In case the URL to the JSBin goes away, the script code is the following:

    function stricty() {
      //comment out use strict and no error thrown.
      //No error thrown in other strict-aware browsers.
      'use strict';
      var value = 'foo',
          err, result;

      try {
        //THIS IS WHERE IT FAILS IN Safari 6/Nightly WebKit
        value.something = true;
      } catch (e) {
        err = e;
      }

      if (err) {
        result = 'ERROR: ' + err;
      } else {
        result = 'value.something is: ' + value.something;
      }

      document.getElementById('out').innerHTML = result;
    }

    stricty();

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list