Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  test_missing_variables.js

  Sprache: JAVA
 

/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */


// Disable `xpc::IsInAutomation()` so that missing variables don't throw
// errors.
Services.prefs.setBoolPref(
  "security.turn_off_all_security_so_that_viruses_can_take_over_this_computer",
  false
);

/**
 * The following test demonstrates crashing behavior.
 */

add_task(function test_missing_variables() {
  const l10nReg = new L10nRegistry();

  const fs = [
    { path: "/localization/en-US/browser/test.ftl", source: "welcome-message = Welcome { $user }\n" }
  ]
  const locales = ["en-US"];
  const source = L10nFileSource.createMock("test""app", locales, "/localization/{locale}", fs);
  l10nReg.registerSources([source]);
  const l10n = new Localization(["/browser/test.ftl"], true, l10nReg, locales);

  {
    const [message] = l10n.formatValuesSync([{ id: "welcome-message", args: { user: "Greg" } }]);
    equal(message, "Welcome Greg");
  }

  {
    // This will crash in debug builds.
    const [message] = l10n.formatValuesSync([{ id: "welcome-message" }]);
    equal(message, "Welcome {$user}");
  }
});

Messung V0.5 in Prozent
C=92 H=88 G=89

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002