---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/api-reference

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Porting code to ES5 standards mode scripts

# Porting code to ES5 standards mode scripts {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

ES5 standards mode catches errors that compatibility mode allows.

Consider the following behavior changes when porting code from existing scripts to new scoped scripts using ES5 standards mode:

* ECMAScript5 evaluates the term `new Boolean(false)` to true. In compatibility mode, it evaluated to false.
* ECMAScript5 throws an EcmaError when a non-existent property is referenced. In compatibility mode no error was thrown.
* ECMAScript5 throws an EcmaError when a non-existent function is called. In compatibility mode, no error was thrown.
* ECMAScript5 correctly handles new lines. In the past, a newline character after a comment was recognized, which is wrong. In this example, in compatibility mode, all three functions are called. In ECMAScript5, only the first function is called.

      var expr = doFoo();  // do foo
                 doBar();  // do bar
                 finish();   // all done
       eval(expr);

* ECMAScript5 correctly handles postfix increment and decrement. In this example, in compatibility mode, the variable x gets the incremented value, which is wrong.

      var x = gr.limit++;

{#c_JS_porting_code__ul_gxy_spb_hbc}

