Ignore:
Timestamp:
Dec 19, 2018, 8:41:11 PM (6 years ago)
Author:
Chris Dumez
Message:

wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
https://bugs.webkit.org/show_bug.cgi?id=192728
<rdar://problem/46746779>

Reviewed by Geoff Garen.

Source/JavaScriptCore:

  • API/*:
  • Scripts/*:
  • assembler/*:
  • b3/*:
  • bytecode/*:
  • bytecompiler/*:
  • debugger/*:
  • dfg/*:
  • ftl/*:
  • heap/*:
  • inspector/*:
  • jit/*:
  • llint/*:
  • parser/*:
  • runtime/*:
  • tools/*:
  • wasm/*:
  • yarr/*:

Source/WebCore:

  • Modules/*:
  • animation/*:
  • bindings/*:
  • crypto/*:
  • css/*:
  • dom/*:
  • editing/*:
  • fileapi/*:
  • html/*:
  • inspector/*:
  • layout/*:
  • loader/*:
  • mathml/*:
  • page/*:
  • platform/*:
  • plugins/*:
  • rendering/*:
  • testing/*:
  • workers/*:
  • xml/*:

Source/WebCore/PAL:

  • pal/*:

Source/WebDriver:

  • :

Source/WebKit:

  • NetworkProcess/*:
  • Platform/*:
  • Scripts/*:
  • Shared/*:
  • UIProcess/*:
  • WebProcess/*:

Source/WebKitLegacy/mac:

  • DOM/*:
  • Plugins/*:
  • WebCoreSupport/*:
  • WebView/*:

Source/WebKitLegacy/win:

  • Plugins/*:
  • WebCoreSupport/*:

Source/WTF:

Update optional's move-constructor and move-assignment operator to disengage the value being moved from.
Rename to optional to Optional, make_optional() to makeOptional(), and move class from std to WTF namespace.

Based on patch by David Kilzer.

  • wtf/*:

Tools:

  • DumpRenderTree/*:
  • MiniBrowser/*:
  • TestRunnerShared/*:
  • TestWebKitAPI/*:
  • WebGPUAPIStructure/*:
  • WebKitTestRunner/*:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Lexer.cpp

    r234501 r239427  
    15401540
    15411541template <typename T>
    1542 ALWAYS_INLINE auto Lexer<T>::parseBinary() -> std::optional<NumberParseResult>
     1542ALWAYS_INLINE auto Lexer<T>::parseBinary() -> Optional<NumberParseResult>
    15431543{
    15441544    // Optimization: most binary values fit into 4 bytes.
     
    15721572
    15731573    if (isASCIIDigit(m_current))
    1574         return std::nullopt;
     1574        return WTF::nullopt;
    15751575
    15761576    return Variant<double, const Identifier*> { parseIntOverflow(m_buffer8.data(), m_buffer8.size(), 2) };
     
    15781578
    15791579template <typename T>
    1580 ALWAYS_INLINE auto Lexer<T>::parseOctal() -> std::optional<NumberParseResult>
     1580ALWAYS_INLINE auto Lexer<T>::parseOctal() -> Optional<NumberParseResult>
    15811581{
    15821582    // Optimization: most octal values fit into 4 bytes.
     
    16111611
    16121612    if (isASCIIDigit(m_current))
    1613         return std::nullopt;
     1613        return WTF::nullopt;
    16141614
    16151615    return Variant<double, const Identifier*> { parseIntOverflow(m_buffer8.data(), m_buffer8.size(), 8) };
     
    16171617
    16181618template <typename T>
    1619 ALWAYS_INLINE auto Lexer<T>::parseDecimal() -> std::optional<NumberParseResult>
     1619ALWAYS_INLINE auto Lexer<T>::parseDecimal() -> Optional<NumberParseResult>
    16201620{
    16211621    // Optimization: most decimal values fit into 4 bytes.
     
    16531653        return Variant<double, const Identifier*> { makeIdentifier(m_buffer8.data(), m_buffer8.size()) };
    16541654
    1655     return std::nullopt;
     1655    return WTF::nullopt;
    16561656}
    16571657
Note: See TracChangeset for help on using the changeset viewer.