Attachment #9032169: bug1342012-13-fix-error-message for bug #1342012

View | Details | Raw Unified | Return to bug 1342012
Collapse All | Expand All

(-)a/dom/script/ScriptLoader.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 923-939   void ScriptLoader::FinishDynamicImport(J Link Here 
923
       unsigned(aResult), JS_IsExceptionPending(aCx)));
923
       unsigned(aResult), JS_IsExceptionPending(aCx)));
924
924
925
  // Complete the dynamic import, report failures indicated by aResult or as a
925
  // Complete the dynamic import, report failures indicated by aResult or as a
926
  // pending exception on the context.
926
  // pending exception on the context.
927
927
928
  if (NS_FAILED(aResult)) {
928
  if (NS_FAILED(aResult)) {
929
    MOZ_ASSERT(!JS_IsExceptionPending(aCx));
929
    MOZ_ASSERT(!JS_IsExceptionPending(aCx));
930
    JS_ReportErrorNumberUC(aCx, js::GetErrorMessage, nullptr,
930
    JS_ReportErrorNumberUC(aCx, js::GetErrorMessage, nullptr,
931
                           JSMSG_IMPORT_SCRIPT_NOT_FOUND);
931
                           JSMSG_DYNAMIC_IMPORT_FAILED);
932
  }
932
  }
933
933
934
  JS::Rooted<JS::Value> referencingScript(aCx,
934
  JS::Rooted<JS::Value> referencingScript(aCx,
935
                                          aRequest->mDynamicReferencingPrivate);
935
                                          aRequest->mDynamicReferencingPrivate);
936
  JS::Rooted<JSString*> specifier(aCx, aRequest->mDynamicSpecifier);
936
  JS::Rooted<JSString*> specifier(aCx, aRequest->mDynamicSpecifier);
937
  JS::Rooted<JSObject*> promise(aCx, aRequest->mDynamicPromise);
937
  JS::Rooted<JSObject*> promise(aCx, aRequest->mDynamicPromise);
938
938
939
  JS::FinishDynamicModuleImport(aCx, referencingScript, specifier, promise);
939
  JS::FinishDynamicModuleImport(aCx, referencingScript, specifier, promise);
(-)a/js/src/js.msg (-1 / +1 lines)
Line     Link Here 
 Lines 613-629   MSG_DEF(JSMSG_BAD_DEFAULT_EXPORT, Link Here 
613
MSG_DEF(JSMSG_MISSING_INDIRECT_EXPORT,   0, JSEXN_SYNTAXERR, "indirect export not found")
613
MSG_DEF(JSMSG_MISSING_INDIRECT_EXPORT,   0, JSEXN_SYNTAXERR, "indirect export not found")
614
MSG_DEF(JSMSG_AMBIGUOUS_INDIRECT_EXPORT, 0, JSEXN_SYNTAXERR, "ambiguous indirect export")
614
MSG_DEF(JSMSG_AMBIGUOUS_INDIRECT_EXPORT, 0, JSEXN_SYNTAXERR, "ambiguous indirect export")
615
MSG_DEF(JSMSG_MISSING_IMPORT,            0, JSEXN_SYNTAXERR, "import not found")
615
MSG_DEF(JSMSG_MISSING_IMPORT,            0, JSEXN_SYNTAXERR, "import not found")
616
MSG_DEF(JSMSG_AMBIGUOUS_IMPORT,          0, JSEXN_SYNTAXERR, "ambiguous import")
616
MSG_DEF(JSMSG_AMBIGUOUS_IMPORT,          0, JSEXN_SYNTAXERR, "ambiguous import")
617
MSG_DEF(JSMSG_MISSING_NAMESPACE_EXPORT,  0, JSEXN_SYNTAXERR, "export not found for namespace")
617
MSG_DEF(JSMSG_MISSING_NAMESPACE_EXPORT,  0, JSEXN_SYNTAXERR, "export not found for namespace")
618
MSG_DEF(JSMSG_MISSING_EXPORT,            1, JSEXN_SYNTAXERR, "local binding for export '{0}' not found")
618
MSG_DEF(JSMSG_MISSING_EXPORT,            1, JSEXN_SYNTAXERR, "local binding for export '{0}' not found")
619
MSG_DEF(JSMSG_BAD_MODULE_STATUS,         0, JSEXN_INTERNALERR, "module record has unexpected status")
619
MSG_DEF(JSMSG_BAD_MODULE_STATUS,         0, JSEXN_INTERNALERR, "module record has unexpected status")
620
MSG_DEF(JSMSG_NO_DYNAMIC_IMPORT,         0, JSEXN_SYNTAXERR, "dynamic module import is not implemented")
620
MSG_DEF(JSMSG_NO_DYNAMIC_IMPORT,         0, JSEXN_SYNTAXERR, "dynamic module import is not implemented")
621
MSG_DEF(JSMSG_IMPORT_SCRIPT_NOT_FOUND,   0, JSEXN_TYPEERR, "can't find referencing script for dynamic module import")
621
MSG_DEF(JSMSG_DYNAMIC_IMPORT_FAILED,     0, JSEXN_TYPEERR, "error loading dynamically imported module")
622
MSG_DEF(JSMSG_BAD_MODULE_SPECIFIER,      1, JSEXN_TYPEERR, "error resolving module specifier '{0}'")
622
MSG_DEF(JSMSG_BAD_MODULE_SPECIFIER,      1, JSEXN_TYPEERR, "error resolving module specifier '{0}'")
623
623
624
// Promise
624
// Promise
625
MSG_DEF(JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF,       0, JSEXN_TYPEERR, "A promise cannot be resolved with itself.")
625
MSG_DEF(JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF,       0, JSEXN_TYPEERR, "A promise cannot be resolved with itself.")
626
MSG_DEF(JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY, 0, JSEXN_TYPEERR, "GetCapabilitiesExecutor function already invoked with non-undefined values.")
626
MSG_DEF(JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY, 0, JSEXN_TYPEERR, "GetCapabilitiesExecutor function already invoked with non-undefined values.")
627
MSG_DEF(JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE,    0, JSEXN_TYPEERR, "A Promise subclass passed a non-callable value as the resolve function.")
627
MSG_DEF(JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE,    0, JSEXN_TYPEERR, "A Promise subclass passed a non-callable value as the resolve function.")
628
MSG_DEF(JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE,     0, JSEXN_TYPEERR, "A Promise subclass passed a non-callable value as the reject function.")
628
MSG_DEF(JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE,     0, JSEXN_TYPEERR, "A Promise subclass passed a non-callable value as the reject function.")
629
MSG_DEF(JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON,0, JSEXN_INTERNALERR, "Promise rejection value is a non-unwrappable cross-compartment wrapper.")
629
MSG_DEF(JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON,0, JSEXN_INTERNALERR, "Promise rejection value is a non-unwrappable cross-compartment wrapper.")

Return to bug 1342012