#14930 closed defect (fixed)
JsonRest tries to assign properties to a frozen object
Reported by: | ben hockey | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | Data | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
in query
, JsonRest
tries to assign results.total
to a promise. in browsers that support Object.freeze
this will fail (silently). QueryResults
uses delegate to allow assigning properties to a frozen promise, maybe JsonRest
could do the same.
Change History (5)
comment:1 Changed 9 years ago by
Priority: | undecided → high |
---|
comment:2 Changed 9 years ago by
comment:3 Changed 9 years ago by
a possible patch:
-
store/JsonRest.js
1 define(["../_base/xhr", "../json", "../_base/declare", "./util/QueryResults" 2 ], function(xhr, JSON, declare, QueryResults ) {1 define(["../_base/xhr", "../json", "../_base/declare", "./util/QueryResults", "dojo/_base/lang" 2 ], function(xhr, JSON, declare, QueryResults, lang) { 3 3 // module: 4 4 // dojo/store/JsonRest 5 5 // summary: … … 141 141 query += ")"; 142 142 } 143 143 } 144 var results = xhr("GET", {144 var results = lang.delegate(xhr("GET", { 145 145 url: this.target + (query || ""), 146 146 handleAs: "json", 147 147 headers: headers 148 }) ;148 })); 149 149 results.total = results.then(function(){ 150 150 var range = results.ioArgs.xhr.getResponseHeader("Content-Range"); 151 151 return range && (range=range.match(/\/(.*)/)) && +range[1];
comment:4 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
The return value of xhr(), in the latest trunk is a deferred and not a direct frozen promise, so this is no longer an issue.
comment:5 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|
Note: See
TracTickets for help on using
tickets.
#14928 is a duplicate of this ticket.