Bug 1283712 - Part 10: Support notes in getLastWarning shell-only testing function. r=jwalden
authorTooru Fujisawa <arai_a@mac.com>
Wed, 15 Feb 2017 23:53:07 +0900
changeset 343094 231c25dff4ce02cca0ada64fa31be62a30e864fe
parent 343093 1135a29fbc37a90cea364599c973e0918206a3e5
child 343095 4ce13b03d9562b51debd438eeb46c33dd3b4c448
push id31369
push userkwierso@gmail.com
push dateThu, 16 Feb 2017 00:18:40 +0000
treeherdermozilla-central@e9b926463f9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1283712
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1283712 - Part 10: Support notes in getLastWarning shell-only testing function. r=jwalden
js/src/shell/js.cpp
js/src/vm/CommonPropertyNames.h
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -6585,16 +6585,24 @@ CreateLastWarningObject(JSContext* cx, J
     RootedValue linenoVal(cx, Int32Value(report->lineno));
     if (!DefineProperty(cx, warningObj, cx->names().lineNumber, linenoVal))
         return false;
 
     RootedValue columnVal(cx, Int32Value(report->column));
     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;
 }
 
 static FILE*
 ErrorFilePointer()
 {
     if (gErrFile->isOpen())
--- a/js/src/vm/CommonPropertyNames.h
+++ b/js/src/vm/CommonPropertyNames.h
@@ -236,16 +236,17 @@
     macro(next, next, "next") \
     macro(NFC, NFC, "NFC") \
     macro(NFD, NFD, "NFD") \
     macro(NFKC, NFKC, "NFKC") \
     macro(NFKD, NFKD, "NFKD") \
     macro(noFilename, noFilename, "noFilename") \
     macro(nonincrementalReason, nonincrementalReason, "nonincrementalReason") \
     macro(noStack, noStack, "noStack") \
+    macro(notes, notes, "notes") \
     macro(NumberFormat, NumberFormat, "NumberFormat") \
     macro(NumberFormatFormatToParts, NumberFormatFormatToParts, "Intl_NumberFormat_formatToParts") \
     macro(numeric, numeric, "numeric") \
     macro(objectArguments, objectArguments, "[object Arguments]") \
     macro(objectArray, objectArray, "[object Array]") \
     macro(objectBoolean, objectBoolean, "[object Boolean]") \
     macro(objectDate, objectDate, "[object Date]") \
     macro(objectError, objectError, "[object Error]") \