Changeset 218223 in webkit


Ignore:
Timestamp:
Jun 13, 2017 4:57:55 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Debugger has unexpected effect on program correctness
https://bugs.webkit.org/show_bug.cgi?id=172683

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2017-06-13
Reviewed by Saam Barati.

Source/JavaScriptCore:

  • inspector/InjectedScriptSource.js:

(InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
(InjectedScript.RemoteObject.prototype._isPreviewableObjectInternal):
(BasicCommandLineAPI):
Eliminate for..of use with Arrays from InjectedScriptSource as it can be observable.
We still use it for Set / Map iteration which we can eliminate when moving to builtins.

LayoutTests:

  • inspector/injected-script/observable-expected.txt: Added.
  • inspector/injected-script/observable.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r218222 r218223  
     12017-06-13  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Debugger has unexpected effect on program correctness
     4        https://bugs.webkit.org/show_bug.cgi?id=172683
     5
     6        Reviewed by Saam Barati.
     7
     8        * inspector/injected-script/observable-expected.txt: Added.
     9        * inspector/injected-script/observable.html: Added.
     10
    1112017-06-13  Matt Lewis  <jlewis3@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r218220 r218223  
     12017-06-13  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Debugger has unexpected effect on program correctness
     4        https://bugs.webkit.org/show_bug.cgi?id=172683
     5
     6        Reviewed by Saam Barati.
     7
     8        * inspector/InjectedScriptSource.js:
     9        (InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
     10        (InjectedScript.RemoteObject.prototype._isPreviewableObjectInternal):
     11        (BasicCommandLineAPI):
     12        Eliminate for..of use with Arrays from InjectedScriptSource as it can be observable.
     13        We still use it for Set / Map iteration which we can eliminate when moving to builtins.
     14
    1152017-06-13  JF Bastien  <jfbastien@apple.com>
    216
  • trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js

    r215916 r218223  
    10671067    _appendPropertyPreviews: function(object, preview, descriptors, internal, propertiesThreshold, firstLevelKeys, secondLevelKeys)
    10681068    {
    1069         for (var descriptor of descriptors) {
     1069        for (let i = 0; i < descriptors.length; ++i) {
     1070            let descriptor = descriptors[i];
     1071
    10701072            // Seen enough.
    10711073            if (propertiesThreshold.indexes < 0 || propertiesThreshold.properties < 0)
     
    12351237    _isPreviewableObject: function(value, object)
    12361238    {
    1237         return this._isPreviewableObjectInternal(value, new Set([object]), 1);
     1239        let set = new Set;
     1240        set.add(object);
     1241
     1242        return this._isPreviewableObjectInternal(value, set, 1);
    12381243    },
    12391244
     
    12771282
    12781283        // Objects are simple if they have 3 or less simple properties.
    1279         var ownPropertyNames = Object.getOwnPropertyNames(object);
     1284        let ownPropertyNames = Object.getOwnPropertyNames(object);
    12801285        if (ownPropertyNames.length > 3)
    12811286            return false;
    1282         for (var propertyName of ownPropertyNames) {
     1287        for (let i = 0; i < ownPropertyNames.length; ++i) {
     1288            let propertyName = ownPropertyNames[i];
    12831289            if (!this._isPreviewableObjectInternal(object[propertyName], knownObjects, depth))
    12841290                return false;
     
    13731379
    13741380    // Command Line API methods.
    1375     for (let method of BasicCommandLineAPI.methods)
     1381    for (let i = 0; i < BasicCommandLineAPI.methods.length; ++i) {
     1382        let method = BasicCommandLineAPI.methods[i];
    13761383        this[method.name] = method;
     1384    }
    13771385}
    13781386
     
    13931401];
    13941402
    1395 for (let method of BasicCommandLineAPI.methods)
     1403for (let i = 0; i < BasicCommandLineAPI.methods.length; ++i) {
     1404    let method = BasicCommandLineAPI.methods[i];
    13961405    method.toString = function() { return "function " + method.name + "() { [Command Line API] }"; };
     1406}
    13971407
    13981408return injectedScript;
Note: See TracChangeset for help on using the changeset viewer.