summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2022-06-15 05:04:30 +0200
committerGitHub <noreply@github.com>2022-06-15 05:04:30 +0200
commit5bde4c7ecae35cb29a003504eafa03f1776ee3a0 (patch)
tree89639e1844181ee0e7ee03fba20d7d77d937f90e
parent8bfa89a478d6ebef32cf6c93d4cdc45e4a1cc550 (diff)
BREAKING: remove `Intl.v8BreakIterator` (#14864)
This is a non-standard API that is mostly replaced by `Intl.Segmenter`.
-rw-r--r--cli/tests/unit/intl_test.ts7
-rw-r--r--runtime/js/99_main.js7
2 files changed, 12 insertions, 2 deletions
diff --git a/cli/tests/unit/intl_test.ts b/cli/tests/unit/intl_test.ts
new file mode 100644
index 000000000..788dd3c65
--- /dev/null
+++ b/cli/tests/unit/intl_test.ts
@@ -0,0 +1,7 @@
+// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+import { assertEquals } from "./test_util.ts";
+
+Deno.test("Intl.v8BreakIterator should be undefined", () => {
+ // @ts-expect-error Intl.v8BreakIterator is not a standard API
+ assertEquals(Intl.v8BreakIterator, undefined);
+});
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index e96482ba2..1d046d161 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -1,10 +1,13 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+"use strict";
+
// Removes the `__proto__` for security reasons. This intentionally makes
// Deno non compliant with ECMA-262 Annex B.2.2.1
-//
-"use strict";
delete Object.prototype.__proto__;
+// Remove Intl.v8BreakIterator because it is a non-standard API.
+delete Intl.v8BreakIterator;
+
((window) => {
const core = Deno.core;
const {