Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

(iOS 8 GM iPhone5C) TypeError: Attempted to assign to readonly property #9128

@HAKASHUN

Description

@HAKASHUN

I am using on iOS 8 GM(iPhone5C).
With this device, I am getting this error in this line(https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js#L216)
But on iOS 8 GM(iPhone5S) and iOS 7.x (iPhone5C, iPhone5S), this error does not occur.

To resolve this error, I rewrote the code as follows:

$new: function(isolate) {
        var child;

        if (isolate) {
          child = new Scope();
          child.$root = this.$root;
          // ensure that there is just one async queue per $rootScope and its children
          child.$$asyncQueue = this.$$asyncQueue;
          child.$$postDigestQueue = this.$$postDigestQueue;
        } else {
          // Only create a child scope class if somebody asks for one,
          // but cache it to allow the VM to optimize lookups.
          if (!this.$$ChildScope) {
            this.$$ChildScope = function ChildScope() {
              this['$$watchers'] = this['$$nextSibling'] =
                  this['$$childHead'] = this['$$childTail'] = null;
              this['$$listeners'] = {};
              this['$$listenerCount'] = {};
              this['$id'] = nextUid();
              this['$$ChildScope'] = null;
            };
            this.$$ChildScope.prototype = this;
          }
          child = new this.$$ChildScope();
        }
        child['this'] = child;
        child['$parent'] = this;
        child['$$prevSibling'] = this.$$childTail;
        if (this.$$childHead) {
          this.$$childTail.$$nextSibling = child;
          this.$$childTail = child;
        } else {
          this.$$childHead = this.$$childTail = child;
        }
        return child;
      },

The situation has improved, but I do not understand the reason...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions