property-on-console-proto.js 759 Bytes
Newer Older
1 2 3 4
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
let {session, contextGroup, Protocol} = InspectorTest.start("Tests that property defined on console.__proto__ doesn't observable on other Objects.");
6

7
contextGroup.addScript(`
8 9 10 11 12 13 14 15 16 17 18
function testFunction()
{
    var amountOfProperties = 0;
    for (var p in {})
        ++amountOfProperties;
    console.__proto__.debug = 239;
    for (var p in {})
        --amountOfProperties;
    return amountOfProperties;
}`);

19
Protocol.Runtime.evaluate({ "expression": "testFunction()" }).then(dumpResult);
20 21 22

function dumpResult(result)
{
23
  InspectorTest.logMessage(result);
24 25
  InspectorTest.completeTest();
}