Ignore:
Timestamp:
Mar 7, 2011, 1:56:14 PM (14 years ago)
Author:
[email protected]
Message:

Source/JavaScriptCore: Add SHA-1 for new WebSocket protocol
https://bugs.webkit.org/show_bug.cgi?id=55039

Patch by Yuta Kitamura <[email protected]> on 2011-03-06
Reviewed by Kent Tamura.

The code is based on Chromium's portable SHA-1 implementation
(src/base/sha1_portable.cc). Modifications were made in order
to make the code comply with WebKit coding style.

(WTF::MD5::MD5):

  • wtf/SHA1.cpp: Added.

(WTF::testSHA1): This function will be run the first time SHA1
constructor is called. This function computes a few hash values
and checks the results in debug builds. However, constructor is
probably not a good place to run these tests, so we need to find
a good place for it (bug 55853).
(WTF::expectSHA1):
(WTF::f):
(WTF::k):
(WTF::rotateLeft):
(WTF::SHA1::SHA1):
(WTF::SHA1::addBytes):
(WTF::SHA1::computeHash):
(WTF::SHA1::finalize):
(WTF::SHA1::processBlock):
(WTF::SHA1::reset):

  • wtf/SHA1.h: Added.

(WTF::SHA1::addBytes):

  • wtf/wtf.pri:

LayoutTests: Bug 55815 - Should throw an exception from JSObject::defineOwnProperty if !isExtensible().

Reviewed by Cameron Zwarich.

  • ietestcenter/Javascript/15.2.3.6-4-1-expected.txt:

Now with added passingness!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r80378 r80495  
    663663    if (!getOwnPropertyDescriptor(exec, propertyName, current)) {
    664664        // unless extensions are prevented!
    665         if (!isExtensible())
     665        if (!isExtensible()) {
     666            if (throwException)
     667                throwError(exec, createTypeError(exec, "Attempting to define property on object that is not extensible."));
    666668            return false;
     669        }
    667670        PropertyDescriptor oldDescriptor;
    668671        oldDescriptor.setValue(jsUndefined());
Note: See TracChangeset for help on using the changeset viewer.