jQuery Promise Callback
<p>After having to change a far bit of my callback syntax in order to accommodate firefox limitations I am running into some weird issues.</p>

<p>Markup + Executing Code</p>

<pre><code>function List_Add() {
  SP.SOD.executeFunc('SP.js', 'SP.ClientContext', function() {
    var listTitle = 'Quote';
    var propertiesToAdd = [];
    propertiesToAdd.push({
      ID: "Q_ID",
      newval: 1,
    });
    addListItems(listTitle, propertiesToAdd)
      .done(function(items) {
        //Do Heaps of Stuff
      })
      .fail(function(error) {
        console.log(error.get_message());
      });

  });
}
</code></pre>

<p>And the function that is being called to execute this</p>

<pre><code>function addListItems(listTitle, propertiesToAdd) {
  var ctx = SP.ClientContext.get_current();
  var web = ctx.get_web();
  var list = web.get_lists().getByTitle(listTitle);
  var listItemCreationInfo = new SP.ListItemCreationInformation();
  var newItem = list.addItem(listItemCreationInfo);
  propertiesToAdd.forEach(function(entry) {
    newItem.set_item(entry.ID, entry.newval);
  });
  newItem.update();
  var d = $.Deferred();
  ctx.executeQueryAsync(function() {
      d.resolve(true);
      return d.promise();
    },
    function(sender, args) {
      d.reject(args);
      return d.promise();
    });
}
</code></pre>

<p>The return d.promise while normally outside the functions was causing timing issues with async execution. </p>

<p>The error I am receiving after running this code is thrown the the mark up + execution</p>

<p>Uncaught TypeError: Cannot read property 'done' of undefined</p>

<p>The values are adding to the lists correctly, so the bulk is working, the .done is not being returned though hence not allowing the execution of the follow up code.</p>