mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-27 03:14:15 +00:00
49 lines
972 B
JavaScript
49 lines
972 B
JavaScript
|
|
test("valid 'use strict; directive", () => {
|
||
|
|
expect(
|
||
|
|
(() => {
|
||
|
|
"use strict";
|
||
|
|
return isStrictMode();
|
||
|
|
})()
|
||
|
|
).toBeTrue();
|
||
|
|
expect(
|
||
|
|
(() => {
|
||
|
|
'use strict';
|
||
|
|
return isStrictMode();
|
||
|
|
})()
|
||
|
|
).toBeTrue();
|
||
|
|
});
|
||
|
|
|
||
|
|
test("invalid 'use strict; directive", () => {
|
||
|
|
expect(
|
||
|
|
(() => {
|
||
|
|
" use strict ";
|
||
|
|
return isStrictMode();
|
||
|
|
})()
|
||
|
|
).toBeFalse();
|
||
|
|
expect(
|
||
|
|
(() => {
|
||
|
|
`use strict`;
|
||
|
|
return isStrictMode();
|
||
|
|
})()
|
||
|
|
).toBeFalse();
|
||
|
|
expect(
|
||
|
|
(() => {
|
||
|
|
"use\
|
||
|
|
strict";
|
||
|
|
return isStrictMode();
|
||
|
|
})()
|
||
|
|
).toBeFalse();
|
||
|
|
expect(
|
||
|
|
(() => {
|
||
|
|
"use\ strict";
|
||
|
|
return isStrictMode();
|
||
|
|
})()
|
||
|
|
).toBeFalse();
|
||
|
|
expect(
|
||
|
|
(() => {
|
||
|
|
"use \163trict";
|
||
|
|
return isStrictMode();
|
||
|
|
})()
|
||
|
|
).toBeFalse();
|
||
|
|
});
|