tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

emulates-undefined.js (923B)


      1 // Copyright (C) 2020 Alexey Shvayka. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-conditional-operator-runtime-semantics-evaluation
      5 description: >
      6  ToBoolean returns `false` for [[IsHTMLDDA]] object; trueRef is not evaluated.
      7 info: |
      8  ConditionalExpression : ShortCircuitExpression ? AssignmentExpression : AssignmentExpression
      9 
     10  1. Let lref be the result of evaluating ShortCircuitExpression.
     11  2. Let lval be ! ToBoolean(? GetValue(lref)).
     12  3. If lval is true, then
     13    [...]
     14  4. Else,
     15    a. Let falseRef be the result of evaluating the second AssignmentExpression.
     16    b. Return ? GetValue(falseRef).
     17 
     18  The [[IsHTMLDDA]] Internal Slot / Changes to ToBoolean
     19 
     20  1. If argument has an [[IsHTMLDDA]] internal slot, return false.
     21  2. Return true.
     22 features: [IsHTMLDDA]
     23 ---*/
     24 
     25 assert.sameValue($262.IsHTMLDDA ? unresolved : 2, 2);
     26 
     27 reportCompare(0, 0);