source: trip-planner-front/node_modules/webpack/lib/runtime/HasOwnPropertyRuntimeModule.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 731 bytes
Line 
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
12class HasOwnPropertyRuntimeModule extends RuntimeModule {
13 constructor() {
14 super("hasOwnProperty shorthand");
15 }
16
17 /**
18 * @returns {string} runtime code
19 */
20 generate() {
21 const { runtimeTemplate } = this.compilation;
22
23 return Template.asString([
24 `${RuntimeGlobals.hasOwnProperty} = ${runtimeTemplate.returningFunction(
25 "Object.prototype.hasOwnProperty.call(obj, prop)",
26 "obj, prop"
27 )}`
28 ]);
29 }
30}
31
32module.exports = HasOwnPropertyRuntimeModule;
Note: See TracBrowser for help on using the repository browser.