Changeset 238016 in webkit


Ignore:
Timestamp:
Nov 8, 2018 9:30:48 PM (5 years ago)
Author:
Ross Kirsling
Message:

[JSC] isStrWhiteSpace seems redundant with Lexer<UChar>::isWhiteSpace
https://bugs.webkit.org/show_bug.cgi?id=191439

Reviewed by Saam Barati.

  • CMakeLists.txt:
  • runtime/ParseInt.h:

(JSC::isStrWhiteSpace):
Define isStrWhiteSpace in terms of isWhiteSpace and isLineTerminator.

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r237547 r238016  
    693693    llint/LLIntOpcode.h
    694694
     695    parser/Lexer.h
     696    parser/ParserArena.h
    695697    parser/ParserError.h
    696698    parser/ParserModes.h
  • trunk/Source/JavaScriptCore/ChangeLog

    r238012 r238016  
     12018-11-08  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        [JSC] isStrWhiteSpace seems redundant with Lexer<UChar>::isWhiteSpace
     4        https://bugs.webkit.org/show_bug.cgi?id=191439
     5
     6        Reviewed by Saam Barati.
     7
     8        * CMakeLists.txt:
     9        * runtime/ParseInt.h:
     10        (JSC::isStrWhiteSpace):
     11        Define isStrWhiteSpace in terms of isWhiteSpace and isLineTerminator.
     12
    1132018-11-08  Michael Saboff  <msaboff@apple.com>
    214
  • trunk/Source/JavaScriptCore/runtime/ParseInt.h

    r238004 r238016  
    2727
    2828#include "JSCJSValue.h"
     29#include "Lexer.h"
    2930#include <wtf/dtoa.h>
    3031
     
    102103ALWAYS_INLINE static bool isStrWhiteSpace(UChar c)
    103104{
    104     switch (c) {
    105     // ECMA-262-5th 7.2 & 7.3
    106     case 0x0009:
    107     case 0x000A:
    108     case 0x000B:
    109     case 0x000C:
    110     case 0x000D:
    111     case 0x0020:
    112     case 0x00A0:
    113     case 0x2028:
    114     case 0x2029:
    115     case 0xFEFF:
    116         return true;
    117     default:
    118         return c > 0xFF && u_charType(c) == U_SPACE_SEPARATOR;
    119     }
     105    // https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type
     106    return Lexer<UChar>::isWhiteSpace(c) || Lexer<UChar>::isLineTerminator(c);
    120107}
    121108
Note: See TracChangeset for help on using the changeset viewer.