From 8e932efef46c70fd0c165ee432893f9898267f08 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sun, 16 Jun 2019 11:32:41 -0400 Subject: 1283712 - Part 10: Support notes in getLastWarning shell-only testing function. --- js/src/shell/js.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js/src/shell') diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 19bb6b84a..1e2435955 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -6419,6 +6419,14 @@ CreateLastWarningObject(JSContext* cx, JSErrorReport* report) if (!DefineProperty(cx, warningObj, cx->names().columnNumber, columnVal)) return false; + RootedObject notesArray(cx, CreateErrorNotesArray(cx, report)); + if (!notesArray) + return false; + + RootedValue notesArrayVal(cx, ObjectValue(*notesArray)); + if (!DefineProperty(cx, warningObj, cx->names().notes, notesArrayVal)) + return false; + GetShellContext(cx)->lastWarning.setObject(*warningObj); return true; } -- cgit v1.2.3