source: frontend/node_modules/webpack/lib/runtime/HasOwnPropertyRuntimeModule.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 910 bytes
RevLine 
[9af201e]1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Sergey Melyukov @smelukov
4*/
5
6"use strict";
7
8const RuntimeGlobals = require("../RuntimeGlobals");
9const RuntimeModule = require("../RuntimeModule");
10const Template = require("../Template");
11
12/** @typedef {import("../Compilation")} Compilation */
13
14class HasOwnPropertyRuntimeModule extends RuntimeModule {
15 constructor() {
16 super("hasOwnProperty shorthand");
17 }
18
19 /**
20 * Generates runtime code for this runtime module.
21 * @returns {string | null} runtime code
22 */
23 generate() {
24 const compilation = /** @type {Compilation} */ (this.compilation);
25 const { runtimeTemplate } = compilation;
26
27 return Template.asString([
28 `${RuntimeGlobals.hasOwnProperty} = ${runtimeTemplate.returningFunction(
29 "Object.prototype.hasOwnProperty.call(obj, prop)",
30 "obj, prop"
31 )}`
32 ]);
33 }
34}
35
36module.exports = HasOwnPropertyRuntimeModule;
Note: See TracBrowser for help on using the repository browser.